|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jidesoft.editor.ColumnGuide
public class ColumnGuide
ColumnGuide
a line to indicate the certain columns that have special meaning. For example, some code
guideline says no line should be longer than 80. So it would be useful if there is a vertical line to indicate where
column 80 is.
CodeEditor.addColumnGuide(ColumnGuide)
.
We support any number of column guides. Each column guide can has its own color and stroke. The location can be
specified in number of columns or in pixels.
For each column guide, you can control the color and the stroke. If you want to a more customized guide, you can
always override paint method to do whatever painting you want. Please note, the paint of column guide is the last
steps in code editor painting process. So what you did in the column guide's paint method will override everything
else.
Field Summary | |
---|---|
static Color |
DEFAULT_COLOR
|
static int |
UNIT_IN_COLUMNS
A constant used by setUnit(int) to indicate the unit is in the number of columns. |
static int |
UNIT_IN_PIXELS
A constant used by setUnit(int) to indicate the unit is in the number of pixels. |
Constructor Summary | |
---|---|
ColumnGuide(int location)
Creates a column guide at the specified location (in columns by default) |
|
ColumnGuide(int location,
Color color)
Creates a column guide at the specified location (in columns by default) using the specified color. |
|
ColumnGuide(int location,
int unit)
Creates a column guide at the specified location. |
|
ColumnGuide(int location,
int unit,
Color color)
Creates a column guide at the specified location, using the specified color. |
Method Summary | |
---|---|
Color |
getColor()
Gets the color. |
int |
getLocation()
Gets the location of the column guide. |
Stroke |
getStroke()
Gets the stroke of the column guide line. |
int |
getUnit()
Gets the unit. |
void |
paint(CodeEditor codeEditor,
Graphics g,
Rectangle rect)
Paints the column guide. |
void |
setColor(Color color)
Sets the color of the column guide line. |
void |
setLocation(int location)
Sets the location of the column guide. |
void |
setStroke(Stroke stroke)
Sets the stroke of the column guide line. |
void |
setUnit(int unit)
Sets the unit. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int UNIT_IN_COLUMNS
setUnit(int)
to indicate the unit is in the number of columns.
public static final int UNIT_IN_PIXELS
setUnit(int)
to indicate the unit is in the number of pixels.
public static final Color DEFAULT_COLOR
Constructor Detail |
---|
public ColumnGuide(int location)
location
- the location of the column guide.public ColumnGuide(int location, int unit)
location
- the location of the column guide.unit
- the unit of the location.public ColumnGuide(int location, Color color)
location
- the location of the column guide.color
- the color of the column guide.public ColumnGuide(int location, int unit, Color color)
location
- the location of the column guide.unit
- the unit of the location.color
- the color of the column guide.Method Detail |
---|
public int getLocation()
public void setLocation(int location)
getUnit()
.
location
- the location of the column guide.public int getUnit()
UNIT_IN_COLUMNS
(default) or UNIT_IN_PIXELS
.
public void setUnit(int unit)
UNIT_IN_COLUMNS
(default) or UNIT_IN_PIXELS
.
unit
- the unit.public Color getColor()
public void setColor(Color color)
color
- the color of the column guide line.public Stroke getStroke()
public void setStroke(Stroke stroke)
stroke
- the stroke of the column guide line.public void paint(CodeEditor codeEditor, Graphics g, Rectangle rect)
codeEditor
- the code editor where the column guide is added.g
- the graphics contextrect
- the clip rect.
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |