public abstract class IlvSingleChartRenderer extends IlvChartRenderer
IlvSingleChartRenderer
class is the base class for
elementary renderers. The subclasses of IlvSingleChartRenderer
implement the drawing of a given rendering type. Single renderers usually
have a composite counterpart (subclass of IlvCompositeChartRenderer
),
which is used to display several data sets. For example,
IlvSingleBarRenderer
renders a single data set with bars, while
IlvBarChartRenderer
uses instances of this elementary renderer
to display the contents of a data source.AREA, BAR, BUBBLE, CANDLE, CENTERED_LABEL_LAYOUT, COMBO, DATA_LABEL, DEFAULT_LABEL_LAYOUT, DEFAULT_LABELING, HILO, HILO_ARROW, HILO_STICK, HLOC, OUTSIDE_LABEL_LAYOUT, PERCENT_LABEL, PIE, POLYLINE, SCATTER, STACKED_AREA, STACKED_BAR, STACKED_DIVERGING_BAR, STACKED_POLYLINE, STACKED_STAIR, STACKED100_AREA, STACKED100_BAR, STACKED100_POLYLINE, STACKED100_STAIR, STAIR, SUMMED_STAIR, SUPERIMPOSED_BAR, TREEMAP, X_VALUE_LABEL, XY_VALUES_LABEL, Y_VALUE_LABEL
Modifier | Constructor and Description |
---|---|
protected |
IlvSingleChartRenderer()
Creates a new
IlvSingleChartRenderer with a default style. |
protected |
IlvSingleChartRenderer(IlvStyle style)
Creates a new
IlvSingleChartRenderer with the specified style. |
Modifier and Type | Method and Description |
---|---|
void |
addImageMapAreas(IlvIMapDefinition mapDef,
List<? super IlvIMapArea> areaList)
Generates image map areas.
|
void |
applyDataSetStyle(ilog.views.chart.styling.IlvDataSetStyle dataSetStyle)
Applies the styles for a data set.
|
void |
applyStyles(boolean newStyles)
Applies styling to the renderer.
|
protected void |
chartConnected(IlvChart oldChart,
IlvChart newChart)
Called when the renderer is added to or removed from a chart.
|
IlvLegendItem[] |
createLegendItems()
Creates the legend item instances associated to this renderer.
|
void |
dataSetContentsChanged(DataSetContentsEvent event)
Called when the content of the associated data set is modified.
|
void |
dataSetPropertyChanged(DataSetPropertyEvent event)
Called when a property of the associated data set has been changed.
|
protected void |
dataSetsAdded(int firstIdx,
int lastIdx,
IlvDataSet[] oldDataSets)
Called when data sets are connected to this renderer.
|
protected void |
dataSetsRemoved(int firstIdx,
int lastIdx,
IlvDataSet[] oldDataSets)
Called when data sets are disconnected from this renderer.
|
void |
draw(Graphics dst)
Draws the renderer using the specified
Graphics . |
void |
draw(Graphics dst,
IlvDataSet dataSet,
int iMin,
int iMax)
Deprecated.
This method is not used by JViews.
|
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.
|
void |
drawLegendSymbol(IlvLegendItem item,
Graphics g,
int x,
int y,
int w,
int h)
Draws the symbol of the given legend item.
|
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.
|
IlvDataAnnotation |
getAnnotation(IlvDataSet dataSet,
int idx)
Returns the annotation of the specified data point.
|
Rectangle2D |
getBounds(IlvDataSet dataSet,
int iMin,
int iMax,
Rectangle2D bounds,
boolean includeAnnotations)
Returns the bounds of the graphical representation for the specified data.
|
Rectangle2D |
getBounds(Rectangle2D bounds,
boolean includeAnnotations)
Returns the bounds of the graphical representation for the visible data.
|
String |
getDefaultLegendText()
Returns a default legend text for this renderer.
|
IlvDisplayPoint |
getDisplayItem(IlvChartDataPicker picker)
Returns the display item containing the specified picking point.
|
IlvDisplayPoint |
getDisplayPoint(IlvDataSet dataSet,
int dataIdx)
Returns the display point corresponding to the specified data point.
|
IlvStyle |
getDisplayStyle(int index)
Returns the style used to display the specified data point.
|
String |
getLegendText(IlvLegendItem item)
Returns the label of the specified legend item.
|
IlvDisplayPoint |
getNearestItem(IlvChartDataPicker picker,
double[] distanceResult)
Returns the display item closest to the picking point defined by the
specified data picker.
|
IlvDisplayPoint |
getNearestPoint(IlvChartDataPicker picker)
Returns the data point closest to the specified projected coordinates.
|
Insets |
getPreferredMargins()
Returns the preferred margins of this renderer for the calculation of the
plotting rectangle.
|
IlvDataRenderingHint |
getRenderingHint(IlvDataSet dataSet)
Returns the rendering hint that was specified globally for all the points
of the given data set.
|
IlvDataRenderingHint |
getRenderingHint(IlvDataSet dataSet,
int idx)
Returns the rendering hint of the specified data point.
|
IlvStyle |
getStyle()
Returns the main style used by this renderer.
|
IlvStyle |
getStyle(IlvDataSet dataSet,
int index)
Returns the style used to display the specified data point.
|
IlvStyle[] |
getStyles()
Returns the styles used by this renderer.
|
IlvDataInterval |
getXRange(IlvDataInterval retRange)
Returns the range of the x-values displayed by this renderer.
|
IlvDataInterval |
getYRange(IlvDataInterval retRange)
Returns the range of the y-values displayed by this renderer.
|
IlvDataInterval |
getYRange(IlvDataInterval xRange,
IlvDataInterval retRange)
Returns the range of the y-values displayed by this renderer within the
specified X interval.
|
String |
getZAnnotationText()
Returns the text displayed along the depth axis of a 3-D chart.
|
boolean |
holdsAnnotations()
Returns true if some annotations are defined for some data sets,
data points, or data objects, in this renderer.
|
boolean |
isFilled()
Indicates whether the renderer uses a fill color.
|
protected IlvStyle |
makeDefaultStyle()
Creates a default style for this renderer.
|
protected void |
set3D(boolean is3D)
Invoked by the chart when 3-D rendering is toggled.
|
void |
setAnnotation(IlvDataSet dataSet,
IlvDataAnnotation annotation)
Sets an annotation on all the data points of the specified data set.
|
void |
setAnnotation(IlvDataSet dataSet,
int idx,
IlvDataAnnotation annotation)
Sets an annotation on the specified data point.
|
void |
setDataPoint(IlvDataSet dataSet,
int dataIndex,
double xData,
double yData)
Changes the value of a data point.
|
void |
setDisplayPoint(IlvDataSet dataSet,
int dataIndex,
double xCoord,
double yCoord)
Changes the value of a data point according to the specified projected
coordinates.
|
void |
setRenderingHint(IlvDataSet dataSet,
IlvDataRenderingHint hint)
Specifies a rendering hint for all the data points of a data set.
|
void |
setRenderingHint(IlvDataSet dataSet,
int idx,
IlvDataRenderingHint hint)
Specifies a rendering hint for a data point.
|
void |
setStyle(IlvStyle style)
Sets the style used by this renderer.
|
void |
setStyles(IlvStyle[] styles)
Sets the styles used by this renderer.
|
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.
|
applyStyles, applyStyles, collectDisplayItems, computeDataLabel, computeDataLabelLocation, create, createRenderer, dataSetsChangesBatchEnding, dataSetsChangesBatchStarting, dispose, drawSelectionHandles, drawSelectionHandles, endRendererChanges, findAppropriateColor, fireTreemapFocusEvent, getAnnotation, getBounds, getChart, getChild, getChildCount, getChildIterator, getChildren, getClipRect, getCoordinateSystem, getDataLabeling, getDataLabelLayout, getDataLabelling, getDataSetIndex, getDataSetMainIndex, getDataSetMainRenderer, getDataSource, getDefaultColors, getDefaultLegendTitle, getDepths, getDisplayItem, getDisplayItems, getLegendStyle, getMinDataSetCount, getName, getNearestItem, getNearestPoint, getParent, getPlotRect, getRenderingHint, getStyle, getVirtualDataSet, getXShift, getYAxisIdx, has3DSupport, isDisplayingDataSet, isViewable, isVisible, isVisibleInLegend, reDraw, register, setAnnotation, setDataLabeling, setDataLabelLayout, setDataLabelling, setDataSource, setName, setParent, setRenderingHint, setRenderingHintWithNoDraw, setStyle, setVisible, setVisibleInLegend, setXShift, setYAxisIdx, startRendererChanges, toData, triggerChange
protected IlvSingleChartRenderer()
IlvSingleChartRenderer
with a default style.protected IlvSingleChartRenderer(IlvStyle style)
IlvSingleChartRenderer
with the specified style.public boolean isFilled()
true
if the renderer uses a fill color, or
false
if it only uses a stroke color. The default
implementation returns true
.public void setStyle(IlvStyle style)
IlvSingleChartRenderer
class makes use of a single style. If
the parameter is null
and the renderer has been attached to a
chart, sets a default style.
Note: The Bean property style
must not be specified together
with the Bean property styles
.
getStyle()
public IlvStyle getStyle()
setStyle(ilog.views.chart.IlvStyle)
public void setStyles(IlvStyle[] styles)
setStyles
in class IlvChartRenderer
Note: The Bean property styles
must not be specified
together with the Bean property style
.
public IlvStyle[] getStyles()
getStyles
in class IlvChartRenderer
getStyle()
protected void chartConnected(IlvChart oldChart, IlvChart newChart)
chartConnected
in class IlvChartRenderer
oldChart
- The chart which this renderer was associated to. This parameter is
null
if this renderer is added to a new chart.newChart
- The chart which this renderer is added to. This parameter is
null
if this renderer is removed from its current
chart.public void toDisplay(IlvDoublePoints pts)
toDisplay
in class IlvChartRenderer
IlvChart.toDisplay(IlvDoublePoints, int)
public void toDisplay(IlvDoublePoints pts, IlvChartProjector proj, Rectangle plotRect, IlvCoordinateSystem coordSys)
toDisplay(IlvDoublePoints)
.toDisplay
in class IlvChartRenderer
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()
.protected void set3D(boolean is3D)
set3D
in class IlvChartRenderer
is3D
- Indicates whether 3-D rendering is turned on or off.public String getZAnnotationText()
null
.IlvChart3DView.setZAnnotationVisible(boolean)
public void draw(Graphics dst)
Graphics
.draw
in class IlvChartRenderer
dst
- The destination Graphics
. May be null
if the renderer is drawn in a 3D scene.@Deprecated public void draw(Graphics dst, IlvDataSet dataSet, int iMin, int iMax)
draw
in class IlvChartRenderer
public 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.
getBounds
in class IlvChartRenderer
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, 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.
getBounds
in class IlvChartRenderer
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 void drawSelectionHandles(Graphics g, IlvHandlesSelectionStyle style)
drawSelectionHandles
in interface IlvChartAreaAccessible
drawSelectionHandles
in class IlvChartRenderer
g
- A graphics context.style
- The graphic style parameters.public void drawSelectionHandles(Graphics g, IlvHandlesSelectionStyle style, IlvDataSet dataSet)
drawSelectionHandles
in class IlvChartRenderer
g
- A graphics context.style
- The graphic style parameters.dataSet
- One of the data sets of this renderer's data source.public IlvDisplayPoint getNearestPoint(IlvChartDataPicker picker)
getNearestPoint
in class IlvChartRenderer
picker
- The object holding the picking information.null
if none was found.IlvChartRenderer.getNearestItem(IlvChartDataPicker, double[])
public 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.getNearestItem
in class IlvChartRenderer
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.IlvChartRenderer.getNearestPoint(IlvChartDataPicker)
,
IlvChartRenderer.getDisplayItem(IlvChartDataPicker)
public 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.getDisplayItem
in class IlvChartRenderer
picker
- The object holding the picking information.null
if none was found.IlvChartRenderer.getNearestItem(IlvChartDataPicker, double[])
public IlvDisplayPoint getDisplayPoint(IlvDataSet dataSet, int dataIdx)
getDisplayPoint
in class IlvChartRenderer
public void setDisplayPoint(IlvDataSet dataSet, int dataIndex, double xCoord, double yCoord)
setDisplayPoint
in class IlvChartRenderer
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 rendered by this
renderer.yCoord
- The new y-coordinate of the projected point, as rendered by this
renderer.IlvDisplayPoint.setCoords(int, int)
public void setDataPoint(IlvDataSet dataSet, int dataIndex, double xData, double yData)
setDataPoint
in class IlvChartRenderer
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.public void addImageMapAreas(IlvIMapDefinition mapDef, List<? super IlvIMapArea> areaList)
addImageMapAreas
in class IlvChartRenderer
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)
drawIntoHitmap
in class IlvChartRenderer
definition
- The specification how to construct the hitmap.accumulator
- The object that accumulates objects in the hitmap.IlvChartHitmapDefinition.drawIntoHitmap(IlvChart, IlvChartRenderer, IlvChartHitmapAccumulator)
public void dataSetContentsChanged(DataSetContentsEvent event)
DataSetContentsEvent
public void dataSetPropertyChanged(DataSetPropertyEvent event)
DataSetPropertyEvent
protected void dataSetsRemoved(int firstIdx, int lastIdx, IlvDataSet[] oldDataSets)
dataSetsRemoved
in class IlvChartRenderer
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)
dataSetsAdded
in class IlvChartRenderer
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.public IlvDataInterval getXRange(IlvDataInterval retRange)
getXRange
in class IlvChartRenderer
retRange
- An interval used to store the result. If this parameter is
null
, a new IlvDataInterval
is
allocated.public IlvDataInterval getYRange(IlvDataInterval retRange)
getYRange
in class IlvChartRenderer
retRange
- An interval used to store the result. If this parameter is
null
, a new IlvDataInterval
is
allocated.public IlvDataInterval getYRange(IlvDataInterval xRange, IlvDataInterval retRange)
getYRange
in class IlvChartRenderer
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 Insets getPreferredMargins()
getPreferredMargins
in class IlvChartRenderer
IlvChart.Area.getMargins()
protected IlvStyle makeDefaultStyle()
public void drawLegendSymbol(IlvLegendItem item, Graphics g, int x, int y, int w, int h)
IlvRendererLegendItem
instances to draw the item
symbol. The default implementation draws a rectangle using the current
renderer drawing style.drawLegendSymbol
in class IlvChartRenderer
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 IlvLegendItem[] createLegendItems()
IlvRendererLegendItem
instance initialized with the
label returned by getLegendText(ilog.views.chart.IlvLegendItem)
.createLegendItems
in class IlvChartRenderer
null
.IlvLegend
,
IlvLegendItem
public String getLegendText(IlvLegendItem item)
getLegendText
in class IlvChartRenderer
getDefaultLegendText()
method.public String getDefaultLegendText()
public void drawAnnotations(Graphics dst)
Graphics
.drawAnnotations
in class IlvChartRenderer
public void setAnnotation(IlvDataSet dataSet, int idx, IlvDataAnnotation annotation)
setAnnotation
in class IlvChartRenderer
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
IlvChartRenderer.setAnnotation(IlvDataSet, IlvDataAnnotation)
method,
it is overridden by this new annotation.
In that case, a null
value has no effect.public void setAnnotation(IlvDataSet dataSet, IlvDataAnnotation annotation)
setAnnotation
in class IlvChartRenderer
dataSet
- The considered data set.annotation
- The new annotation, or null
if the
global annotation must be removed.IlvChartRenderer.setAnnotation(IlvDataAnnotation)
public IlvDataAnnotation getAnnotation(IlvDataSet dataSet, int idx)
getAnnotation
in class IlvChartRenderer
dataSet
- The considered data set.idx
- The index of the point within the data set.public void setRenderingHint(IlvDataSet dataSet, int idx, IlvDataRenderingHint hint)
setRenderingHint
in class IlvChartRenderer
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
IlvChartRenderer.setRenderingHint(IlvDataSet, IlvDataRenderingHint)
} method,
it is overridden by this new hint.
In that case, a null
value has no effect.public void setRenderingHint(IlvDataSet dataSet, IlvDataRenderingHint hint)
setRenderingHint
in class IlvChartRenderer
dataSet
- The considered data set.hint
- The new rendering hint, or null
if the
global hint must be removed.public IlvDataRenderingHint getRenderingHint(IlvDataSet dataSet, int idx)
getRenderingHint
in class IlvChartRenderer
dataSet
- The considered data set.idx
- The index of the point within the data set.null
for none.public IlvDataRenderingHint getRenderingHint(IlvDataSet dataSet)
getRenderingHint
in class IlvChartRenderer
dataSet
- The considered data set.null
for none.public IlvStyle getStyle(IlvDataSet dataSet, int index)
getStyle
in class IlvChartRenderer
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 IlvStyle getDisplayStyle(int index)
index
- The index of the considered data point.getStyle(IlvDataSet, int)
public boolean holdsAnnotations()
holdsAnnotations
in class IlvChartRenderer
public void applyStyles(boolean newStyles) throws Exception
applyStyles
in class IlvChartRenderer
Exception
public void applyDataSetStyle(ilog.views.chart.styling.IlvDataSetStyle dataSetStyle)
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.