|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.fife.ui.rtextarea.LineNumberList
public class LineNumberList
Renders line numbers in the gutter.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected int |
currentLineCount
The number of lines in the text area. |
protected RTextArea |
textArea
The text area whose lines we are marking with icons. |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
LineNumberList(RTextArea textArea)
Constructs a new LineNumberList using default values for
line number color (gray) and highlighting the current line. |
|
LineNumberList(RTextArea textArea,
Color numberColor)
Constructs a new LineNumberList. |
|
| Method Summary | |
|---|---|
void |
addNotify()
Overridden to set width of this component correctly when we are first displayed (as keying off of the RTextArea gives us (0,0) when it isn't yet displayed. |
protected static Rectangle |
getChildViewBounds(View parent,
int line,
Rectangle editorRect)
Returns the bounds of a child view as a rectangle, since Views tend to use Shape. |
protected Gutter |
getGutter()
Returns the parent Gutter component. |
int |
getLineNumberingStartIndex()
Returns the starting line's line number. |
Dimension |
getPreferredSize()
|
void |
mouseClicked(MouseEvent e)
|
void |
mouseDragged(MouseEvent e)
|
void |
mouseEntered(MouseEvent e)
|
void |
mouseExited(MouseEvent e)
|
void |
mouseMoved(MouseEvent e)
|
void |
mousePressed(MouseEvent e)
|
void |
mouseReleased(MouseEvent e)
|
protected void |
paintComponent(Graphics g)
Paints this component. |
void |
removeNotify()
Called when this component is removed from the view hierarchy. |
void |
setFont(Font font)
Overridden to ensure line number cell sizes are updated with the font size change. |
void |
setLineNumberingStartIndex(int index)
Sets the starting line's line number. |
void |
setTextArea(RTextArea textArea)
Sets the text area being displayed. |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected RTextArea textArea
protected int currentLineCount
| Constructor Detail |
|---|
public LineNumberList(RTextArea textArea)
LineNumberList using default values for
line number color (gray) and highlighting the current line.
textArea - The text component for which line numbers will be
displayed.
public LineNumberList(RTextArea textArea,
Color numberColor)
LineNumberList.
textArea - The text component for which line numbers will be
displayed.numberColor - The color to use for the line numbers. If this is
null, gray will be used.| Method Detail |
|---|
public void addNotify()
addNotify in class JComponentpublic int getLineNumberingStartIndex()
1.
setLineNumberingStartIndex(int)public Dimension getPreferredSize()
getPreferredSize in class JComponentpublic void mouseClicked(MouseEvent e)
mouseClicked in interface MouseListenerpublic void mouseDragged(MouseEvent e)
mouseDragged in interface MouseMotionListenerpublic void mouseEntered(MouseEvent e)
mouseEntered in interface MouseListenerpublic void mouseExited(MouseEvent e)
mouseExited in interface MouseListenerpublic void mouseMoved(MouseEvent e)
mouseMoved in interface MouseMotionListenerpublic void mousePressed(MouseEvent e)
mousePressed in interface MouseListenerpublic void mouseReleased(MouseEvent e)
mouseReleased in interface MouseListenerprotected void paintComponent(Graphics g)
paintComponent in class JComponentg - The graphics context.public void removeNotify()
removeNotify in class JComponentpublic void setFont(Font font)
setFont in class JComponentfont - The new font to use for line numbers.public void setLineNumberingStartIndex(int index)
1. Applications can call this method to change this value
if they are displaying a subset of lines in a file, for example.
index - The new index.getLineNumberingStartIndex()public void setTextArea(RTextArea textArea)
textArea - The text area.
protected static final Rectangle getChildViewBounds(View parent,
int line,
Rectangle editorRect)
Views tend to use Shape.
parent - The parent view of the child whose bounds we're getting.line - The index of the child view.editorRect - Returned from the text area's
getVisibleEditorRect method.
protected Gutter getGutter()
Gutter component.
Gutter.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||