|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.border.AbstractBorder
br.uff.puro.dct.LineNumberedBorder
public class LineNumberedBorder
Draws line numbers next to each line, in the same font as the text. Currently, this can only be used with a JTextArea , since it relies on the getRows() and getLineCount() methods. A possible extension, create an interface to return this rows/linecount.
Field Summary | |
---|---|
static int |
LEFT_JUSTIFY
The line number should be left justified. |
static int |
LEFT_SIDE
The line numbers should be drawn on the left side of the component. |
static int |
RIGHT_JUSTIFY
The line number should be right justified. |
static int |
RIGHT_SIDE
The line numbers should be drawn on the right side of the component. |
Constructor Summary | |
---|---|
LineNumberedBorder(int location,
int justify)
|
Method Summary | |
---|---|
java.awt.Insets |
getBorderInsets(java.awt.Component c)
|
java.awt.Insets |
getBorderInsets(java.awt.Component c,
java.awt.Insets insets)
This modifies the insets, by adding space for the line number on the left. |
int |
getLineNumberJustification()
|
int |
getLocation()
|
void |
paintBorder(java.awt.Component c,
java.awt.Graphics g,
int x,
int y,
int width,
int height)
|
void |
setLineNumberJustification(int justify)
|
void |
setLocation(int loc)
|
Methods inherited from class javax.swing.border.AbstractBorder |
---|
getBaseline, getBaselineResizeBehavior, getInteriorRectangle, getInteriorRectangle, isBorderOpaque |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static int LEFT_SIDE
public static int RIGHT_SIDE
public static int RIGHT_JUSTIFY
public static int LEFT_JUSTIFY
Constructor Detail |
---|
public LineNumberedBorder(int location, int justify)
Method Detail |
---|
public java.awt.Insets getBorderInsets(java.awt.Component c)
getBorderInsets
in interface javax.swing.border.Border
getBorderInsets
in class javax.swing.border.AbstractBorder
public java.awt.Insets getBorderInsets(java.awt.Component c, java.awt.Insets insets)
getBorderInsets
in class javax.swing.border.AbstractBorder
c
- Description of the Parameterinsets
- Description of the Parameter
public int getLineNumberJustification()
public void setLineNumberJustification(int justify)
public int getLocation()
public void setLocation(int loc)
public void paintBorder(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)
paintBorder
in interface javax.swing.border.Border
paintBorder
in class javax.swing.border.AbstractBorder
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |