Examples of AttributeSet


Examples of com.cburch.logisim.data.AttributeSet

    }

    public void attributeListChanged(AttributeEvent e) { }

    public void attributeValueChanged(AttributeEvent e) {
      AttributeSet attrs = e.getSource();
      BitWidth addrBits = attrs.getValue(Mem.ADDR_ATTR);
      BitWidth dataBits = attrs.getValue(Mem.DATA_ATTR);
      getContents().setDimensions(addrBits.getWidth(), dataBits.getWidth());
    }
View Full Code Here

Examples of com.cburch.logisim.data.AttributeSet

  //
  // static methods - shared with other classes
  //
  static Value repair(InstanceState state, Value v) {
    AttributeSet opts = state.getProject().getOptions().getAttributeSet();
    Object onUndefined = opts.getValue(Options.ATTR_GATE_UNDEFINED);
    boolean errorIfUndefined = onUndefined.equals(Options.GATE_UNDEFINED_ERROR);
    Value repaired;
    if (errorIfUndefined) {
      int vw = v.getWidth();
      BitWidth w = state.getAttributeValue(StdAttr.WIDTH);
View Full Code Here

Examples of com.ebay.sdk.attributes.model.AttributeSet

  public void setCategoryCSProvider(ICategoryCSProvider categoryCSProvider) {
    this.categoryCSProvider = categoryCSProvider;
  }

  private AttributeSet extractOneCat(String catCsName, Map request) {
    AttributeSet attrSet = null;

    Object obj = request.get(catCsName);
    if (obj != null) {
      String cat_cs = ((String[])obj)[0];

      String[] delim = cat_cs.split("_");
      int catId = Integer.parseInt(delim[0]);
      int csId = Integer.parseInt(delim[1]);
      //int csId = this.mCategoryCSProvider.GetVCSId(catId);

      String prodId = null;
      if( delim.length > 2 )
        prodId= delim[2];

      if (csId != 0) {
        attrSet = AttrParamParser.parse(csId, request);
        attrSet.setCategoryID(catId);
        attrSet.setAttributeSetID(csId);

        if( prodId != null ) {
          attrSet.setProductID(prodId);
        }
      }
    }

    return attrSet;
View Full Code Here

Examples of com.ibm.richtext.textlayout.attributes.AttributeSet

        super(menuData);
       
        fKeys = (Object[]) keys.clone();
        fCharacter = character;
       
        AttributeSet keySet = new AttributeSet(keys);
        final StyleModifier modifier = StyleModifier.createRemoveModifier(keySet);
       
        fItem.addListener(new EventListener() {
            public void eventOccurred(EventObject event) {
                MTextPanel panel = getTextPanel();
View Full Code Here

Examples of javax.print.attribute.AttributeSet

     */
    private static void removeUnsupportedAttributes(PrintService ps,
                                                    DocFlavor flavor,
                                                    AttributeSet aset)
    {
        AttributeSet asUnsupported = ps.getUnsupportedAttributes(flavor,
                                                                 aset);

        if (asUnsupported != null) {
      Attribute[] usAttrs = asUnsupported.toArray();

            for (int i=0; i<usAttrs.length; i++) {
                Class category = usAttrs[i].getCategory();

                if (ps.isAttributeCategorySupported(category)) {
View Full Code Here

Examples of javax.swing.text.AttributeSet

      private String getLink(int pos, JEditorPane html) {
        Document doc = html.getDocument();
        if (doc instanceof HTMLDocument) {
          HTMLDocument hdoc = (HTMLDocument) doc;
          Element e = hdoc.getCharacterElement(pos);
          AttributeSet a = e.getAttributes();
          AttributeSet anchor = (AttributeSet) a.getAttribute(HTML.Tag.A);

          if (anchor != null) {
            return (String) anchor.getAttribute(HTML.Attribute.HREF);
          }
        }
        return null;
      }
View Full Code Here

Examples of javax.swing.text.AttributeSet

    for (int i = line + 1; i < endLine; i++)
    {
      Element branch = rootElement.getElement( i );
      Element leaf = doc.getCharacterElement( branch.getStartOffset() );
      AttributeSet as = leaf.getAttributes();

      if ( as.isEqual(comment) ) {
        applyHighlighting(content, i);
      }
    }
  }
View Full Code Here

Examples of javax.swing.text.AttributeSet

    }
  }

  private static AttributeSet computeStyle(final javax.swing.text.Element elem, final StyleSheet styles)
  {
    final AttributeSet a = elem.getAttributes();
    final AttributeSet htmlAttr = styles.translateHTMLToCSS(a);
    final ArrayList muxList = new ArrayList();

    if (htmlAttr.getAttributeCount() != 0)
    {
      muxList.add(htmlAttr);
    }

    if (elem.isLeaf())
    {
      // The swing-parser has a very weird way of storing attributes for the HTML elements. The
      // tag-name is used as key for the attribute set, so you have to know the element type before
      // you can do anything sensible with it. Or as we do here, you have to search for the HTML.Tag
      // object. Arghh.
      final Enumeration keys = a.getAttributeNames();
      while (keys.hasMoreElements())
      {
        final Object key = keys.nextElement();
        if (!(key instanceof HTML.Tag))
        {
          continue;
        }

        if (key == HTML.Tag.A)
        {
          final Object o = a.getAttribute(key);
          if (o instanceof AttributeSet)
          {
            final AttributeSet attr = (AttributeSet) o;
            if (attr.getAttribute(HTML.Attribute.HREF) == null)
            {
              continue;
            }
          }
        }

        final AttributeSet cssRule = styles.getRule((HTML.Tag) key, elem);
        if (cssRule != null)
        {
          muxList.add(cssRule);
        }
      }
    }
    else
    {
      final HTML.Tag t = (HTML.Tag) a.getAttribute(StyleConstants.NameAttribute);
      final AttributeSet cssRule = styles.getRule(t, elem);
      if (cssRule != null)
      {
        muxList.add(cssRule);
      }
    }

    final MutableAttributeSet retval = new SimpleAttributeSet();
    for (int i = muxList.size() - 1; i >= 0; i--)
    {
      final AttributeSet o = (AttributeSet) muxList.get(i);
      retval.addAttributes(o);
    }
    return retval;
  }
View Full Code Here

Examples of javax.swing.text.AttributeSet

      return null;
    }

    if (textElement.isLeaf())
    {
      final AttributeSet attributes = textElement.getAttributes();
      if (HTML.Tag.IMG.equals(attributes.getAttribute(StyleConstants.NameAttribute)))
      {
        final Element result = new Element();
        result.setName(textElement.getName());
        result.setElementType(ContentType.INSTANCE);
        final String src = (String) attributes.getAttribute(HTML.Attribute.SRC);
        final String alt = (String) attributes.getAttribute(HTML.Attribute.TITLE);
        result.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.VALUE, convertURL(src));
        result.setAttribute(AttributeNames.Html.NAMESPACE, AttributeNames.Html.TITLE, alt);
        result.setAttribute(AttributeNames.Html.NAMESPACE, AttributeNames.Swing.TOOLTIP, alt);
        if (attributes.isDefined(HTML.Attribute.WIDTH) &&
            attributes.isDefined(HTML.Attribute.HEIGHT))
        {
          result.getStyle().setStyleProperty(ElementStyleKeys.SCALE, Boolean.TRUE);
          result.getStyle().setStyleProperty(ElementStyleKeys.KEEP_ASPECT_RATIO, Boolean.FALSE);
          result.getStyle().setStyleProperty(ElementStyleKeys.MIN_WIDTH,
              parseLength(String.valueOf(attributes.getAttribute(HTML.Attribute.WIDTH))));
          result.getStyle().setStyleProperty(ElementStyleKeys.MIN_HEIGHT,
              parseLength(String.valueOf(attributes.getAttribute(HTML.Attribute.HEIGHT))));
        }
        else if (attributes.isDefined(HTML.Attribute.WIDTH))
        {
          result.getStyle().setStyleProperty(ElementStyleKeys.SCALE, Boolean.TRUE);
          result.getStyle().setStyleProperty(ElementStyleKeys.KEEP_ASPECT_RATIO, Boolean.TRUE);
          result.getStyle().setStyleProperty(ElementStyleKeys.MIN_WIDTH,
              parseLength(String.valueOf(attributes.getAttribute(HTML.Attribute.WIDTH))));
          result.getStyle().setStyleProperty(ElementStyleKeys.DYNAMIC_HEIGHT, Boolean.TRUE);
        }
        else if (attributes.isDefined(HTML.Attribute.HEIGHT))
        {
          result.getStyle().setStyleProperty(ElementStyleKeys.SCALE, Boolean.TRUE);
          result.getStyle().setStyleProperty(ElementStyleKeys.KEEP_ASPECT_RATIO, Boolean.TRUE);
          result.getStyle().setStyleProperty(ElementStyleKeys.MIN_HEIGHT,
              parseLength(String.valueOf(attributes.getAttribute(HTML.Attribute.HEIGHT))));
          result.getStyle().setStyleProperty(ElementStyleKeys.DYNAMIC_HEIGHT, Boolean.TRUE);
        }
        else
        {
          result.getStyle().setStyleProperty(ElementStyleKeys.SCALE, Boolean.FALSE);
View Full Code Here

Examples of javax.swing.text.AttributeSet

  private boolean isInvisible(final javax.swing.text.Element textElement)
  {
    final HTMLDocument htmlDocument = (HTMLDocument) textElement.getDocument();
    final StyleSheet sheet = htmlDocument.getStyleSheet();
    final AttributeSet attr = computeStyle(textElement, sheet);
    final Object o = attr.getAttribute(CSS.Attribute.DISPLAY);
    if ("none".equals(String.valueOf(o)))
    {
      return true;
    }
    final Object tag = findTag(textElement.getAttributes());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.