예제 #1
0
  public void updateMode() {
    Mode mode = editor.getMode();

    textColor[SELECTED] = mode.getColor("footer.text.selected.color");
    textColor[UNSELECTED] = mode.getColor("footer.text.unselected.color");
    font = mode.getFont("footer.text.font");

    tabColor[SELECTED] = mode.getColor("footer.tab.selected.color");
    tabColor[UNSELECTED] = mode.getColor("footer.tab.unselected.color");

    updateColor = mode.getColor("footer.updates.color");

    gradient = mode.makeGradient("footer", 400, HIGH);
  }
예제 #2
0
  public JavaTextArea(TextAreaDefaults defaults, JavaEditor editor) {
    super(defaults, new JavaInputHandler(editor));
    this.editor = editor;

    // removed all this since we have the createPainter() method and we
    // won't have to remove/re-add the custom painter object [fry 150122]
    // although there's also something bad happening here, that we're
    // re-forwarding all those events to all the other listeners?
    // that's making a hacky mess, plus the tweak code is also doing
    // something similar? [fry 150512]

    //    // replace the painter:
    //    // first save listeners, these are package-private in JEditTextArea, so not accessible
    //    ComponentListener[] componentListeners = painter.getComponentListeners();
    mouseListeners = painter.getMouseListeners();
    //    MouseMotionListener[] mouseMotionListeners = painter.getMouseMotionListeners();
    //
    //    remove(painter);
    //    // set new painter
    //    customPainter = new TextAreaPainter(this, defaults);
    //    painter = customPainter;
    //
    //    // set listeners
    //    for (ComponentListener cl : componentListeners) {
    //      painter.addComponentListener(cl);
    //    }
    //
    //    for (MouseMotionListener mml : mouseMotionListeners) {
    //      painter.addMouseMotionListener(mml);
    //    }

    // use a custom mouse handler instead of directly using mouseListeners
    MouseHandler mouseHandler = new MouseHandler();
    painter.addMouseListener(mouseHandler);
    painter.addMouseMotionListener(mouseHandler);
    // addCompletionPopupListner();
    add(CENTER, painter);

    // load settings from theme.txt
    Mode mode = editor.getMode();
    gutterGradient = mode.makeGradient("editor", Editor.LEFT_GUTTER, 500);
    // gutterBgColor = mode.getColor("editor.gutter.bgcolor");
    gutterLineColor = mode.getColor("editor.gutter.linecolor");
    gutterPadding = mode.getInteger("editor.gutter.padding");

    // TweakMode code
    prevCompListeners = painter.getComponentListeners();
    prevMouseListeners = painter.getMouseListeners();
    prevMMotionListeners = painter.getMouseMotionListeners();
    prevKeyListeners = editor.getKeyListeners();

    tweakMode = false;
    addPrevListeners();
  }