Examples of TextAttribute


Examples of java.awt.font.TextAttribute

        underline = false;
        strikethrough = false;
        for (AttributedCharacterIterator.Attribute attribute: iter.getAttributes().keySet()) {
            if (!(attribute instanceof TextAttribute))
                continue;
            TextAttribute textattribute = (TextAttribute)attribute;
            if(textattribute.equals(TextAttribute.FONT)) {
                Font font = (Font)iter.getAttributes().get(textattribute);
                setFont(font);
            }
            else if(textattribute.equals(TextAttribute.UNDERLINE)) {
                if(iter.getAttributes().get(textattribute) == TextAttribute.UNDERLINE_ON)
                    underline = true;
            }
            else if(textattribute.equals(TextAttribute.STRIKETHROUGH)) {
              if(iter.getAttributes().get(textattribute) == TextAttribute.STRIKETHROUGH_ON)
                strikethrough = true;
            }
            else if(textattribute.equals(TextAttribute.SIZE)) {
                Object obj = iter.getAttributes().get(textattribute);
                if(obj instanceof Integer) {
                    int i = ((Integer)obj).intValue();
                    setFont(getFont().deriveFont(getFont().getStyle(), i));
                }
                else if(obj instanceof Float) {
                    float f = ((Float)obj).floatValue();
                    setFont(getFont().deriveFont(getFont().getStyle(), f));
                }
            }
            else if(textattribute.equals(TextAttribute.FOREGROUND)) {
                setColor((Color) iter.getAttributes().get(textattribute));
            }
            else if(textattribute.equals(TextAttribute.FAMILY)) {
              Font font = getFont();
              Map fontAttributes = font.getAttributes();
              fontAttributes.put(TextAttribute.FAMILY, iter.getAttributes().get(textattribute));
              setFont(font.deriveFont(fontAttributes));
            }
            else if(textattribute.equals(TextAttribute.POSTURE)) {
              Font font = getFont();
              Map fontAttributes = font.getAttributes();
              fontAttributes.put(TextAttribute.POSTURE, iter.getAttributes().get(textattribute));
              setFont(font.deriveFont(fontAttributes));
            }
            else if(textattribute.equals(TextAttribute.WEIGHT)) {
              Font font = getFont();
              Map fontAttributes = font.getAttributes();
              fontAttributes.put(TextAttribute.WEIGHT, iter.getAttributes().get(textattribute));
              setFont(font.deriveFont(fontAttributes));
            }
View Full Code Here

Examples of java.awt.font.TextAttribute

        underline = false;
        strikethrough = false;
        for (AttributedCharacterIterator.Attribute attribute: iter.getAttributes().keySet()) {
            if (!(attribute instanceof TextAttribute))
                continue;
            TextAttribute textattribute = (TextAttribute)attribute;
            if(textattribute.equals(TextAttribute.FONT)) {
                Font font = (Font)iter.getAttributes().get(textattribute);
                setFont(font);
            }
            else if(textattribute.equals(TextAttribute.UNDERLINE)) {
                if(iter.getAttributes().get(textattribute) == TextAttribute.UNDERLINE_ON)
                    underline = true;
            }
            else if(textattribute.equals(TextAttribute.STRIKETHROUGH)) {
              if(iter.getAttributes().get(textattribute) == TextAttribute.STRIKETHROUGH_ON)
                strikethrough = true;
            }
            else if(textattribute.equals(TextAttribute.SIZE)) {
                Object obj = iter.getAttributes().get(textattribute);
                if(obj instanceof Integer) {
                    int i = ((Integer)obj).intValue();
                    setFont(getFont().deriveFont(getFont().getStyle(), i));
                }
                else if(obj instanceof Float) {
                    float f = ((Float)obj).floatValue();
                    setFont(getFont().deriveFont(getFont().getStyle(), f));
                }
            }
            else if(textattribute.equals(TextAttribute.FOREGROUND)) {
                setColor((Color) iter.getAttributes().get(textattribute));
            }
            else if(textattribute.equals(TextAttribute.FAMILY)) {
              Font font = getFont();
              Map fontAttributes = font.getAttributes();
              fontAttributes.put(TextAttribute.FAMILY, iter.getAttributes().get(textattribute));
              setFont(font.deriveFont(fontAttributes));
            }
            else if(textattribute.equals(TextAttribute.POSTURE)) {
              Font font = getFont();
              Map fontAttributes = font.getAttributes();
              fontAttributes.put(TextAttribute.POSTURE, iter.getAttributes().get(textattribute));
              setFont(font.deriveFont(fontAttributes));
            }
            else if(textattribute.equals(TextAttribute.WEIGHT)) {
              Font font = getFont();
              Map fontAttributes = font.getAttributes();
              fontAttributes.put(TextAttribute.WEIGHT, iter.getAttributes().get(textattribute));
              setFont(font.deriveFont(fontAttributes));
            }
View Full Code Here

Examples of java.awt.font.TextAttribute

    public void init(Map desktopProperties) {
    }

    public void mapInputMethodHighlight(InputMethodHighlight highlight, Map map) {
        TextAttribute key = TextAttribute.SWAP_COLORS;
        if (highlight.isSelected()) {
            map.put(key, TextAttribute.SWAP_COLORS_ON);
            return;
        }
        switch(highlight.getState()) {
View Full Code Here

Examples of java.awt.font.TextAttribute

    public boolean canConvert(Class type) {
        return type == TextAttribute.class;
    }

    public String toString(Object source) {
        TextAttribute attribute = (TextAttribute)source;
        try {
            getName.setAccessible(true);
            return (String)getName.invoke(attribute, (Object[])null);
        } catch (IllegalAccessException e) {
            throw new ObjectAccessException("Cannot get name of TextAttribute", e);
View Full Code Here

Examples of java.awt.font.TextAttribute

        underline = false;
        strikethrough = false;
        for (AttributedCharacterIterator.Attribute attribute: iter.getAttributes().keySet()) {
            if (!(attribute instanceof TextAttribute))
                continue;
            TextAttribute textattribute = (TextAttribute)attribute;
            if(textattribute.equals(TextAttribute.FONT)) {
                Font font = (Font)iter.getAttributes().get(textattribute);
                setFont(font);
            }
            else if(textattribute.equals(TextAttribute.UNDERLINE)) {
                if(iter.getAttributes().get(textattribute) == TextAttribute.UNDERLINE_ON)
                    underline = true;
            }
            else if(textattribute.equals(TextAttribute.STRIKETHROUGH)) {
              if(iter.getAttributes().get(textattribute) == TextAttribute.STRIKETHROUGH_ON)
                strikethrough = true;
            }
            else if(textattribute.equals(TextAttribute.SIZE)) {
                Object obj = iter.getAttributes().get(textattribute);
                if(obj instanceof Integer) {
                    int i = ((Integer)obj).intValue();
                    setFont(getFont().deriveFont(getFont().getStyle(), i));
                }
                else if(obj instanceof Float) {
                    float f = ((Float)obj).floatValue();
                    setFont(getFont().deriveFont(getFont().getStyle(), f));
                }
            }
            else if(textattribute.equals(TextAttribute.FOREGROUND)) {
                setColor((Color) iter.getAttributes().get(textattribute));
            }
            else if(textattribute.equals(TextAttribute.FAMILY)) {
              Font font = getFont();
              Map fontAttributes = font.getAttributes();
              fontAttributes.put(TextAttribute.FAMILY, iter.getAttributes().get(textattribute));
              setFont(font.deriveFont(fontAttributes));
            }
            else if(textattribute.equals(TextAttribute.POSTURE)) {
              Font font = getFont();
              Map fontAttributes = font.getAttributes();
              fontAttributes.put(TextAttribute.POSTURE, iter.getAttributes().get(textattribute));
              setFont(font.deriveFont(fontAttributes));
            }
            else if(textattribute.equals(TextAttribute.WEIGHT)) {
              Font font = getFont();
              Map fontAttributes = font.getAttributes();
              fontAttributes.put(TextAttribute.WEIGHT, iter.getAttributes().get(textattribute));
              setFont(font.deriveFont(fontAttributes));
            }
View Full Code Here

Examples of org.eclipse.jface.text.TextAttribute

  protected DroolsScanner getXMLScanner() {
    if (scanner == null) {
      scanner = new DroolsScanner(colorManager);
      scanner.setDefaultReturnToken(
        new Token(
          new TextAttribute(
            colorManager.getColor(IDroolsColorConstants.DEFAULT))));
    }
    return scanner;
  }
View Full Code Here

Examples of org.eclipse.jface.text.TextAttribute

  protected DroolsTagScanner getXMLTagScanner() {
    if (tagScanner == null) {
      tagScanner = new DroolsTagScanner(colorManager);
      tagScanner.setDefaultReturnToken(
        new Token(
          new TextAttribute(
            colorManager.getColor(IDroolsColorConstants.TAG))));
    }
    return tagScanner;
  }
View Full Code Here

Examples of org.eclipse.jface.text.TextAttribute

    reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
    reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);

    NonRuleBasedDamagerRepairer ndr =
      new NonRuleBasedDamagerRepairer(
        new TextAttribute(
          colorManager.getColor(IDroolsColorConstants.COMMENT)));
    reconciler.setDamager(ndr, DroolsPartitionScanner.COMMENT);
    reconciler.setRepairer(ndr, DroolsPartitionScanner.COMMENT);

    return reconciler;
View Full Code Here

Examples of org.eclipse.jface.text.TextAttribute

  protected RSScanner getVSScanner() {
    if (scanner == null) {
      scanner = new RSScanner(colorManager);
      scanner.setDefaultReturnToken(
        new Token(
          new TextAttribute(
            colorManager.getColor(IRSColorConstants.DEFAULT))));
    }
    return scanner;
  }
View Full Code Here

Examples of org.eclipse.jface.text.TextAttribute

    reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
    reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);

    NonRuleBasedDamagerRepairer ndr =
      new NonRuleBasedDamagerRepairer(
        new TextAttribute(
          colorManager.getColor(IRSColorConstants.VS_COMMENT)));
    reconciler.setDamager(ndr, RSPartitionScanner.COMMENT);
    reconciler.setRepairer(ndr, RSPartitionScanner.COMMENT);

    return reconciler;
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.