@Override protected void init() { super.init(); // Initialize currentLine; otherwise, the current line won't start // off as highlighted. currentLine = 0; setLineNumberingStartIndex(1); visibleRect = new Rectangle(); // Must be initialized addMouseListener(this); addMouseMotionListener(this); aaHints = RSyntaxUtilities.getDesktopAntiAliasHints(); }
@Override public LineNumberList createLineNumberList(RTextArea textArea) { this.textArea = (PSTextArea) textArea; numberList = super.createLineNumberList(textArea); //numberList.setBorder(BorderFactory.createLineBorder(Color.RED)); numberList.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent me) { PSTextAreaEditorKit.this.textArea.trataCliqueNoNumeroDaLinha(me.getPoint()); } }); return numberList; }
@Override protected void init() { super.init(); // Initialize currentLine; otherwise, the current line won't start // off as highlighted. currentLine = 0; setLineNumberingStartIndex(1); visibleRect = new Rectangle(); // Must be initialized addMouseListener(this); addMouseMotionListener(this); aaHints = RSyntaxUtilities.getDesktopAntiAliasHints(); }
/** * Constructs a new <code>LineNumberList</code>. * * @param textArea The text component for which line numbers will be * displayed. * @param numberColor The color to use for the line numbers. */ public LineNumberList(RTextArea textArea, Color numberColor) { super(textArea); if (numberColor!=null) { setForeground(numberColor); } else { setForeground(Color.GRAY); } // Initialize currentLine; otherwise, the current line won't start // off as highlighted. currentLine = 0; setLineNumberingStartIndex(1); visibleRect = new Rectangle(); // Must be initialized addMouseListener(this); addMouseMotionListener(this); }
/** * Constructs a new <code>LineNumberList</code>. * * @param textArea The text component for which line numbers will be * displayed. * @param numberColor The color to use for the line numbers. */ public LineNumberList(RTextArea textArea, Color numberColor) { super(textArea); if (numberColor!=null) { setForeground(numberColor); } else { setForeground(Color.GRAY); } // Initialize currentLine; otherwise, the current line won't start // off as highlighted. currentLine = 0; setLineNumberingStartIndex(1); visibleRect = new Rectangle(); // Must be initialized addMouseListener(this); addMouseMotionListener(this); }