/** * 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. If this is * <code>null</code>, gray will be used. */ public LineNumberList(RTextArea textArea, Color numberColor) { super(textArea); if (numberColor!=null) { setForeground(numberColor); } else { setForeground(Color.GRAY); } }
/** * Sets the color to use to paint line numbers. * * @param color The color to use when painting line numbers. * @see #getLineNumberColor() */ public void setLineNumberColor(Color color) { if (color!=null && !color.equals(lineNumberColor)) { lineNumberColor = color; if (lineNumberList!=null) { lineNumberList.setForeground(color); } } }
/** * Sets the color to use to paint line numbers. * * @param color The color to use when painting line numbers. * @see #getLineNumberColor() */ public void setLineNumberColor(Color color) { lineNumberList.setForeground(color); }
/** * Sets the color to use to paint line numbers. * * @param color The color to use when painting line numbers. * @see #getLineNumberColor() */ public void setLineNumberColor(Color color) { lineNumberList.setForeground(color); }
/** * 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. If this is * <code>null</code>, gray will be used. */ public LineNumberList(RTextArea textArea, Color numberColor) { super(textArea); if (numberColor!=null) { setForeground(numberColor); } else { setForeground(Color.GRAY); } }
/** * Sets the color to use to paint line numbers. * * @param color The color to use when painting line numbers. * @see #getLineNumberColor() */ public void setLineNumberColor(Color color) { if (color!=null && !color.equals(lineNumberColor)) { lineNumberColor = color; if (lineNumberList!=null) { lineNumberList.setForeground(color); } } }
lineNumberList = kit.createLineNumberList(textArea); lineNumberList.setFont(getLineNumberFont()); lineNumberList.setForeground(getLineNumberColor()); lineNumberList.setLineNumberingStartIndex( getLineNumberingStartIndex());
/** * 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); }
lineNumberList = kit.createLineNumberList(textArea); lineNumberList.setFont(getLineNumberFont()); lineNumberList.setForeground(getLineNumberColor()); lineNumberList.setLineNumberingStartIndex( getLineNumberingStartIndex());