|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.dlsc.flexgantt.swing.layer.AbstractLayer com.dlsc.flexgantt.swing.layer.system.AbstractSystemLayer com.dlsc.flexgantt.swing.layer.system.GridLayer
public class GridLayer
The grid layer is responsible for drawing the vertical and horizontal grid
lines. The number of vertical grid lines depends on the current grid mode
(see AbstractGanttChart.getGridLineMode()
). Depending on the mode
the layer might draw no lines, minor lines only, major lines only or a
combination of minor and major grid lines. The layer allows for some
customization of the drawing. The colors used for the major and minor lines
and the thickness of the major lines may be changed.
Field Summary | |
---|---|
static java.lang.String |
PROPERTY_MAJOR_GRID_COLOR
Constant used for those property change events that get fired when the major grid color changes. |
static java.lang.String |
PROPERTY_MINOR_GRID_COLOR
Constant used for those property change events that get fired when the color for minor grid lines changes. |
Fields inherited from class com.dlsc.flexgantt.swing.layer.AbstractLayer |
---|
alpha, changeSupport, ganttChart, layerContainer, PROPERTY_ALPHA, PROPERTY_VISIBLE |
Constructor Summary | |
---|---|
GridLayer(LayerContainer lc)
Constructs a new grid layer. |
Method Summary | |
---|---|
java.awt.Color |
getHorizonalLineColor()
Returns the color used for drawing the horizontal grid lines. |
java.awt.Color |
getMajorGridColor()
Returns the color used to draw a vertical line across all rows in all layer containers in order to indicate the end of a major time unit (for example: the end of a year, the end of a month). |
java.awt.Color |
getMinorGridColor()
Returns the color used to draw a vertical line across all rows in all layer containers in order to indicate the end of a minor time unit (for example: the end of a day, the end of an hour). |
boolean |
isThickMajorGridLines()
Determines whether the major grid lines will be drawn thick (2 pixels wide). |
boolean |
isVerticalLinesOnTop()
Determines whether the vertical lines will be drawn on top of the horizontal lines or vice versa. |
protected void |
paintHorizontalLines(java.awt.Graphics g)
Draws the horizontal lines. |
protected void |
paintLayer(java.awt.Graphics g)
|
protected void |
paintVerticalLines(java.awt.Graphics g)
Draws the vertical grid lines. |
void |
setHorizonalLineColor(java.awt.Color color)
Set the color used for drawing the horizontal grid lines. |
void |
setMajorGridColor(java.awt.Color color)
Changes the color used for rendering those vertical grid lines that get drawn when the grid mode is set to GridLineMode.MAJOR_GRID_LINES . |
void |
setMinorGridColor(java.awt.Color color)
Changes the color used for rendering those vertical grid lines that get drawn when the grid mode is set to GridLineMode.MINOR_GRID_LINES . |
void |
setThickMajorGridLines(boolean thickMajorGridLines)
Specifies whether the major grid lines will be drawn thick (2 pixels wide). |
void |
setVerticalLinesOnTop(boolean verticalLinesOnTop)
Specifies whether the vertical lines will be drawn on top of the horizontal lines or vice versa. |
Methods inherited from class com.dlsc.flexgantt.swing.layer.AbstractLayer |
---|
addPropertyChangeListener, getAlpha, getDateline, getEventline, getGanttChart, getLayerContainer, getLayerPolicyProvider, getModel, getName, getStartRow, getTimeAt, getTimeline, getTimeLocation, getTimeSpanUsed, getToolTipText, getTreeTable, getTreeTablePolicyProvider, isVisible, removePropertyChangeListener, repaint, repaint, repaint, setAlpha, setVisible, tearDown |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PROPERTY_MAJOR_GRID_COLOR
setMajorGridColor(Color)
,
Constant Field Valuespublic static final java.lang.String PROPERTY_MINOR_GRID_COLOR
setMinorGridColor(Color)
,
Constant Field ValuesConstructor Detail |
---|
public GridLayer(LayerContainer lc)
lc
- the layer container to which the layer belongsMethod Detail |
---|
protected void paintLayer(java.awt.Graphics g)
paintLayer
in class AbstractLayer
protected void paintVerticalLines(java.awt.Graphics g)
g
- the graphics contextprotected void paintHorizontalLines(java.awt.Graphics g)
g
- the graphics contextpublic boolean isThickMajorGridLines()
setThickMajorGridLines(boolean)
public void setThickMajorGridLines(boolean thickMajorGridLines)
thickMajorGridLines
- if TRUE the major grid lines will be drawn thickisThickMajorGridLines()
public boolean isVerticalLinesOnTop()
setVerticalLinesOnTop(boolean)
public void setVerticalLinesOnTop(boolean verticalLinesOnTop)
verticalLinesOnTop
- if TRUE the vertical lines will be drawn on top of the
horizontal linesisVerticalLinesOnTop()
public void setMajorGridColor(java.awt.Color color)
GridLineMode.MAJOR_GRID_LINES
.
Setting a new major grid color will trigger a property change event with
the name/id set to the constant PROPERTY_MAJOR_GRID_COLOR
.
color
- the major grid colorgetMajorGridColor()
,
AbstractGanttChart.setGridLineMode(GridLineMode)
public java.awt.Color getMajorGridColor()
setMajorGridColor(Color)
,
getMinorGridColor()
public void setMinorGridColor(java.awt.Color color)
GridLineMode.MINOR_GRID_LINES
.
Setting a new minor grid color will trigger a property change event with
the name/id set to the constant PROPERTY_MINOR_GRID_COLOR
.
color
- the minor grid colorgetMinorGridColor()
,
AbstractGanttChart.setGridLineMode(GridLineMode)
public java.awt.Color getMinorGridColor()
setMinorGridColor(Color)
,
getMajorGridColor()
public java.awt.Color getHorizonalLineColor()
public void setHorizonalLineColor(java.awt.Color color)
color
- the horizontal grid line color
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |