Example #1
0
  public EditorLineStatus(JEditTextArea textarea) {
    this.textarea = textarea;
    textarea.editorLineStatus = this;

    background = Theme.getColor("linestatus.bgcolor");
    font = Theme.getFont("linestatus.font");
    foreground = Theme.getColor("linestatus.color");
    high = Theme.getInteger("linestatus.height");

    if (Base.isMacOS()) {
      resize = Base.getThemeImage("resize.gif", this);
    }
    // linestatus.bgcolor = #000000
    // linestatus.font    = SansSerif,plain,10
    // linestatus.color   = #FFFFFF
  }
Example #2
0
  private void setTheme(String name) throws IOException {
    FileInputStream defaultXmlInputStream = null;
    try {
      defaultXmlInputStream =
          new FileInputStream(
              new File(BaseNoGui.getContentFile("lib"), "theme/syntax/" + name + ".xml"));
      Theme theme = Theme.load(defaultXmlInputStream);
      theme.apply(this);
    } finally {
      IOUtils.closeQuietly(defaultXmlInputStream);
    }

    setBackground(processing.app.Theme.getColor("editor.bgcolor"));
    setHighlightCurrentLine(processing.app.Theme.getBoolean("editor.linehighlight"));
    setCurrentLineHighlightColor(processing.app.Theme.getColor("editor.linehighlight.color"));
    setCaretColor(processing.app.Theme.getColor("editor.caret.color"));
    setSelectedTextColor(null);
    setUseSelectedTextColor(false);
    setSelectionColor(processing.app.Theme.getColor("editor.selection.color"));
    setMatchedBracketBorderColor(processing.app.Theme.getColor("editor.brackethighlight.color"));
    setHyperlinkForeground(
        (Color) processing.app.Theme.getStyledFont("url", getFont()).get("color"));

    setSyntaxTheme(TokenTypes.DATA_TYPE, "data_type");
    setSyntaxTheme(TokenTypes.FUNCTION, "function");
    setSyntaxTheme(TokenTypes.RESERVED_WORD, "reserved_word");
    setSyntaxTheme(TokenTypes.RESERVED_WORD_2, "reserved_word_2");
    setSyntaxTheme(TokenTypes.VARIABLE, "variable");
    setSyntaxTheme(TokenTypes.OPERATOR, "operator");
    setSyntaxTheme(TokenTypes.COMMENT_DOCUMENTATION, "comment1");
    setSyntaxTheme(TokenTypes.COMMENT_EOL, "comment1");
    setSyntaxTheme(TokenTypes.COMMENT_KEYWORD, "comment1");
    setSyntaxTheme(TokenTypes.COMMENT_MARKUP, "comment1");
    setSyntaxTheme(TokenTypes.COMMENT_MULTILINE, "comment2");
    setSyntaxTheme(TokenTypes.LITERAL_BOOLEAN, "literal_boolean");
    setSyntaxTheme(TokenTypes.LITERAL_CHAR, "literal_char");
    setSyntaxTheme(TokenTypes.LITERAL_STRING_DOUBLE_QUOTE, "literal_string_double_quote");
    setSyntaxTheme(TokenTypes.PREPROCESSOR, "preprocessor");

    Style style = getSyntaxScheme().getStyle(TokenTypes.IDENTIFIER);
    style.foreground = processing.app.Theme.getColor("editor.fgcolor");
    getSyntaxScheme().setStyle(TokenTypes.IDENTIFIER, style);
  }
Example #3
0
  public EditorToolbar(Editor editor, JMenu menu) {
    this.editor = editor;
    this.menu = menu;

    buttonCount = 0;
    which = new int[BUTTON_COUNT];

    //which[buttonCount++] = NOTHING;
    which[buttonCount++] = RUN;
    which[buttonCount++] = EXPORT;
    which[buttonCount++] = NEW;
    which[buttonCount++] = OPEN;
    which[buttonCount++] = SAVE;
    which[buttonCount++] = SERIAL;

    currentRollover = -1;

    bgcolor = Theme.getColor("buttons.bgcolor");
    statusFont = Theme.getFont("buttons.status.font");
    statusColor = Theme.getColor("buttons.status.color");

    addMouseListener(this);
    addMouseMotionListener(this);
  }
 public ImageIcon getIcon() {
   return new ImageIcon(Theme.getInstance().getDirImages() + "table.gif");
 } // TE: returns an icon.