Examples of SimpleAttributeSet


Examples of javax.swing.text.SimpleAttributeSet

            }
        }

        public void run() {
            StringBuffer writeBuffer = new StringBuffer();
            SimpleAttributeSet attr = null;
            int l = 0;
            while (true) {
                synchronized (this) {
                    try {
                        wait(2000);
                    } catch (InterruptedException ie) {
                    }
                }
                while (consoleBuffer.size() > 0) {
                    ConsoleWriterWrapper w = (ConsoleWriterWrapper) consoleBuffer.get(0);
                    String txt = w.text;
                    if (!txt.endsWith("\n")) {
                        txt = txt + "\n";
                    }
                    if (writeBuffer.length() != 0) {
                        writeText(writeBuffer.toString(), attr);
                        writeBuffer.setLength(0);
                        l = 0;
                    }
                    attr = new SimpleAttributeSet();
                    if (w.ok)
                        StyleConstants.setForeground(attr, Color.green.darker());
                    else
                        StyleConstants.setForeground(attr, Color.red.darker());
                    writeBuffer.append(txt);
View Full Code Here

Examples of javax.swing.text.SimpleAttributeSet

        double scale = (double)height / (double)image.getHeight(observer);
        return image.getScaledInstance((int)((double)image.getWidth(observer) * scale), height, Image.SCALE_SMOOTH);
    }

    public static SimpleAttributeSet getDefaultAttributeSet() {
            SimpleAttributeSet attrSet = new SimpleAttributeSet();
    //        Font f = new Font("Arial", Font.PLAIN, 11);
            Font f = UIManager.getFont("Label.font");
            StyleConstants.setFontFamily(attrSet, f.getFamily());
            StyleConstants.setFontSize(attrSet, f.getSize());
            StyleConstants.setBold(attrSet, false);
View Full Code Here

Examples of javax.swing.text.SimpleAttributeSet

  /**
   * creates attributes map for message style
   */
  private static void createTextAttributes() { 
    attributes = new Hashtable<Level, SimpleAttributeSet>();
    attributes.put(Level.ERROR, new SimpleAttributeSet());
    attributes.put(Level.FATAL, new SimpleAttributeSet());
    attributes.put(Level.WARN, new SimpleAttributeSet());
    StyleConstants.setForeground((MutableAttributeSet)attributes.get(Level.ERROR), Color.red);
    StyleConstants.setForeground((MutableAttributeSet)attributes.get(Level.FATAL), Color.red);
    StyleConstants.setForeground((MutableAttributeSet)attributes.get(Level.WARN), Color.blue);
    }
View Full Code Here

Examples of javax.swing.text.SimpleAttributeSet

  private void createDefaultFontAttributes() {
    Priority[] prio = Priority.getAllPossiblePriorities();

    fontAttributes = new Hashtable();
    for (int i=0; i<prio.length;i++) {
      MutableAttributeSet att = new SimpleAttributeSet();
      fontAttributes.put(prio[i], att);
      //StyleConstants.setFontSize(att,11);
    }

    setTextColor(Priority.FATAL, Color.red);
View Full Code Here

Examples of javax.swing.text.SimpleAttributeSet

      int tab = j + 1;
      tabs[j] = new TabStop(tab * tabWidth);
    }

    TabSet tabSet = new TabSet(tabs);
    SimpleAttributeSet attributes = new SimpleAttributeSet();
    StyleConstants.setTabSet(attributes, tabSet);
    int length = getDocument().getLength();
    getStyledDocument().setParagraphAttributes(0, length, attributes, false);
  }
View Full Code Here

Examples of javax.swing.text.SimpleAttributeSet

    public void consumeToken(Token token, int flavor) {
        if(ignoreToken(token))
            return;

        SimpleAttributeSet attr = null;
        switch(flavor) {
            case TOKEN_NORMAL: attr = attributeConsume; break;
            case TOKEN_HIDDEN: attr = attributeConsumeHidden; break;
            case TOKEN_DEAD: attr = attributeConsumeDead; break;
        }
View Full Code Here

Examples of javax.swing.text.SimpleAttributeSet

            }
        });
    }

    public void createTextAttributes() {
        attributeNonConsumed = new SimpleAttributeSet();
        StyleConstants.setForeground(attributeNonConsumed, AWPrefs.getNonConsumedTokenColor());

        attributeConsume = new SimpleAttributeSet();
        StyleConstants.setForeground(attributeConsume, AWPrefs.getConsumedTokenColor());

        attributeConsumeHidden = new SimpleAttributeSet();
        StyleConstants.setForeground(attributeConsumeHidden, AWPrefs.getHiddenTokenColor());

        attributeConsumeDead = new SimpleAttributeSet();
        StyleConstants.setForeground(attributeConsumeDead, AWPrefs.getDeadTokenColor());

        attributeLookahead = new SimpleAttributeSet();
        StyleConstants.setForeground(attributeLookahead, AWPrefs.getLookaheadTokenColor());
        StyleConstants.setItalic(attributeLookahead, true);
    }
View Full Code Here

Examples of javax.swing.text.SimpleAttributeSet

  private static final String PAID_STRING = "Ja";
  private static final String NOT_PAID_STRING = "Nei";
  private InvoiceDetails invoiceDetails;

  protected void setCenteredAlignment() {
    SimpleAttributeSet set = new SimpleAttributeSet();
    StyleConstants.setAlignment(set, StyleConstants.ALIGN_CENTER);
    setParagraphAttributes(set, false);
    repaint();

  }
View Full Code Here

Examples of javax.swing.text.SimpleAttributeSet

    private SimpleAttributeSet labelAttr;
    private SimpleAttributeSet actionRefAttr;
    private SimpleAttributeSet blockAttr;

    public GrammarSyntaxEngine() {
        parserRefAttr = new SimpleAttributeSet();
        lexerRefAttr = new SimpleAttributeSet();
        labelAttr = new SimpleAttributeSet();
        actionRefAttr = new SimpleAttributeSet();
        blockAttr = new SimpleAttributeSet();
    }
View Full Code Here

Examples of javax.swing.text.SimpleAttributeSet

        s.add("it");
    }

    public ATEStringTemplateSyntaxEngine() {
        super();
        blockAttr = new SimpleAttributeSet();
        labelAttr = new SimpleAttributeSet();
        templateAttr = new SimpleAttributeSet();
    }
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.