public abstract class IlvChartRenderer extends Object implements IlvChart3DSupport, IlvChartAreaAccessible, Serializable
IlvChartRenderer
object is responsible for displaying one
or several data sets according to its rendering type.
The IlvChartRenderer
instances can be added to a chart with the
following method: IlvChart.addRenderer(IlvChartRenderer)
.Modifier and Type | Field and Description |
---|---|
static int |
AREA
Area chart renderer type.
|
static int |
BAR
Bar chart renderer type.
|
static int |
BUBBLE
Bubble chart renderer type.
|
static int |
CANDLE
Candle chart renderer type.
|
static int |
CENTERED_LABEL_LAYOUT
Enum constant for label layout: specifies that the data label is centered
on the graphical representation of the data point.
|
static int |
COMBO
Combo chart renderer type.
|
static int |
DATA_LABEL
Enum constant for labeling mode: specifies that the label of the data
point should be displayed.
|
static int |
DEFAULT_LABEL_LAYOUT
The default label layout.
|
static int |
DEFAULT_LABELING
The default labeling mode.
|
static int |
HILO
HiLo chart renderer type.
|
static int |
HILO_ARROW
Clustered HiLo Arrow chart renderer type.
|
static int |
HILO_STICK
Clustered HiLo Stick chart renderer type.
|
static int |
HLOC
HighLow-OpenClose chart renderer type.
|
static int |
OUTSIDE_LABEL_LAYOUT
Enum constant for label layout: specifies that the data label is
drawn outside of the graphical representation of the data point.
|
static int |
PERCENT_LABEL
Enum constant for labeling mode: specifies that the percent contribution
of the data point should be displayed.
|
static int |
PIE
Pie chart renderer type.
|
static int |
POLYLINE
Polyline chart renderer type.
|
static int |
SCATTER
Scatter chart renderer type.
|
static int |
STACKED_AREA
Stacked area chart renderer type.
|
static int |
STACKED_BAR
Stacked bar chart renderer type.
|
static int |
STACKED_DIVERGING_BAR
Stacked diverging bar chart renderer type.
|
static int |
STACKED_POLYLINE
Stacked polyline chart renderer type.
|
static int |
STACKED_STAIR
Stacked stair chart renderer type.
|
static int |
STACKED100_AREA
Stacked100 area chart renderer type.
|
static int |
STACKED100_BAR
Stacked100 bar chart renderer type.
|
static int |
STACKED100_POLYLINE
Stacked100 polyline chart renderer type.
|
static int |
STACKED100_STAIR
Stacked100 stair chart renderer type.
|
static int |
STAIR
Stair chart renderer type.
|
static int |
SUMMED_STAIR
Summed stair chart renderer type.
|
static int |
SUPERIMPOSED_BAR
Superimposed bar chart renderer type.
|
static int |
TREEMAP
Treemap chart renderer type.
|
static int |
X_VALUE_LABEL
Enum constant for labeling mode: specifies that the x-value of the data
point should be displayed.
|
static int |
XY_VALUES_LABEL
Enum constant for labeling mode: specifies that the x- and y-values of the data
point should be displayed.
|
static int |
Y_VALUE_LABEL
Enum constant for labeling mode: specifies that the y-value of the data
point should be displayed.
|
Modifier | Constructor and Description |
---|---|
protected |
IlvChartRenderer()
Creates a new chart renderer and connects it to a default data source.
|
Modifier and Type | Method and Description |
---|---|
void |
addImageMapAreas(IlvIMapDefinition mapDef,
List<? super IlvIMapArea> areaList)
Generates image map areas.
|
void |
applyStyles(boolean newStyles)
Applies styling to the renderer.
|
protected static void |
applyStyles(IlvDataSet dataSet,
IlvChartRenderer renderer,
boolean doClear,
int firstIdx,
int lastIdx,
ilog.views.chart.styling.IlvStylingSupport support)
Re-applies styles on the specific data points.
|
static ilog.views.chart.styling.IlvDataSetStyle |
applyStyles(IlvDataSet dataSet,
IlvChartRenderer renderer,
IlvChartRenderer rendererBean,
ilog.views.chart.styling.IlvStylingSupport support,
boolean differentNodes)
Applies styles on the specified data set.
|
protected void |
chartConnected(IlvChart oldChart,
IlvChart newChart)
Called when the renderer is added to or removed from a chart.
|
void |
collectDisplayItems(IlvChartDataPicker picker,
ArrayList<IlvDisplayPoint> accumulator)
Collects the display items containing the specified picking point.
|
String |
computeDataLabel(IlvDataSetPoint dp)
Computes the data label associated with the specified point.
|
Point |
computeDataLabelLocation(IlvDisplayPoint dp,
Dimension size)
Computes the location of the data label associated with the specified
point.
|
static IlvChartRenderer |
create(String rendererName)
Creates a chart renderer instance, using the specified renderer ID.
|
abstract IlvLegendItem[] |
createLegendItems()
Creates the legend items associated with the renderer.
|
static IlvChartRenderer |
createRenderer(int type)
Creates a chart renderer instance of the given type.
|
protected void |
dataSetsAdded(int firstIdx,
int lastIdx,
IlvDataSet[] oldDataSets)
Called when new data sets are connected to this renderer.
|
protected void |
dataSetsChangesBatchEnding()
Called when a series of data sets insertions or removals is terminating.
|
protected void |
dataSetsChangesBatchStarting()
Called when a series of data sets insertions or removals is starting.
|
protected void |
dataSetsRemoved(int firstIdx,
int lastIdx,
IlvDataSet[] oldDataSets)
Called when data sets are disconnected from this renderer.
|
void |
dispose()
Cleans up this renderer and its children renderers, and drops references
to objects to help garbage collection.
|
abstract void |
draw(Graphics dst)
Draws the renderer.
|
abstract void |
draw(Graphics dst,
IlvDataSet dataSet,
int iMin,
int iMax)
Deprecated.
This method is not used by JViews.
|
abstract void |
drawAnnotations(Graphics dst)
Draws the annotations of the renderer using the specified
Graphics . |
void |
drawIntoHitmap(IlvChartHitmapDefinition definition,
IlvChartHitmapAccumulator accumulator)
Draws the rendering into a hitmap.
|
abstract void |
drawLegendSymbol(IlvLegendItem item,
Graphics g,
int x,
int y,
int w,
int h)
Draws the symbol of the given legend item.
|
abstract void |
drawSelectionHandles(Graphics g,
IlvHandlesSelectionStyle style)
Draws this renderer with selection handles.
|
void |
drawSelectionHandles(Graphics g,
IlvHandlesSelectionStyle style,
IlvDataSet dataSet)
Draws a data set with selection handles.
|
void |
drawSelectionHandles(Graphics g,
IlvHandlesSelectionStyle style,
IlvDataSet dataSet,
int index)
Draws a data point with selection handles.
|
void |
drawSelectionHandles(Graphics g,
IlvHandlesSelectionStyle style,
IlvObjectModelWithColumns model,
Object object)
Draws a data object with selection handles.
|
protected void |
endRendererChanges()
Terminates a batch of renderer changes.
|
protected Color |
findAppropriateColor(Collection<Color> colorsToAvoid)
Tries to find an appropriate color for the style used by this renderer.
|
protected void |
fireTreemapFocusEvent(TreemapFocusEvent event)
Fires a treemap focus change event to the registered listeners.
|
IlvDataAnnotation |
getAnnotation()
Returns the global annotation defined for this renderer.
|
abstract IlvDataAnnotation |
getAnnotation(IlvDataSet dataSet,
int idx)
Returns the annotation of the specified data point.
|
Rectangle2D |
getBounds(IlvDataSet dataSet,
int iMin,
int iMax,
Rectangle2D bounds)
Returns the bounds of the graphical representation for the
specified data.
|
abstract Rectangle2D |
getBounds(IlvDataSet dataSet,
int iMin,
int iMax,
Rectangle2D bounds,
boolean includeAnnotations)
Returns the bounds of the graphical representation for the
specified data.
|
abstract Rectangle2D |
getBounds(Rectangle2D bounds,
boolean includeAnnotations)
Returns the bounds of the graphical representation for the
visible data.
|
IlvChart |
getChart()
Returns the chart with which this renderer is associated.
|
IlvChartRenderer |
getChild(int index)
Returns the child renderer at the specified index.
|
int |
getChildCount()
Returns the number of child renderers.
|
Iterator<IlvChartRenderer> |
getChildIterator()
Returns an iterator over the children of this renderer.
|
List<IlvChartRenderer> |
getChildren()
Returns the children of this renderer.
|
Rectangle |
getClipRect()
Returns the rectangle that will be used to clip this renderer drawing.
|
IlvCoordinateSystem |
getCoordinateSystem()
Returns the coordinate system to which this renderer is associated.
|
int |
getDataLabeling()
Returns the data labeling mode.
|
int |
getDataLabelLayout()
Returns the layout mode for the data labels.
|
int |
getDataLabelling()
Deprecated.
Please use
getDataLabeling() instead. |
int |
getDataSetIndex(IlvDataSet dataSet)
Returns the index of the specified data set in the data source
connected to this renderer.
|
int |
getDataSetMainIndex(IlvDataSet dataSet)
Returns the index of the specified data set in the data source connected
to the main renderer in the parent chain of this renderer.
|
IlvChartRenderer |
getDataSetMainRenderer(IlvDataSet dataSet)
Returns the main renderer of the specified data set in the parent chain
of this renderer.
|
IlvDataSource |
getDataSource()
Returns the data source to which this renderer is connected.
|
Color[] |
getDefaultColors()
Returns the default colors used by this renderer.
|
String |
getDefaultLegendTitle()
Returns the default legend title.
|
double[] |
getDepths()
Returns the front and back depths of the renderer.
|
abstract IlvDisplayPoint |
getDisplayItem(IlvChartDataPicker picker)
Returns the display item containing the specified picking point.
|
static IlvDisplayPoint |
getDisplayItem(Iterator<IlvChartRenderer> ite,
IlvChartDataPicker picker)
Returns the display item containing the specified point.
|
static List<IlvDisplayPoint> |
getDisplayItems(Iterator<IlvChartRenderer> ite,
IlvChartDataPicker picker)
Returns the display items containing the specified point.
|
abstract IlvDisplayPoint |
getDisplayPoint(IlvDataSet dataSet,
int dataIdx)
Returns the display point corresponding to the specified data point.
|
IlvStyle |
getLegendStyle()
Returns the rendering style used to draw the legend item symbol.
|
String |
getLegendText(IlvLegendItem item)
Returns the label of the specified legend item.
|
int |
getMinDataSetCount()
Returns the minimum number of data sets to which this renderer
must be connected.
|
String |
getName()
Returns the name of this renderer.
|
abstract IlvDisplayPoint |
getNearestItem(IlvChartDataPicker picker,
double[] distanceResult)
Returns the display item closest to the picking point defined
by the specified data picker.
|
static IlvDisplayPoint |
getNearestItem(Iterator<IlvChartRenderer> ite,
IlvChartDataPicker picker,
double[] distanceResult)
Returns the projected data item closest to the specified point.
|
abstract IlvDisplayPoint |
getNearestPoint(IlvChartDataPicker picker)
Returns the display point closest to the picking point defined
by the specified data picker.
|
static IlvDisplayPoint |
getNearestPoint(Iterator<IlvChartRenderer> ite,
IlvChartDataPicker picker)
Returns the projected data point closest to the specified point.
|
IlvChartRenderer |
getParent()
Returns the parent of this renderer.
|
Rectangle |
getPlotRect()
Returns the rectangle used to project data points.
|
Insets |
getPreferredMargins()
Returns the preferred margins of this renderer for the calculation of the
plotting rectangle.
|
IlvDataRenderingHint |
getRenderingHint()
Returns the global rendering hint defined for this renderer.
|
abstract IlvDataRenderingHint |
getRenderingHint(IlvDataSet dataSet)
Returns the rendering hint that was specified globally for all the points
of the given data set.
|
abstract IlvDataRenderingHint |
getRenderingHint(IlvDataSet dataSet,
int idx)
Returns the rendering hint of the specified data point.
|
abstract IlvStyle |
getStyle(IlvDataSet dataSet,
int index)
Returns the style used to display the specified data point.
|
IlvStyle |
getStyle(int idx)
Returns the style at the specified index.
|
abstract IlvStyle[] |
getStyles()
Returns the styles used by this renderer.
|
IlvDataSet |
getVirtualDataSet(IlvDataSet dataSet)
Returns the virtual data set that is actually used internally in the
renderer for rendering the specified data set.
|
abstract IlvDataInterval |
getXRange(IlvDataInterval retRange)
Returns the range of the x-values displayed by this renderer.
|
double |
getXShift()
Returns the shift along the x-axis applied to data points before they
are projected.
|
int |
getYAxisIdx()
Returns the index of the y axis to which this renderer is or will be
connected.
|
abstract IlvDataInterval |
getYRange(IlvDataInterval retRange)
Returns the range of the y-values displayed by this renderer.
|
abstract IlvDataInterval |
getYRange(IlvDataInterval xRange,
IlvDataInterval retRange)
Returns the range of the y-values displayed by this renderer within the
specified x-interval.
|
boolean |
has3DSupport()
Indicates whether this renderer supports three-dimensional drawing.
|
abstract boolean |
holdsAnnotations()
Returns true if some annotations are defined for some data sets,
data points, or data objects, in this renderer.
|
boolean |
isDisplayingDataSet(IlvDataSet dataSet)
Indicates whether the current renderer is used to display the specified
data set.
|
boolean |
isViewable()
Indicates whether this renderer can be displayed.
|
boolean |
isVisible()
Indicates whether this renderer is visible.
|
boolean |
isVisibleInLegend()
Indicates whether the renderer creates a legend item.
|
void |
reDraw()
Repaints the chart
|
protected static void |
register(String rendererName,
Class<?> rendererClass)
Registers the specified renderer class, using the specified ID.
|
protected void |
set3D(boolean is3D)
Invoked by the chart when 3-D rendering is toggled.
|
void |
setAnnotation(IlvDataAnnotation annotation)
Specifies a global annotation for all the data sets displayed
by this renderer.
|
abstract void |
setAnnotation(IlvDataSet dataSet,
IlvDataAnnotation annotation)
Specifies a global annotation for all the points of a data set.
|
abstract void |
setAnnotation(IlvDataSet dataSet,
int idx,
IlvDataAnnotation annotation)
Specifies an annotation for a data point.
|
void |
setDataLabeling(int mode)
Specifies the data labeling mode, which describes the labels that
appear next to the graphical representation of data points.
|
void |
setDataLabelLayout(int layout)
Specifies the layout mode of data labels.
|
void |
setDataLabelling(int mode)
Deprecated.
Please use
setDataLabeling(int) instead. |
void |
setDataPoint(IlvDataSet dataSet,
int dataIndex,
double xData,
double yData)
Changes the value of a data point.
|
void |
setDataSource(IlvDataSource dataSource)
Connects the specified data source to this renderer.
|
abstract void |
setDisplayPoint(IlvDataSet dataSet,
int dataIndex,
double xCoord,
double yCoord)
Changes the value of a data point according to the specified projected
coordinates.
|
void |
setName(String name)
Sets the name of this renderer.
|
void |
setParent(IlvChartRenderer parent)
Connects this renderer to the specified parent.
|
void |
setRenderingHint(IlvDataRenderingHint hint)
Specifies a global rendering hint for all the data sets displayed
by this renderer.
|
abstract void |
setRenderingHint(IlvDataSet dataSet,
IlvDataRenderingHint hint)
Specifies a global rendering hint for all the points of a data set.
|
abstract void |
setRenderingHint(IlvDataSet dataSet,
int idx,
IlvDataRenderingHint hint)
Specifies a rendering hint for a data point.
|
void |
setRenderingHintWithNoDraw(IlvDataRenderingHint hint)
Specifies a global rendering hint for all the data sets displayed
by this renderer.
|
void |
setStyle(int idx,
IlvStyle style)
Sets the style at the specified index.
|
abstract void |
setStyles(IlvStyle[] styles)
Sets the styles used by this renderer.
|
void |
setVisible(boolean visible)
Toggles the visibility of this renderer.
|
void |
setVisibleInLegend(boolean visible)
Indicates whether the renderer appears in the legend.
|
void |
setXShift(double shift)
Sets the shift along the x-axis applied to data points before they
are projected.
|
void |
setYAxisIdx(int yAxisIdx)
Connects the specified renderer to the specified ordinate axis.
|
protected void |
startRendererChanges()
Starts a batch of renderer changes.
|
void |
toData(IlvDoublePoints pts)
Inverses project points using this renderer coordinate system
and projector area.
|
void |
toDisplay(IlvDoublePoints pts)
Projects points using this renderer coordinate system
and projector area.
|
void |
toDisplay(IlvDoublePoints pts,
IlvChartProjector proj,
Rectangle plotRect,
IlvCoordinateSystem coordSys)
Projects points using this renderer coordinate system
and projector area.
|
void |
triggerChange(int type)
Triggers an update of the chart displaying this renderer.
|
public static final int BAR
public static final int STACKED_BAR
public static final int STACKED100_BAR
IlvChart.setRenderingType(int)
,
IlvBarChartRenderer
,
Constant Field Valuespublic static final int STACKED_DIVERGING_BAR
IlvChart.setRenderingType(int)
,
IlvBarChartRenderer
,
IlvBarChartRenderer.setDiverging(boolean)
,
Constant Field Valuespublic static final int SUPERIMPOSED_BAR
public static final int AREA
public static final int STACKED_AREA
public static final int STACKED100_AREA
IlvChart.setRenderingType(int)
,
IlvBarChartRenderer
,
Constant Field Valuespublic static final int POLYLINE
public static final int STACKED_POLYLINE
IlvChart.setRenderingType(int)
,
IlvPolylineChartRenderer
,
Constant Field Valuespublic static final int STACKED100_POLYLINE
IlvChart.setRenderingType(int)
,
IlvBarChartRenderer
,
Constant Field Valuespublic static final int SCATTER
public static final int STAIR
public static final int STACKED_STAIR
IlvChart.setRenderingType(int)
,
IlvStairChartRenderer
,
Constant Field Valuespublic static final int STACKED100_STAIR
IlvChart.setRenderingType(int)
,
IlvBarChartRenderer
,
Constant Field Valuespublic static final int SUMMED_STAIR
IlvChart.setRenderingType(int)
,
IlvStairChartRenderer
,
Constant Field Valuespublic static final int BUBBLE
public static final int HILO
public static final int HILO_ARROW
IlvChart.setRenderingType(int)
,
IlvHiLoChartRenderer
,
Constant Field Valuespublic static final int HILO_STICK
IlvChart.setRenderingType(int)
,
IlvHiLoChartRenderer
,
Constant Field Valuespublic static final int CANDLE
IlvChart.setRenderingType(int)
,
IlvHiLoChartRenderer
,
Constant Field Valuespublic static final int HLOC
IlvChart.setRenderingType(int)
,
IlvHiLoChartRenderer
,
Constant Field Valuespublic static final int PIE
public static final int TREEMAP
IlvChart.setRenderingType(int)
,
IlvTreemapChartRenderer
,
Constant Field Valuespublic static final int COMBO
IlvChart.setRenderingType(int)
,
IlvComboChartRenderer
,
Constant Field Valuespublic static final int DATA_LABEL
public static final int Y_VALUE_LABEL
setDataLabeling(int)
,
Constant Field Valuespublic static final int XY_VALUES_LABEL
setDataLabeling(int)
,
Constant Field Valuespublic static final int X_VALUE_LABEL
setDataLabeling(int)
,
Constant Field Valuespublic static final int PERCENT_LABEL
IlvPieChartRenderer
setDataLabeling(int)
,
Constant Field Valuespublic static final int CENTERED_LABEL_LAYOUT
setDataLabelLayout(int)
,
Constant Field Valuespublic static final int OUTSIDE_LABEL_LAYOUT
setDataLabelLayout(int)
,
Constant Field Valuespublic static final int DEFAULT_LABEL_LAYOUT
setDataLabelLayout(int)
,
Constant Field Valuespublic static final int DEFAULT_LABELING
setDataLabeling(int)
,
Constant Field Valuesprotected IlvChartRenderer()
protected static void register(String rendererName, Class<?> rendererClass)
public static IlvChartRenderer create(String rendererName) throws IllegalAccessException, ClassNotFoundException, InstantiationException
register(java.lang.String, java.lang.Class<?>)
method, or directly through its class name.public final IlvChart getChart()
null
until the renderer is added to
a chart.protected void chartConnected(IlvChart oldChart, IlvChart newChart)
oldChart
- The chart with which this renderer was associated, or
null
if this renderer is added to a new chart.newChart
- The chart to which this renderer is added, or
null
if this renderer is removed from its current chart.public final Rectangle getPlotRect()
public Rectangle getClipRect()
getPlotRect()
public boolean isVisible()
isViewable()
,
setVisible(boolean)
public void setVisible(boolean visible)
isVisible()
public final int getYAxisIdx()
-1
if no y axis has been
specified using setYAxisIdx(int)
and the renderer is currently
not added to a chart.
The y-axis as an IlvAxis
instance can be retrieved through
getCoordinateSystem().getYAxis()
or, equivalently, through
getChart().getYAxis(getYAxisIdx())
.
public void setYAxisIdx(int yAxisIdx)
public final IlvCoordinateSystem getCoordinateSystem()
null
until the renderer is added to
a chart.public void toData(IlvDoublePoints pts)
IlvChart.toData(IlvDoublePoints, int)
public void toDisplay(IlvDoublePoints pts)
IlvChart.toDisplay(IlvDoublePoints, int)
public void toDisplay(IlvDoublePoints pts, IlvChartProjector proj, Rectangle plotRect, IlvCoordinateSystem coordSys)
toDisplay(IlvDoublePoints)
.pts
- A sequence of points.proj
- A precomputed and cached value of
chart.getProjector()
.plotRect
- The precomputed and cached value of
getPlotRect()
.coordSys
- The precomputed and cached value of
getCoordinateSystem()
.public String getName()
public void setName(String name)
public void setXShift(double shift)
public double getXShift()
public boolean isViewable()
By default, a renderer is suitable for rendering when the following conditions are true:
isVisible()
).has3DSupport()
method must return true
.isViewable
in interface IlvChartAreaAccessible
public abstract IlvDataInterval getXRange(IlvDataInterval retRange)
retRange
- An interval used to store the result. If this parameter
is null
, a new IlvDataInterval
is allocated.public abstract IlvDataInterval getYRange(IlvDataInterval retRange)
retRange
- An interval used to store the result. If this parameter
is null
, a new IlvDataInterval
is allocated.public abstract IlvDataInterval getYRange(IlvDataInterval xRange, IlvDataInterval retRange)
xRange
- The x-interval used to select the points.retRange
- An interval used to store the result. If this parameter
is null
, a new IlvDataInterval
is allocated.public int getMinDataSetCount()
1
.public final IlvDataSource getDataSource()
public int getDataSetIndex(IlvDataSet dataSet)
-1
if is not
connected to this renderer.public void setDataSource(IlvDataSource dataSource)
getDataSource()
public final boolean isDisplayingDataSet(IlvDataSet dataSet)
public final IlvDataSet getVirtualDataSet(IlvDataSet dataSet)
public abstract void setDisplayPoint(IlvDataSet dataSet, int dataIndex, double xCoord, double yCoord)
dataSet
- The considered data set.dataIndex
- The index of the considered data point within the data set.xCoord
- The new x-coordinate of the projected point, as displayed
by this renderer.yCoord
- The new y-coordinate of the projected point, as displayed
by this renderer.IlvDisplayPoint.setCoords(int, int)
public void setDataPoint(IlvDataSet dataSet, int dataIndex, double xData, double yData)
dataSet
- The considered data set.dataIndex
- The index of the considered data point within the data set.xData
- The new x-value.yData
- The new y-value.protected void dataSetsRemoved(int firstIdx, int lastIdx, IlvDataSet[] oldDataSets)
firstIdx
- The index of the first data set.lastIdx
- The index of the last data set.oldDataSets
- The data sets previously connected to this renderer.protected void dataSetsAdded(int firstIdx, int lastIdx, IlvDataSet[] oldDataSets)
firstIdx
- The index of the first data set.lastIdx
- The index of the last data set.oldDataSets
- The data sets previously connected to this renderer.protected void dataSetsChangesBatchStarting()
This method may start to delay the handling of dataSetsAdded(int, int, ilog.views.chart.data.IlvDataSet[])
,
dataSetsRemoved(int, int, ilog.views.chart.data.IlvDataSet[])
callbacks.
dataSetsChangesBatchEnding()
protected void dataSetsChangesBatchEnding()
This method should handle the dataSetsAdded(int, int, ilog.views.chart.data.IlvDataSet[])
,
dataSetsRemoved(int, int, ilog.views.chart.data.IlvDataSet[])
callbacks that arrived since the last call to
dataSetsChangesBatchStarting()
.
dataSetsChangesBatchStarting()
public abstract IlvStyle[] getStyles()
public abstract void setStyles(IlvStyle[] styles)
public IlvStyle getStyle(int idx)
setStyle(int, IlvStyle)
public void setStyle(int idx, IlvStyle style)
public abstract IlvStyle getStyle(IlvDataSet dataSet, int index)
dataSet
- The considered data set.index
- The index of the considered data point.null
if
this data point is not displayed by the renderer.public Color[] getDefaultColors()
The default implementation uses the IlvChart.getDefaultColors()
method. If the method returns null
, the styles are
created with the global colors defined by IlvColor.getDefaultColors()
.
protected Color findAppropriateColor(Collection<Color> colorsToAvoid)
colorsToAvoid
- A set of color objects that should be avoided.
For optimal performance, this should be a HashSet
.null
if none was found.getDefaultColors()
public abstract void draw(Graphics dst)
dst
- The destination Graphics
. May be null
if the renderer is drawn in a 3D scene.public abstract void drawAnnotations(Graphics dst)
Graphics
.@Deprecated public abstract void draw(Graphics dst, IlvDataSet dataSet, int iMin, int iMax)
public abstract Rectangle2D getBounds(Rectangle2D bounds, boolean includeAnnotations)
null
, a new
Rectangle2D
is allocated.
Note that the bounds may be larger than necessary. There is no guarantee that the bounds returned are tight.
Note about multi-threading: This method must not take the Swing
tree lock, and must not access IlvChart
API that is
not multithread-safe.
bounds
- An optional rectangle used to store the result.includeAnnotations
- Indicates whether annotation bounds should be included.public Rectangle2D getBounds(IlvDataSet dataSet, int iMin, int iMax, Rectangle2D bounds)
null
, a new
Rectangle2D
is allocated.
Note that the bounds may be larger than necessary. There is no guarantee that the bounds returned are tight.
Note about multi-threading: This method must not take the Swing
tree lock, and must not access IlvChart
API that is
not multithread-safe.
dataSet
- The data set containing the data points.iMin
- The minimum data point index.iMax
- The maximum data point index.bounds
- An optional rectangle used to store the result.public abstract Rectangle2D getBounds(IlvDataSet dataSet, int iMin, int iMax, Rectangle2D bounds, boolean includeAnnotations)
null
, a new
Rectangle2D
is allocated.
Note that the bounds may be larger than necessary. There is no guarantee that the bounds returned are tight.
Note about multi-threading: This method must not take the Swing
tree lock, and must not access IlvChart
API that is
not multithread-safe.
dataSet
- The data set containing the data points.iMin
- The minimum data point index.iMax
- The maximum data point index.bounds
- An optional rectangle used to store the result.includeAnnotations
- Indicates whether annotation bounds should be included.public abstract void drawSelectionHandles(Graphics g, IlvHandlesSelectionStyle style)
drawSelectionHandles
in interface IlvChartAreaAccessible
g
- A graphics context.style
- The graphic style parameters.public void drawSelectionHandles(Graphics g, IlvHandlesSelectionStyle style, IlvDataSet dataSet)
g
- A graphics context.style
- The graphic style parameters.dataSet
- One of the data sets of this renderer's data source.public void drawSelectionHandles(Graphics g, IlvHandlesSelectionStyle style, IlvDataSet dataSet, int index)
g
- A graphics context.style
- The graphic style parameters.dataSet
- One of the data sets of this renderer's data source.index
- The index of a data point in the data set.public void drawSelectionHandles(Graphics g, IlvHandlesSelectionStyle style, IlvObjectModelWithColumns model, Object object)
g
- A graphics context.style
- The graphic style parameters.model
- A flat or tree-like object model.object
- An object in the model.public boolean has3DSupport()
has3DSupport
in interface IlvChart3DSupport
protected void set3D(boolean is3D)
Note: This method is only called on renderers whose
has3DSupport()
method returns true
.
is3D
- Indicates whether 3-D rendering is turned on or off.public double[] getDepths()
null
if
has3DSupport()
returns false
, or if the renderer is not
added to a chart.IlvChart3DView.getFrontDepth()
,
IlvChart3DView.getBackDepth()
,
IlvChart3DView.setDepthGap(int)
public int getChildCount()
0
.public Iterator<IlvChartRenderer> getChildIterator()
IlvChartRenderer
.
The returned iterator does not allow element removal
(an UnsupportedOperationException
is thrown when
calling the remove
method).
The default implementation returns an iterator over an empty collection.IlvChartRenderer
elementspublic List<IlvChartRenderer> getChildren()
IlvChartRenderer
public IlvChartRenderer getChild(int index)
null
.public IlvChartRenderer getParent()
public void setParent(IlvChartRenderer parent)
public IlvChartRenderer getDataSetMainRenderer(IlvDataSet dataSet)
dataSet
- A data set that should be contained in the data source of
this renderer.null
if is not connected to this renderer.getParent()
public int getDataSetMainIndex(IlvDataSet dataSet)
dataSet
- A data set that should be contained in the data source of
this renderer.-1
if is not connected
to this renderer.getDataSetMainRenderer(IlvDataSet)
public void addImageMapAreas(IlvIMapDefinition mapDef, List<? super IlvIMapArea> areaList)
mapDef
- The map definition.areaList
- The list of map areas. The method must add instances
of IlvIMapArea
to this list.public void drawIntoHitmap(IlvChartHitmapDefinition definition, IlvChartHitmapAccumulator accumulator)
definition
- The specification how to construct the hitmap.accumulator
- The object that accumulates objects in the hitmap.IlvChartHitmapDefinition.drawIntoHitmap(IlvChart, IlvChartRenderer, IlvChartHitmapAccumulator)
public abstract IlvDisplayPoint getNearestPoint(IlvChartDataPicker picker)
picker
- The object holding the picking information.null
if none was found.getNearestItem(IlvChartDataPicker, double[])
public abstract IlvDisplayPoint getNearestItem(IlvChartDataPicker picker, double[] distanceResult)
getNearestPoint(ilog.views.chart.IlvChartDataPicker)
method, this method considers the
geometry of the renderer drawing to compute the result. It also optionally
returns the distance to the renderer drawing.picker
- The object holding the picking information.distanceResult
- If not null
, this will be used to
return the distance to the rendering of the item.
You can pass null
if you don't need
this information.null
if none was found.getNearestPoint(IlvChartDataPicker)
,
getDisplayItem(IlvChartDataPicker)
public abstract IlvDisplayPoint getDisplayItem(IlvChartDataPicker picker)
getNearestPoint(ilog.views.chart.IlvChartDataPicker)
method, this method considers the
geometry of the renderer drawing to compute the result.
Unlike the getNearestItem(ilog.views.chart.IlvChartDataPicker, double[])
method, this method does not consider
the picker's pick distance.picker
- The object holding the picking information.null
if none was found.getNearestItem(IlvChartDataPicker, double[])
public void collectDisplayItems(IlvChartDataPicker picker, ArrayList<IlvDisplayPoint> accumulator)
getDisplayItem(IlvChartDataPicker)
, except that
it returns all items, if several renderers happen to show an item at or
near the same point.
The first collected point is the same as the one returned by
getDisplayItem(IlvChartDataPicker)
.picker
- The object holding the picking information.accumulator
- A list to which the found display items will be added.public abstract IlvDisplayPoint getDisplayPoint(IlvDataSet dataSet, int dataIdx)
public static IlvDisplayPoint getNearestPoint(Iterator<IlvChartRenderer> ite, IlvChartDataPicker picker)
IlvChartRenderer
objects, otherwise a
ClassCastException
is thrown.getNearestPoint(IlvChartDataPicker)
public static IlvDisplayPoint getNearestItem(Iterator<IlvChartRenderer> ite, IlvChartDataPicker picker, double[] distanceResult)
IlvChartRenderer
objects, otherwise a
ClassCastException
is thrown.ite
- An iterator over chart renderers.picker
- The object holding the picking information.distanceResult
- If not null
, this will be used to
return the distance to the rendering of the item.
You can pass null
if you don't need
this information.getNearestItem(IlvChartDataPicker, double[])
public static List<IlvDisplayPoint> getDisplayItems(Iterator<IlvChartRenderer> ite, IlvChartDataPicker picker)
IlvChartRenderer
objects, otherwise a
ClassCastException
is thrown.
The first returned point is the same as the one returned by
getDisplayItem(Iterator, IlvChartDataPicker)
.IlvDisplayPoint
objects, or an empty list if none was found.getDisplayItem(IlvChartDataPicker)
public static IlvDisplayPoint getDisplayItem(Iterator<IlvChartRenderer> ite, IlvChartDataPicker picker)
IlvChartRenderer
objects, otherwise a
ClassCastException
is thrown.getDisplayItem(IlvChartDataPicker)
public abstract void drawLegendSymbol(IlvLegendItem item, Graphics g, int x, int y, int w, int h)
IlvRendererLegendItem
instances to draw their symbol.item
- The legend item to draw.g
- The graphics context.x
- The symbol x-coordinate.y
- The symbol y-coordinate.w
- The symbol width.h
- The symbol height.IlvRendererLegendItem
public abstract IlvLegendItem[] createLegendItems()
null
.IlvLegend
,
IlvLegendItem
public String getLegendText(IlvLegendItem item)
public String getDefaultLegendTitle()
null
, which stands for
no title.public IlvStyle getLegendStyle()
public Insets getPreferredMargins()
IlvChart.Area.getMargins()
public void triggerChange(int type)
ChartRendererEvent
.ChartRendererEvent
protected void startRendererChanges()
triggerChange(int)
,
ChartRendererListener2
protected void endRendererChanges()
triggerChange(int)
,
ChartRendererListener2
protected void fireTreemapFocusEvent(TreemapFocusEvent event)
IlvChart.addTreemapFocusListener(ilog.views.chart.event.TreemapFocusListener)
public boolean isVisibleInLegend()
setVisibleInLegend(boolean)
public void setVisibleInLegend(boolean visible)
The default value of this property is true
, which means
that the renderer will automatically create and add items to the legend.
isVisibleInLegend()
,
createLegendItems()
public int getDataLabeling()
setDataLabeling(int)
@Deprecated public int getDataLabelling()
getDataLabeling()
instead.public void setDataLabeling(int mode)
IlvDataLabelAnnotation
class.
The specified mode is used by the computeDataLabel(ilog.views.chart.data.IlvDataSetPoint)
method to
determine the label that is drawn by the annotation.
The following code shows how to label all the points of a data set with
their x- and y-values:
aRenderer.setDataLabeling(IlvChartRenderer.XY_VALUES_LABEL); aRenderer.setAnnotation(dataSet, new IlvDataLabelAnnotation());The default mode is
Y_VALUE_LABEL
.DATA_LABEL
,
X_VALUE_LABEL
,
Y_VALUE_LABEL
,
XY_VALUES_LABEL
@Deprecated public void setDataLabelling(int mode)
setDataLabeling(int)
instead.IlvDataLabelAnnotation
class.
The specified mode is used by the computeDataLabel(ilog.views.chart.data.IlvDataSetPoint)
method to
determine the label that is drawn by the annotation.
The following code shows how to label all the points of a data set with
their x- and y-values:
aRenderer.setDataLabeling(IlvChartRenderer.XY_VALUES_LABEL); aRenderer.setAnnotation(dataSet, new IlvDataLabelAnnotation());The default mode is
Y_VALUE_LABEL
.DATA_LABEL
,
X_VALUE_LABEL
,
Y_VALUE_LABEL
,
XY_VALUES_LABEL
public int getDataLabelLayout()
setDataLabelLayout(int)
public void setDataLabelLayout(int layout)
layout
- One of CENTERED_LABEL_LAYOUT
,
OUTSIDE_LABEL_LAYOUT
.public final IlvDataAnnotation getAnnotation()
setAnnotation(IlvDataAnnotation)
public void setAnnotation(IlvDataAnnotation annotation)
annotation
- The new annotation. If this parameter is
null
, all the global annotations previously
defined are removed.setAnnotation(IlvDataSet, IlvDataAnnotation)
public abstract IlvDataAnnotation getAnnotation(IlvDataSet dataSet, int idx)
dataSet
- The considered data set.idx
- The index of the point within the data set.public abstract void setAnnotation(IlvDataSet dataSet, int idx, IlvDataAnnotation annotation)
dataSet
- The considered data set.idx
- The index of the considered point in the data set.annotation
- The new annotation, or null
if the
annotation associated with the specified point must be removed.
If an annotation has already been specified globally with the
setAnnotation(IlvDataSet, IlvDataAnnotation)
method,
it is overridden by this new annotation.
In that case, a null
value has no effect.public abstract void setAnnotation(IlvDataSet dataSet, IlvDataAnnotation annotation)
dataSet
- The considered data set.annotation
- The new annotation, or null
if the
global annotation must be removed.setAnnotation(IlvDataAnnotation)
public abstract boolean holdsAnnotations()
public final IlvDataRenderingHint getRenderingHint()
setRenderingHint(IlvDataRenderingHint)
public void setRenderingHint(IlvDataRenderingHint hint)
hint
- The new rendering hint. If this parameter is
null
, all the global hints previously
defined are removed.setRenderingHint(IlvDataSet, IlvDataRenderingHint)
public void setRenderingHintWithNoDraw(IlvDataRenderingHint hint)
reDraw()
methodhint
- The new rendering hint. If this parameter is
null
, all the global hints previously
defined are removed.setRenderingHint(IlvDataSet, IlvDataRenderingHint)
public void reDraw()
public abstract IlvDataRenderingHint getRenderingHint(IlvDataSet dataSet, int idx)
dataSet
- The considered data set.idx
- The index of the point within the data set.null
for none.public abstract void setRenderingHint(IlvDataSet dataSet, int idx, IlvDataRenderingHint hint)
dataSet
- The considered data set.idx
- The index of the considered point in the data set.hint
- The new rendering hint, or null
if the
hint associated with the specified point must be removed.
If an hint has already been specified globally with the
setRenderingHint(IlvDataSet, IlvDataRenderingHint)
} method,
it is overridden by this new hint.
In that case, a null
value has no effect.public abstract IlvDataRenderingHint getRenderingHint(IlvDataSet dataSet)
dataSet
- The considered data set.null
for none.public abstract void setRenderingHint(IlvDataSet dataSet, IlvDataRenderingHint hint)
dataSet
- The considered data set.hint
- The new rendering hint, or null
if the
global hint must be removed.public String computeDataLabel(IlvDataSetPoint dp)
This method is used for data labeling. The returned string depends on
the mode specified by the setDataLabeling(int)
method. The values
are formatted using the IlvChart.formatXValue(double)
and
IlvChart.formatYValue(int, double)
methods.
dp
- The considered data point.null
if none is available.public Point computeDataLabelLocation(IlvDisplayPoint dp, Dimension size)
IlvDataLabelAnnotation
class.dp
- The considered display point.size
- The size of the label.setDataLabeling(int)
public void applyStyles(boolean newStyles) throws Exception
Exception
public static ilog.views.chart.styling.IlvDataSetStyle applyStyles(IlvDataSet dataSet, IlvChartRenderer renderer, IlvChartRenderer rendererBean, ilog.views.chart.styling.IlvStylingSupport support, boolean differentNodes)
dataSet
- The data set.renderer
- The renderer that displays the data set.rendererBean
- The renderer that should be styled, or null
.support
- CSS manager.differentNodes
- If true, all CSS model nodes that are used must be different.
If false, CSS model node creation can be optimized.IlvDataSetStyle
that holds the styling
information on the data set.protected static void applyStyles(IlvDataSet dataSet, IlvChartRenderer renderer, boolean doClear, int firstIdx, int lastIdx, ilog.views.chart.styling.IlvStylingSupport support)
dataSet
- The considered data set.renderer
- Renderer which is rendering the data set.doClear
- Whether to clear all data point styles first.firstIdx
- The index of the first data point.lastIdx
- The index of the last data point.support
- Holds styling information.public static IlvChartRenderer createRenderer(int type)
BAR
,
STACKED_BAR
,
STACKED100_BAR
,
STACKED_DIVERGING_BAR
,
SUPERIMPOSED_BAR
,
AREA
,
STACKED_AREA
,
STACKED100_AREA
,
POLYLINE
,
STACKED_POLYLINE
,
STACKED100_POLYLINE
,
SCATTER
,
STAIR
,
STACKED_STAIR
,
STACKED100_STAIR
,
SUMMED_STAIR
,
BUBBLE
,
HILO
,
HILO_ARROW
,
HILO_STICK
,
CANDLE
,
HLOC
,
PIE
,
TREEMAP
public void dispose()
Note: After calling this function, this renderer and its children renderers are no longer functional.
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.