public class IlvDataIndicator extends IlvChartDecoration
An IlvDataIndicator
can be used to represent different types of data values, each one with its
own graphical representation. Here is the possible type of values that can be
marked :
And here are two pictures showing the graphical representations associated with the different types of data values, for a Cartesian chart and a radar chart:
IlvChart.addDecoration(ilog.views.chart.IlvChartDecoration),
Serialized Form| Modifier and Type | Field and Description |
|---|---|
static int |
WINDOW
Type constant: specifies that the indicator is used to mark a data
window.
|
static int |
X_RANGE
Type constant: specifies that the indicator is used to mark a data range
along an x-axis.
|
static int |
X_VALUE
Type constant: specifies that the indicator is used to mark a value
along an x-axis.
|
static int |
Y_RANGE
Type constant: specifies that the indicator is used to mark a data range
along a y-axis.
|
static int |
Y_VALUE
Type constant: specifies that the indicator is used to mark a value
along a y-axis.
|
| Constructor and Description |
|---|
IlvDataIndicator(int axisIndex,
double value,
String text)
Creates an indicator for the specified value with the specified text.
|
IlvDataIndicator(int axisIndex,
IlvDataInterval range,
String text)
Creates an indicator for the specified range with the specified text.
|
IlvDataIndicator(int yAxisIndex,
IlvDataWindow dataWindow,
String text)
Creates an indicator for the specified data window with the specified text.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterDraw(Graphics g)
Draws the border of the indicator into the specified
Graphics
context. |
protected void |
baseTextDirectionChanged()
This method is invoked when the effective base text direction of the chart
has changed.
|
void |
beforeDraw(Graphics g)
Draws the background of the indicator into the specified
Graphics context. |
protected void |
chartConnected(IlvChart oldChart,
IlvChart newChart)
Called when the indicator is added to or removed from a chart.
|
protected void |
componentOrientationChanged(ComponentOrientation oldOrientation,
ComponentOrientation newOrientation)
This method is invoked when the component orientation of the chart has
changed.
|
protected IlvDoublePoint |
computeLabelLocation(IlvDataWindow dataWindow)
Returns the location of the label.
|
boolean |
contains(int x,
int y)
Indicates whether the graphical representation of the indicator contains
the specified point.
|
void |
draw(Graphics g)
Draws the indicator into the specified
Graphics context. |
int |
getAxisIndex()
Returns the index of the axis to which this indicator is attached.
|
Rectangle2D |
getBounds(Rectangle2D retBounds)
Returns the bounds of this decoration.
|
IlvDataWindow |
getDataWindow()
Returns the data window displayed by the indicator.
|
IlvStyle |
getDrawStyle()
Returns the rendering style actually used for this indicator.
|
IlvLabelRenderer |
getLabelRenderer()
Returns the renderer of the text displayed by this indicator.
|
IlvDataInterval |
getRange()
Returns the range displayed by this indicator.
|
Shape |
getShape()
Returns the
Shape corresponding to this data indicator. |
IlvStyle |
getStyle()
Returns the rendering style of this indicator.
|
String |
getText()
Returns the text associated with this indicator.
|
int |
getType()
Returns the type of this indicator.
|
double |
getValue()
Sets the value displayed by the indicator.
|
boolean |
has3DSupport()
Indicates whether the indicator supports three-dimensional drawing.
|
void |
setDataWindow(double xMin,
double xMax,
double yMin,
double yMax)
Modifies the data window displayed by this indicator.
|
void |
setDataWindow(IlvDataWindow w)
Modifies the data window displayed by this indicator.
|
void |
setLabelRenderer(IlvLabelRenderer renderer)
Sets the renderer of the text displayed by this indicator.
|
void |
setRange(IlvDataInterval range)
Sets the range displayed by this indicator.
|
void |
setStyle(IlvStyle style)
Specifies the rendering style of this indicator.
|
void |
setText(String text)
Sets the text associated with this indicator.
|
void |
setValue(double value)
Sets the value displayed by the indicator.
|
void |
setVisible(boolean visible)
Toggles the visibility of this decoration.
|
protected void |
updateBoundsCache()
Updates the bounds cache of this decoration.
|
getChart, getDrawOrder, isVisible, repaint, setDrawOrderpublic static final int X_VALUE
getType(),
Constant Field Valuespublic static final int Y_VALUE
getType(),
Constant Field Valuespublic static final int X_RANGE
getType(),
Constant Field Valuespublic static final int Y_RANGE
getType(),
Constant Field Valuespublic static final int WINDOW
getType(),
Constant Field Valuespublic IlvDataIndicator(int axisIndex,
double value,
String text)
axisIndex - The index of the considered axis:
-1 for the x-axis, or the index of a given
y-axis. The type of this indicator is set to
X_VALUE or Y_VALUE accordingly.value - The considered value.text - The text to display. May be null if no text is drawn.getType()public IlvDataIndicator(int axisIndex,
IlvDataInterval range,
String text)
axisIndex - The index of the considered axis:
-1 for the x-axis, or the index of a given
y-axis. The type of this indicator is set to
X_RANGE or Y_RANGE accordingly.range - The considered range.text - The text to display. May be null if no text is drawn.getType()public IlvDataIndicator(int yAxisIndex,
IlvDataWindow dataWindow,
String text)
WINDOW.yAxisIndex - The index of the considered y-axis.dataWindow - The considered data window.text - The text to display. May be null if no text is drawn.getType()protected void chartConnected(IlvChart oldChart, IlvChart newChart)
chartConnected in class IlvChartDecorationoldChart - The chart with which the decoration was associated, or
null if the decoration is added to a new chart.newChart - The chart to which the decoration is added, or
null if the decoration is removed from its current chart.IndexOutOfBoundsException - If the index of the y-axis is not valid.IlvChartOwnedDrawable.getChart()public boolean has3DSupport()
has3DSupport in interface IlvChart3DSupporthas3DSupport in interface IlvChartDrawablehas3DSupport in class IlvChartDecorationtrue if the indicator is drawn by a Cartesian chart, and
false otherwise.public final int getAxisIndex()
public final int getType()
public final double getValue()
X_VALUE or Y_VALUE.public void setValue(double value)
X_VALUE or Y_VALUE.UnsupportedOperationException - The type of the indicator is
different from X_VALUE or Y_VALUE.public final IlvDataInterval getRange()
null if
the type of the indicator is different from X_RANGE or
Y_RANGE.setRange(ilog.views.chart.IlvDataInterval)public void setRange(IlvDataInterval range)
X_RANGE or Y_RANGE.UnsupportedOperationException - The type of the indicator is
different from X_RANGE or Y_RANGE.public final IlvDataWindow getDataWindow()
X_RANGE, Y_RANGE, or WINDOW.public void setDataWindow(IlvDataWindow w)
WINDOW.UnsupportedOperationException - The type of the indicator is
not WINDOW.public void setDataWindow(double xMin,
double xMax,
double yMin,
double yMax)
WINDOW.UnsupportedOperationException - The type of the indicator is
not WINDOW.public String getText()
null
if no text is drawn.public void setText(String text)
X_VALUE or Y_VALUE types, or
with the stroke color of the drawing style in the other cases.text - The text to draw. May be null.getType(),
setStyle(ilog.views.chart.IlvStyle)public final IlvLabelRenderer getLabelRenderer()
public void setLabelRenderer(IlvLabelRenderer renderer)
public final IlvStyle getStyle()
public void setStyle(IlvStyle style)
public IlvStyle getDrawStyle()
getStyle()
when it has a non-null value, and a style that depends on
the chart otherwise.getStyle()public void beforeDraw(Graphics g)
Graphics context.beforeDraw in class IlvChartDecorationpublic void draw(Graphics g)
Graphics context.
Note: This method draws nothing. The actual drawing is produced by the
beforeDraw(java.awt.Graphics) and afterDraw(java.awt.Graphics) methods.
draw in interface IlvChartDrawabledraw in class IlvChartDecorationpublic void afterDraw(Graphics g)
Graphics
context.afterDraw in class IlvChartDecorationprotected IlvDoublePoint computeLabelLocation(IlvDataWindow dataWindow)
dataWindow - The data window covered by this indicator. This parameter
is the visible window for X_VALUE and Y_VALUE data indicators.public Rectangle2D getBounds(Rectangle2D retBounds)
getBounds in interface IlvChartDrawablegetBounds in class IlvChartDecorationretBounds - A rectangle optionally used to store the result. If this parameter
is null, a new Rectangle2D is allocated.public Shape getShape()
Shape corresponding to this data indicator.public boolean contains(int x,
int y)
x - The x-coordinate of the considered point, expressed in the projected
space.y - The y-coordinate of the considered point, expressed in projected
space.true if the point lies within the graphical
representation of the indicator, false otherwise.protected void updateBoundsCache()
getChart() && isVisible() is true, or when
getChart() && isVisible() becomes true.updateBoundsCache in class IlvChartDecorationprotected void componentOrientationChanged(ComponentOrientation oldOrientation, ComponentOrientation newOrientation)
componentOrientationChanged in class IlvChartDecorationoldOrientation - The component orientation before the change.newOrientation - The component orientation after the change.Component.getComponentOrientation()protected void baseTextDirectionChanged()
chart.getResolvedBaseTextDirection()
has changed, orchart.getComponentOrientation() has
changed and the value of
chart.getResolvedBaseTextDirection() is
IlvBidiUtil.CONTEXTUAL_DIRECTION.baseTextDirectionChanged in class IlvChartDecorationIlvChart.getResolvedBaseTextDirection(),
Component.getComponentOrientation()public void setVisible(boolean visible)
setVisible in class IlvChartDecorationIlvChartDecoration.isVisible()© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.