public class IlvGrid extends IlvChartOwnedDrawable implements Serializable
setDrawOrder(int)
method, which lets you specify whether the grid must be drawn above or below
the chart representations.Constructor and Description |
---|
IlvGrid()
Creates a new grid that displays only major grid lines, with the
default color.
|
IlvGrid(Paint majPaint)
Creates a new grid that displays only major grid lines, with the
specified paint.
|
IlvGrid(Paint majPaint,
Paint minPaint)
Creates a new grid that displays major and minor grid lines, with the
specified paints.
|
Modifier and Type | Method and Description |
---|---|
protected void |
chartConnected(IlvChart oldChart,
IlvChart newChart)
This method is called with a non-
null argument when this
drawable object is being attached to a chart. |
void |
draw(Graphics g)
Draws the grid.
|
protected void |
draw(Graphics g,
IlvDoubleArray values,
boolean major)
Draws the grid using the specified grid line values.
|
protected void |
drawGridLine(Graphics g,
Shape shape,
boolean major)
Draws the grid line.
|
IlvAxis |
getAxis()
Returns the axis to which this grid is connected.
|
static int |
getAxisIndex(IlvGrid grid)
Returns the axis index of the specified grid.
|
Rectangle2D |
getBounds(Rectangle2D retBounds)
Returns the bounds of this grid.
|
IlvChart |
getChart()
Returns the chart that displays this grid.
|
IlvCoordinateSystem |
getCoordinateSystem()
Returns the coordinate system used by this grid.
|
static Color |
getDefaultGridColor()
Returns the default grids color.
|
int |
getDrawOrder()
Returns the drawing order of this grid.
|
Shape[] |
getGridShapes(IlvDoubleArray values)
Returns the grid lines for the specified values as an
array of
Shape . |
Paint |
getMajorPaint()
Returns the paint used to draw major grid lines.
|
Stroke |
getMajorStroke()
Returns the stroke used to draw major grid lines.
|
IlvStyle |
getMajorStyle()
Returns the style used to draw major grid lines.
|
Paint |
getMinorPaint()
Returns the paint used to draw minor grid lines.
|
Stroke |
getMinorStroke()
Returns the stroke used to draw minor grid lines.
|
IlvStyle |
getMinorStyle()
Returns the style used to draw minor grid lines.
|
boolean |
has3DSupport()
Indicates whether the grid supports three-dimensional drawing.
|
boolean |
isMajorLineVisible()
Indicates whether major grid lines are visible.
|
boolean |
isMinorLineVisible()
Indicates whether minor grid lines are visible.
|
boolean |
isVisible()
Indicates whether this grid is visible.
|
static void |
setDefaultGridColor(Color color)
Sets the default grids color to the specified color.
|
void |
setDrawOrder(int drawOrder)
Sets the drawing order of this grid.
|
void |
setMajorLineVisible(boolean visible)
Toggles the visibility of major grid lines.
|
void |
setMajorPaint(Paint paint)
Sets the paint used to draw major grid lines.
|
void |
setMajorStroke(Stroke stroke)
Sets the stroke used to draw major grid lines.
|
void |
setMinorLineVisible(boolean visible)
Toggles the visibility of minor grid lines.
|
void |
setMinorPaint(Paint paint)
Sets the paint used to draw minor grid lines.
|
void |
setMinorStroke(Stroke stroke)
Sets the stroke used to draw minor grid lines.
|
void |
setVisible(boolean visible)
Toggles the visibility of both major an minor grid lines.
|
public IlvGrid()
IlvChart.DRAW_BELOW
.setDrawOrder(int)
public IlvGrid(Paint majPaint)
IlvChart.DRAW_BELOW
.setDrawOrder(int)
public final int getDrawOrder()
getDrawOrder
in interface IlvChartDrawable
IlvChartDrawable
objects are drawn in ascending drawing
order. The drawing order also specifies whether the object is drawn above
(positive values) or below (negative values) the graphical representations
of the chart data.setDrawOrder(int)
public void setDrawOrder(int drawOrder)
IlvChart.DRAW_BELOW
.IlvChart.DRAW_ABOVE
,
IlvChart.DRAW_BELOW
,
getDrawOrder()
public boolean isVisible()
isVisible
in interface IlvChartDrawable
public final void setVisible(boolean visible)
public final boolean isMajorLineVisible()
public void setMajorLineVisible(boolean visible)
public final boolean isMinorLineVisible()
public void setMinorLineVisible(boolean visible)
public final IlvStyle getMajorStyle()
public final Stroke getMajorStroke()
setMajorStroke(java.awt.Stroke)
public void setMajorStroke(Stroke stroke)
getMajorStroke()
public final Paint getMajorPaint()
setMajorPaint(java.awt.Paint)
public void setMajorPaint(Paint paint)
getMajorPaint()
public final IlvStyle getMinorStyle()
public final Stroke getMinorStroke()
setMinorStroke(java.awt.Stroke)
public void setMinorStroke(Stroke stroke)
getMinorStroke()
public final Paint getMinorPaint()
setMinorPaint(java.awt.Paint)
public void setMinorPaint(Paint paint)
getMinorPaint()
public final IlvChart getChart()
null
until the grid is connected
to a chart with the IlvChart.setXGrid(ilog.views.chart.IlvGrid)
or
IlvChart.setYGrid(int, ilog.views.chart.IlvGrid)
method.getChart
in class IlvChartOwnedDrawable
protected void chartConnected(IlvChart oldChart, IlvChart newChart)
null
argument when this
drawable object is being attached to a chart. It is called with a
null
chart argument when this drawable object is being
detached from its chart.
You should not call this method directly.
chartConnected
in class IlvChartOwnedDrawable
oldChart
- The previous owning chart. May be null
if this drawable object was not attached to a chart before.newChart
- The new associated chart. May be null
if
if this drawable object is being detached from its chart.IlvChartOwnedDrawable.getChart()
public final IlvAxis getAxis()
null
until the grid is connected
to a chart with the IlvChart.setXGrid(ilog.views.chart.IlvGrid)
or
IlvChart.setYGrid(int, ilog.views.chart.IlvGrid)
method.public final IlvCoordinateSystem getCoordinateSystem()
getAxis()
public boolean has3DSupport()
has3DSupport
in interface IlvChart3DSupport
has3DSupport
in interface IlvChartDrawable
true
if the grid is drawn by a Cartesian chart, and
false
otherwise.public void draw(Graphics g)
draw(Graphics, IlvDoubleArray, boolean)
method with the step
values of the scale connected to the same axis. If no scale exists,
this method does not perform any drawing.draw
in interface IlvChartDrawable
protected void draw(Graphics g, IlvDoubleArray values, boolean major)
g
- The destination graphics.values
- The grid lines values.major
- A boolean value indicating whether the values
are associated with major or minor grid lines.public Rectangle2D getBounds(Rectangle2D retBounds)
getBounds
in interface IlvChartDrawable
retBounds
- A rectangle optionally used to store the result.
If this parameter is null
, a new Rectangle2D
is allocated.public final Shape[] getGridShapes(IlvDoubleArray values)
Shape
.protected void drawGridLine(Graphics g, Shape shape, boolean major)
g
- The destination graphics.shape
- The Shape
representing the line.major
- true
if the current line is a major grid line.public static void setDefaultGridColor(Color color)
public static Color getDefaultGridColor()
public static int getAxisIndex(IlvGrid grid)
IllegalArgumentException
- The grid is not connected to a chart.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.