public class IlvChart extends JLayeredPane implements IlvStylable, IlvAcceptFunctions
ChartArea
component, instance of
IlvChart.Area
.IlvLegend
.JComponent
added
to the chart on top of the chart area.JComponent
added
to the chart at the bottom of the chart area.
Modifier and Type | Class and Description |
---|---|
class |
IlvChart.Area
The component where the graphical representation of charts and scales are
displayed.
|
static class |
IlvChart.IlvChartImagePaintContext
A class that encapsulates state information needed for the rendering of a
chart as a BufferedImage.
|
static class |
IlvChart.IlvChartPaintContext
A class that encapsulates state information needed for the rendering of a
chart when the chart is used outside of the AWT-Event thread.
|
JLayeredPane.AccessibleJLayeredPane
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
static int |
CARTESIAN
The type for a CARTESIAN chart.
|
static int |
DRAW_ABOVE
Indicates that the object must be drawn above the chart representations.
|
static int |
DRAW_BELOW
Indicates that the object must be drawn below the chart representations.
|
static int |
PIE
The type for a PIE chart.
|
static int |
POLAR
The type for a POLAR chart.
|
static int |
RADAR
The type for a RADAR chart.
|
static int |
STYLE_DEFAULT_MASK
The default style sheet debug mask.
|
static int |
TREEMAP
The type for a TREEMAP chart.
|
DEFAULT_LAYER, DRAG_LAYER, FRAME_CONTENT_LAYER, LAYER_PROPERTY, MODAL_LAYER, PALETTE_LAYER, POPUP_LAYER
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
APPLIED_RULE_MASK, BAD_CLASS_MASK, BAD_PROP_MASK, BAD_PROP_WITH_STACK_MASK, CREATED_MASK, DECL_MASK, DECL_VALUE_MASK, FAILED_CONVERSIONS_MASK, TIME_REPORT_MASK, WARNING_PROP_MASK
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
IlvChart()
Creates a Cartesian chart.
|
IlvChart(int type)
Creates a chart of the specified type.
|
IlvChart(int type,
boolean withScales)
Creates a chart of the specified type.
|
Modifier and Type | Method and Description |
---|---|
void |
addChartDrawListener(ChartDrawListener l)
Adds a new draw listener.
|
void |
addChartListener(ChartListener l)
Adds a new listener.
|
void |
addChartRendererListener(ChartRendererListener l)
Adds a new renderer listener.
|
void |
addData(IlvDataSource dataSource,
int chartType)
Connects the specified data to this chart, using the specified rendering
type.
|
void |
addDecoration(IlvChartDecoration decoration)
Adds the specified decoration to this chart.
|
protected void |
addImpl(Component comp,
Object constraints,
int index)
Adds the specified component to this container at the specified index.
|
void |
addInteractor(IlvChartInteractor inter)
Adds a new interactor.
|
void |
addInteractor(String inter)
Adds a new interactor using a
String describing either the
interactor class name or the registered name associated with the
interactor. |
void |
addLegend(IlvLegend legend,
String pos)
Sets the legend, and adds it to the chart at position
pos . |
void |
addLegend(IlvLegend legend,
String pos,
boolean autoPos)
Sets the legend, and adds it to the chart.
|
void |
addPseudoClass(IlvDataSet dataSet,
int idx,
String pseudoClass)
Adds a pseudo-class to the specified data point in the context of this
chart.
|
void |
addPseudoClass(IlvDataSet dataSet,
String pseudoClass)
Adds a pseudo-class to the specified data set in the context of this chart.
|
void |
addPseudoClass(Object object,
String pseudoClass)
Adds a pseudo-class to the specified model object.
|
void |
addPseudoClass(String pseudoClass)
Adds a pseudo-class to this chart.
|
void |
addRenderer(IlvChartRenderer renderer)
Adds a renderer, and attaches it to the main ordinate axis.
|
void |
addRenderer(IlvChartRenderer renderer,
IlvDataSet dataSet)
Adds a renderer, and connects it to the specified data set.
|
void |
addRenderer(IlvChartRenderer renderer,
int yAxisIdx)
Adds a renderer, and connects it to the specified ordinate axis.
|
void |
addRenderer(int rank,
IlvChartRenderer renderer,
int yAxisIdx)
Inserts a renderer at the specified rank.
|
void |
addTreemapFocusListener(TreemapFocusListener l)
Adds a new treemap focus listener.
|
IlvAxis |
addYAxis(boolean createScale,
boolean createGrid)
Adds an ordinate axis.
|
protected void |
applyStyles()
Applies the styling configuration to the chart.
|
void |
attachBoundedModel(BoundedRangeModel model,
int axisIdx)
Attaches the specified model to the specified axis.
|
void |
attachBoundedModel(BoundedRangeModel model,
int axisIdx,
boolean reversed)
Attaches the specified model to the specified axis.
|
protected void |
baseTextDirectionChanged()
This method is invoked when the effective base text direction has changed.
|
void |
clearAllPseudoClasses()
Removes all pseudo-classes from the chart, all data sets, all data points,
and all objects.
|
void |
clearPseudoClass(String pseudoClass)
Removes a pseudo-class from the chart, all data sets, all data points, and
all objects.
|
protected void |
componentOrientationChanged(ComponentOrientation oldOrientation,
ComponentOrientation newOrientation)
This method is invoked when the component orientation of this chart has
changed.
|
protected IlvGrid |
createGrid(int axisIdx)
Creates a grid for the specified axis.
|
protected JLabel |
createJLabel(String text)
Creates a JLabel instance.
|
protected IlvLegend |
createLegend()
Creates an
IlvLegend instance. |
protected IlvScale |
createScale(int axisIdx)
Creates a scale for the specified axis.
|
void |
dataSetContentsChanged(DataSetContentsEvent event,
IlvChartRenderer r)
Invoked by
IlvChartRenderer when one of its data set has
changed. |
void |
detachBoundedModel(BoundedRangeModel model)
Detaches the given model from its associated axis.
|
void |
dispose()
Cleans up this chart and drops references to objects to help garbage
collection.
|
void |
doStyle() |
void |
endRendererChanges()
Terminates a batch of renderer changes.
|
void |
endSession(IlvChart.IlvChartPaintContext context)
Ends the current No-AWT-Thread session.
|
String |
formatXValue(double value)
Formats the specified x-value into a string.
|
String |
formatYValue(int yAxisIdx,
double value)
Formats the specified y-value into a string.
|
IlvChart3DView |
get3DView()
Returns the three-dimensional view of the chart.
|
Iterator<IlvChartRenderer> |
getAllRendererIterator()
Returns an iterator over all the renderers displayed by the chart,
including the child renderers.
|
double |
getAngleRange()
Returns the angle range of the projector.
|
Color |
getBackground()
Returns the background color of this component.
|
Paint |
getBackgroundPaint()
Returns the background Paint.
|
int |
getBaseTextDirection()
Returns the base text direction for this chart.
|
IlvChart.Area |
getChartArea()
Returns the chart area component.
|
Border |
getChartAreaBorder()
Returns the chart area border.
|
IlvFOUtil.ComponentPaintable |
getComponentPaintable(boolean wholeChart,
Color bgColor)
Returns a
IlvFOUtil.ComponentPaintable that
can be used to convert this chart to a PDF via
XSL-FO. |
IlvFOUtil.ComponentPaintable |
getComponentPaintableCurrentThread(boolean wholeChart,
Color bgColor)
Returns a
IlvFOUtil.ComponentPaintable that
can be used to convert this chart to a PDF via
XSL-FO. |
IlvCoordinateSystem |
getCoordinateSystem(int yAxisIdx)
Returns the coordinate system formed by the abscissa axis and the specified
ordinate axis.
|
IlvDataRangePolicy |
getDataRangePolicy()
Returns the calculation policy used by the chart to compute the data range
of an axis.
|
Iterator<IlvDataSet> |
getDataSetIterator()
Returns an iterator over all the data sets connected to this chart.
|
IlvDataSource |
getDataSource()
Returns the data source of the first renderer.
|
List<IlvChartDecoration> |
getDecorations()
Returns a copy of the list of decorations displayed by this chart.
|
Color[] |
getDefaultColors()
Returns the default colors used by this chart.
|
IlvDisplayPoint |
getDisplayItem(IlvChartDataPicker picker)
Returns the display item containing the specified point.
|
List<IlvDisplayPoint> |
getDisplayItems(IlvChartDataPicker picker)
Returns the display items containing the specified point.
|
Iterator<IlvChartDrawable> |
getDrawableIterator()
Returns an iterator over the
IlvChartDrawable objects managed
by this chart. |
IlvScalableFontManager |
getFontManager()
Returns the font manager associated with this chart.
|
JComponent |
getFooter()
Returns the footer component.
|
String |
getFooterText()
Returns the footer text.
|
JComponent |
getHeader()
Returns the header component.
|
String |
getHeaderText()
Returns the header text.
|
IlvChartInteractor[] |
getInteractors()
Returns all the interactors installed on the chart.
|
IlvLegend |
getLegend()
Returns the legend.
|
String |
getLegendPosition()
Returns the current legend position.
|
IlvChartProjector |
getLocalProjector2D(Rectangle projRect,
IlvCoordinateSystem coordSys)
Returns a copy of the 2-D projector used by this chart.
|
Object |
getLock()
Returns an object identifying this chart.
|
IlvDisplayPoint |
getNearestItem(IlvChartDataPicker picker,
double[] distanceResult)
Returns the display point whose renderer drawing is closest to the picking
point defined by the specified data picker.
|
IlvDisplayPoint |
getNearestPoint(IlvChartDataPicker picker)
Returns the display point closest to the picking point defined by the
specified data picker.
|
static boolean |
getNoEventThreadUpdate()
Returns whether the requests should be processed in the AWT-Event thread.
|
IlvChart.IlvChartPaintContext |
getPaintContext()
Returns the current
IlvChartPaintContext , if any. |
Color |
getPlotAreaBackground()
Returns the plot area background color.
|
IlvChartPrintContext |
getPrintContext()
Returns the current printing context, or
null if no printing
operation is being performed. |
URL |
getProject()
Returns the project file URL loaded by this chart.
|
IlvChartProjector |
getProjector()
Returns the projector used by this chart.
|
IlvChartProjector |
getProjector2D()
Returns the 2-D projector used by this chart.
|
Rectangle |
getProjectorRect()
Returns the projecting rectangle.
|
String[] |
getPseudoClasses()
Returns the pseudo-classes of this chart.
|
String[] |
getPseudoClasses(IlvDataSet dataSet)
Returns the pseudo-classes of the specified data set in the context of this
chart.
|
String[] |
getPseudoClasses(IlvDataSet dataSet,
int idx)
Returns the pseudo-classes of the specified data point in the context of
this chart.
|
String[] |
getPseudoClasses(Object object)
Returns the pseudo-classes of the specified model object.
|
IlvChartRenderer |
getRenderer(int idx)
Returns the renderer at the specified index.
|
int |
getRendererCount()
Returns the number of renderers used by this chart.
|
Iterator<IlvChartRenderer> |
getRendererIterator()
Returns an iterator over the renderers used by this chart.
|
List<IlvChartRenderer> |
getRenderers()
Returns all the renderers used by this chart.
|
int |
getRenderingType()
Returns the renderer type for the main data source of this chart.
|
IlvChartResizingPolicy |
getResizingPolicy()
Returns the resizing policy of the chart.
|
int |
getResolvedBaseTextDirection()
Returns the resolved base text direction.
|
Iterator<IlvChartDrawable> |
getReversedDrawableIterator()
Returns an iterator over the
IlvChartDrawable objects managed
by this chart. |
IlvScale |
getScale(IlvAxis axis)
Returns the scale associated with the specified axis.
|
double |
getScrollRatio()
Returns the scroll ratio.
|
double |
getStartingAngle()
Returns the starting angle of the projector.
|
String |
getStyleSheet()
Returns the value of the
styleSheet property. |
int |
getStyleSheetDebugMask()
Returns the current debug level.
|
String[] |
getStyleSheets()
Returns the cascading style sheets.
|
String |
getStyleSheets(int index)
Returns one of the cascading style sheets.
|
IlvSymbolStyle |
getSymbolStyle()
Returns the value of the
symbolStyle property. |
int |
getType()
Returns the chart type.
|
ULocale |
getULocale()
Returns the locale of this component.
|
int |
getUnconstrainedRenderingType()
Returns the renderer type for the main data source of this chart, without
taking into account constraints imposed by the chart type.
|
IlvAxis |
getXAxis()
Returns the abscissa axis.
|
IlvGrid |
getXGrid()
Returns the abscissa grid.
|
IlvScale |
getXScale()
Returns the abscissa scale.
|
String |
getXScaleTitle()
Returns the abscissa scale title or
null if no abscissa scale
has been set. |
double |
getXScaleTitleRotation()
Returns the abscissa scale title rotation.
|
JScrollBar |
getXScrollBar()
Returns the scroll bar attached to the x-axis.
|
IlvAxis |
getYAxis(int idx)
Returns the specified ordinate axis.
|
int |
getYAxisCount()
Returns the number of ordinate axes.
|
IlvGrid |
getYGrid(int yAxisIdx)
Returns the grid associated with the specified y-axis.
|
IlvScale |
getYScale(int yAxisIdx)
Returns the ordinate scale connected to the specified axis.
|
String |
getYScaleTitle()
Returns the title of the ordinate scale connected to the y-axis of index 0
or
null if no ordinate scale has been set. |
double |
getYScaleTitleRotation()
Returns the title rotation of the ordinate scale connected to the y-axis of
index 0.
|
protected void |
initPseudoClasses()
Initializes the pseudo-classes of this chart.
|
void |
invalidateScales()
Invalidates the geometry cache of the scales of this chart.
|
boolean |
is3D()
Indicates whether the chart is rendered in 3-D.
|
boolean |
isAntiAliasing()
Returns the value of the
antiAliasing property. |
boolean |
isAntiAliasingText()
Returns the value of the
antiAliasingText property. |
boolean |
isAutoScaleTitleRotation()
Returns whether the rotation angle of the scale titles is computed
automatically depending on the type of the scale axis and depending on the
projector configuration.
|
boolean |
isCursorSet()
Returns whether a specific cursor has been set on this chart.
|
boolean |
isDynamicStyling()
Indicates whether styles are dynamically applied when the data change.
|
boolean |
isLegendVisible()
Returns whether the legend is visible.
|
boolean |
isOptimizedRepaint()
Indicates whether the handling of paint requests is optimized.
|
boolean |
isPaintingImage()
Returns whether the caller is in a No-AWT-Thread session.
|
boolean |
isPrinting()
Returns whether a printing is currently performed.
|
boolean |
isProjectorReversed()
Indicates whether the chart projector is reversed.
|
boolean |
isScalingFont()
Returns whether the fonts are scaled when the chart is resized.
|
boolean |
isShiftScroll()
Returns the value of the
shiftScroll property. |
boolean |
isUsingEventThread()
Determines whether this component may transfer updates to the AWT-Event
thread.
|
boolean |
isXAxisReversed()
Indicates whether the x-axis is reversed.
|
boolean |
isXGridVisible()
Returns whether the abscissa grid is visible.
|
boolean |
isXScaleVisible()
Returns whether the abscissa scale is visible.
|
boolean |
isYAxisReversed()
Indicates whether the main y-axis is reversed.
|
boolean |
isYGridVisible()
Returns whether the grid associated with the y-axis of index 0 is visible.
|
boolean |
isYScaleVisible()
Returns whether the scale connected to the y-axis of index 0 is visible.
|
void |
paint(Graphics g)
Paints this component.
|
protected void |
paintComponent(Graphics g)
Paints the contents of the chart component.
|
void |
paintCurrentThread(Graphics2D g,
Color bgColor)
Draws the contents of this chart entirely in the caller thread.
|
Element |
paintToFO(Document document,
boolean wholeChart)
Generates an XSL-FO
element representing this chart.
|
Element |
paintToFO(Document document,
boolean wholeChart,
Color bgColor)
Generates an XSL-FO
element representing this chart.
|
Element |
paintToFOCurrentThread(Document document,
boolean wholeChart,
Color bgColor)
Generates an XSL-FO
element representing this chart.
|
void |
print(Graphics g,
IlvChartPrintContext context)
Prints this chart according to the specified printing context.
|
void |
printCurrentThread(Graphics g,
IlvChartPrintContext context)
Prints this chart according to the specified printing context.
|
void |
registerFunction(IlvCSSFunction function)
Registers another function into the Cascading Style Sheets engine.
|
void |
removeChartDrawListener(ChartDrawListener l)
Removes
l from the draw listeners. |
void |
removeChartListener(ChartListener l)
Removes
l from the chart listeners. |
void |
removeChartRendererListener(ChartRendererListener l)
Removes
l from the renderer listeners. |
void |
removeDecoration(IlvChartDecoration decoration)
Removes the specified decoration from this chart.
|
void |
removeInteractor(IlvChartInteractor inter)
Removes an interactor.
|
void |
removePseudoClass(IlvDataSet dataSet,
int idx,
String pseudoClass)
Removes a pseudo-class from the specified data point in the context of this
chart.
|
void |
removePseudoClass(IlvDataSet dataSet,
String pseudoClass)
Removes a pseudo-class from the specified data set in the context of this
chart.
|
void |
removePseudoClass(Object object,
String pseudoClass)
Removes a pseudo-class from the specified model object.
|
void |
removePseudoClass(String pseudoClass)
Removes a pseudo-class from this chart.
|
void |
removeRenderer(IlvChartRenderer renderer)
Removes the specified renderer.
|
void |
removeTreemapFocusListener(TreemapFocusListener l)
Removes
l from the renderer listeners. |
void |
repaint()
Overridden to do nothing if not executing in the AWT/Swing event thread.
|
protected void |
resetStyles()
Resets the chart configuration.
|
void |
revalidate()
Overridden to do nothing if not executing in the AWT/Swing event thread.
|
void |
scroll(double deltaX,
double deltaY,
int yAxisIdx)
Scrolls the visible range of the x- and y-axis by the specified amount.
|
void |
set3D(boolean b)
Specifies whether the chart is rendered in 3-D.
|
void |
setAngleRange(double range)
Sets the angle range of the polar projector.
|
void |
setAntiAliasing(boolean b)
Sets the
antiAliasing property. |
void |
setAntiAliasingText(boolean b)
Sets the
antiAliasingText property. |
void |
setAutoScaleTitleRotation(boolean auto)
Sets whether the rotation angle of the scale titles is computed
automatically depending on the type of the scale axis and depending on the
projector configuration.
|
void |
setBackground(Color bg)
Sets the background color of this component.
|
void |
setBackgroundPaint(Paint bg)
Sets the background as a Paint.
|
void |
setBaseTextDirection(int btd)
Sets the base text direction for this chart.
|
void |
setBounds(int x,
int y,
int w,
int h)
Moves and resizes this component.
|
void |
setChartAreaBorder(Border border)
Sets the chart area border.
|
void |
setComponentOrientation(ComponentOrientation o)
Sets the component orientation of this chart.
|
void |
setCursor(Cursor cursor)
Sets the cursor image to the specified cursor.
|
void |
setDataRangePolicy(IlvDataRangePolicy policy)
Specifies the calculation policy used by the chart to compute the data
range of an axis.
|
void |
setDataSource(IlvDataSource dataSource)
Sets the given data source as the current data source.
|
void |
setDecorations(List<IlvChartDecoration> decorations)
Sets the decorations displayed by this chart.
|
void |
setDefaultColors(Color[] colors)
Sets the default colors used by this chart.
|
void |
setDynamicStyling(boolean dynamicStyling)
Specifies whether styles are dynamically applied when data change.
|
void |
setFooter(JComponent footer)
Sets the footer component.
|
void |
setFooterText(String text)
Sets the footer text.
|
void |
setForeground(Color fg)
Sets the foreground color of this component.
|
void |
setHeader(JComponent header)
Sets the header component.
|
void |
setHeaderText(String text)
Sets the header text.
|
void |
setInteractors(IlvChartInteractor[] inters)
Sets the interactors.
|
void |
setLayout(LayoutManager mgr)
Sets the layout manager for this container.
|
void |
setLegend(IlvLegend legend)
Sets the legend.
|
void |
setLegendPosition(String pos)
Sets the legend position.
|
void |
setLegendVisible(boolean visible)
Sets the legend of this chart visible.
|
void |
setLocale(Locale locale)
Sets the locale of this component.
|
static void |
setNoEventThreadUpdate(boolean b)
Sets whether the requests performed on a chart should be processed in the
AWT-Event thread.
|
void |
setOptimizedRepaint(boolean optimized)
Specifies whether the handling of paint requests is optimized.
|
void |
setPlotAreaBackground(Color color)
Sets the plot area background color.
|
void |
setPolarParameters(double startingAngle,
double range,
boolean symmetric)
Specifies the parameters of a polar projector.
|
void |
setProject(URL project)
Sets the project file URL of this chart.
|
void |
setProjectorReversed(boolean reversed)
Specifies whether the chart projector is reversed.
|
void |
setPseudoClasses(IlvDataSet dataSet,
int idx,
String[] classes)
Sets the pseudo-classes of the specified data point in the context of this
chart.
|
void |
setPseudoClasses(IlvDataSet dataSet,
String[] classes)
Sets the pseudo-classes of the specified data set in the context of this
chart.
|
void |
setPseudoClasses(Object object,
String[] classes)
Sets the pseudo-classes of the specified model object.
|
void |
setPseudoClasses(String[] classes)
Sets the pseudo-classes of this chart.
|
void |
setRenderer(int idx,
IlvChartRenderer renderer)
Changes the renderer at the specified index.
|
void |
setRendererAxis(IlvChartRenderer renderer,
int yAxisIdx)
Connects the specified renderer to the specified ordinate axis.
|
void |
setRendererType(int idx,
int type)
Changes the type of the renderer at the specified index.
|
void |
setRenderingType(int type)
Sets the renderer type for the main data source of the chart.
|
void |
setResizingPolicy(IlvChartResizingPolicy policy)
Sets the resizing policy of the chart.
|
void |
setScalingFont(boolean scalable)
Sets whether the fonts are scaled when the chart is resized.
|
void |
setScrollRatio(double ratio)
Sets the scroll ratio.
|
void |
setShiftScroll(boolean b)
Sets the
shiftScroll property. |
void |
setStartingAngle(double angle)
Sets the starting angle of the projector.
|
void |
setStyleSheet(String styleSheet)
Sets the value of the
styleSheet property. |
void |
setStyleSheetDebugMask(int mask)
Sets the debug flag while parsing the style sheets.
|
void |
setStyleSheets(int index,
String css)
Changes one of the cascading style sheets.
|
void |
setStyleSheets(String[] css)
Sets the cascading style sheets.
|
void |
setSymbolStyle(IlvSymbolStyle style)
Sets the value of the
symbolStyle property. |
void |
setType(int type)
Sets the type of the chart.
|
void |
setULocale(ULocale locale)
Sets the locale of this component.
|
void |
setUsingEventThread(boolean usingEventThread)
Sets whether this component may be visible from an AWT/Swing GUI.
|
void |
setXAxisReversed(boolean reversed)
Sets the
reversed property of the x-axis. |
void |
setXGrid(IlvGrid grid)
Changes the abscissa grid.
|
void |
setXGridVisible(boolean visible)
Sets whether the major lines of the abscissa grid are visible.
|
void |
setXScale(IlvScale scale)
Changes the abscissa scale.
|
void |
setXScaleTitle(String title)
Sets the abscissa scale title.
|
void |
setXScaleTitleRotation(double angle)
Sets the rotation of the abscissa scale title.
|
void |
setXScaleVisible(boolean visible)
Sets whether the abscissa scale is visible.
|
void |
setXScrollBar(JScrollBar scrollbar)
Attaches the specified scroll bar to the x-axis.
|
void |
setXValueFormat(IlvValueFormat format)
Specifies a format for the x-axis.
|
void |
setYAxisReversed(boolean reversed)
Sets the
reversed property of the main y-axis. |
void |
setYGrid(int yAxisIdx,
IlvGrid grid)
Changes the grid of the specified y-axis.
|
void |
setYGridVisible(boolean visible)
Sets whether the major lines of the grid associated with the y-axis of
index 0 is visible.
|
void |
setYScale(int yAxisIdx,
IlvScale scale)
Changes the specified ordinate scale.
|
void |
setYScaleTitle(String title)
Sets the title of the ordinate scale connected to the y-axis of index 0.
|
void |
setYScaleTitleRotation(double angle)
Sets the title rotation of the ordinate scale connected to the y-axis of
index 0.
|
void |
setYScaleVisible(boolean visible)
Sets whether the scale connected to the y-axis of index 0 is visible.
|
void |
setYValueFormat(int yAxisIdx,
IlvValueFormat format)
Specifies a format for a y-axis.
|
void |
startRendererChanges()
Starts a batch of renderer changes.
|
void |
startSession(IlvChart.IlvChartPaintContext context)
Start a No-AWT-Thread session.
|
void |
synchronizeAxis(IlvChart target,
int axisType,
boolean syncPlotArea)
Synchronizes an axis of this chart with an axis of the specified target
chart.
|
void |
toData(IlvDoublePoints pts)
Maps the specified points from display coordinates to data coordinates,
using the main y-axis.
|
void |
toData(IlvDoublePoints pts,
int yAxis)
Maps the specified points from display coordinates to data coordinates,
using the specified y-axis.
|
void |
toDisplay(IlvDoublePoints pts)
Maps the specified points from data coordinates to display coordinates,
using the main y-axis.
|
void |
toDisplay(IlvDoublePoints pts,
int yAxis)
Maps the specified points from data coordinates to display coordinates,
using the specified y-axis.
|
BufferedImage |
toImage(BufferedImage image,
boolean erase)
Paints this chart in a
BufferedImage object. |
BufferedImage |
toImage(int width,
int height,
Color bgColor)
Dumps the chart as a BufferedImage.
|
void |
toJPEG(OutputStream output)
Dumps this chart as a JPEG stream.
|
void |
toJPEG(OutputStream output,
int width,
int height)
Dumps the chart as a JPEG stream.
|
void |
toPNG(OutputStream output)
Dumps this chart as a PNG stream.
|
void |
toPNG(OutputStream output,
boolean transparent)
Dumps this chart as a PNG stream.
|
void |
toPNG(OutputStream output,
int width,
int height)
Dumps this chart as a PNG stream.
|
void |
toPNG(OutputStream output,
int width,
int height,
boolean transparent)
Dumps the chart as a PNG stream.
|
void |
unSynchronizeAxis(int axisType)
Unsynchronizes the specified axis.
|
boolean |
updateDataRange()
Updates the data range for all coordinate systems.
|
void |
updateDataRangeAndRepaint()
Updates the data range for all coordinate systems, and initiates a repaint
of the chart area.
|
void |
updateScales()
Updates the geometry cache of the scales of this chart.
|
void |
updateScalesIfNeeded()
Updates the geometry cache of the scales of this chart.
|
void |
updateUI()
Resets the UI property to a value from the current look and feel.
|
void |
zoom(IlvDataWindow dataWindow,
int yAxisIdx)
Changes the visible range of the x- and y-axis according to the specified
data window.
|
getAccessibleContext, getComponentCountInLayer, getComponentsInLayer, getComponentToLayer, getIndexOf, getLayer, getLayer, getLayeredPaneAbove, getObjectForLayer, getPosition, highestLayer, insertIndexForLayer, isOptimizedDrawingEnabled, lowestLayer, moveToBack, moveToFront, paramString, putLayer, remove, removeAll, setLayer, setLayer, setPosition
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, resize, resize, setBounds, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addPropertyChangeListener, removePropertyChangeListener
public static final int CARTESIAN
setType(int)
,
Constant Field Valuespublic static final int POLAR
setType(int)
,
Constant Field Valuespublic static final int PIE
setType(int)
,
Constant Field Valuespublic static final int RADAR
setType(int)
,
Constant Field Valuespublic static final int TREEMAP
setType(int)
,
Constant Field Valuespublic static final int DRAW_BELOW
public static final int DRAW_ABOVE
public static final int STYLE_DEFAULT_MASK
setStyleSheetDebugMask(int)
,
Constant Field Valuespublic IlvChart()
CARTESIAN
public IlvChart(int type)
setType(int)
public IlvChart(int type, boolean withScales)
type
- The type of the chart.withScales
- A boolean value indicating whether scales and grids should be
added to this chart.setType(int)
public static void setNoEventThreadUpdate(boolean b)
true
, the requests
are processed in the request thread. The default value is
false
.
The value true
is only appropriate for server-side use in
thin-client applications. For Swing or Eclipse/RCP applications, the
default value false
is just fine.
Setting this to true
provides the following benefits:
However, setting this to true
has the following drawbacks:
IlvChart
,
IlvChart.Area
, IlvLegend
and
IlvLegendItems
are not drawn.JLabel
, are not
drawn.
When using this mode, you may need to use the methods
toImage(int, int, Color)
,
startSession(IlvChart.IlvChartPaintContext)
,
endSession(IlvChart.IlvChartPaintContext)
,
isPaintingImage()
, getPaintContext()
, and
the class IlvChart.IlvChartPaintContext
.
getNoEventThreadUpdate()
,
isUsingEventThread()
public static boolean getNoEventThreadUpdate()
true
, the requests are processed in the
request thread.setNoEventThreadUpdate(boolean)
,
isUsingEventThread()
public void setUsingEventThread(boolean usingEventThread)
true
, it is assumed that this component may need to process
events that are made available in the AWT-Event thread. The value
false
is suitable for server-side situation. The default value
is !getNoEventThreadUpdate()
.isUsingEventThread()
,
setNoEventThreadUpdate(boolean)
public boolean isUsingEventThread()
true
for Swing applications and
false
for thin-client applications.
This method can be overridden in subclasses. By default, it returns
!getNoEventThreadUpdate()
.
setUsingEventThread(boolean)
,
setNoEventThreadUpdate(boolean)
public Object getLock()
When used in a server side situation, the returned object must be serializable.
public ULocale getULocale()
ULocale
.IllegalStateException
- if this component's locale has been removed through
setLocale(null)
and none of the ancestors has a
Locale
set eithersetULocale(ULocale)
public void setULocale(ULocale locale)
locale
- An ICU ULocale
, or null
if this
component shall inherit its locale from the parent component.getULocale()
,
setLocale(Locale)
public void setLocale(Locale locale)
setLocale
in class Component
locale
- An Locale
, or null
if this component
shall inherit its locale from the parent component.setULocale(ULocale)
public void setComponentOrientation(ComponentOrientation o)
setComponentOrientation
in class Component
protected void componentOrientationChanged(ComponentOrientation oldOrientation, ComponentOrientation newOrientation)
oldOrientation
- The component orientation before the change.newOrientation
- The component orientation after the change.Component.getComponentOrientation()
,
setComponentOrientation(ComponentOrientation)
public void updateUI()
updateUI
in class JComponent
public void setBounds(int x, int y, int w, int h)
public final boolean isAntiAliasing()
antiAliasing
property.setAntiAliasing(boolean)
public void setAntiAliasing(boolean b)
antiAliasing
property. When this property is set to
true
, all the drawings in the chart component are
anti-aliased. This property does not affect text. To toggle the
anti-aliasing of text, use the setAntiAliasingText(boolean)
method. The
default value of this property is false
.isAntiAliasing()
public final boolean isAntiAliasingText()
antiAliasingText
property.setAntiAliasingText(boolean)
public void setAntiAliasingText(boolean b)
antiAliasingText
property. When this property is set
to true
, all the text drawings in the chart component are
anti-aliased. This property only affects text. To toggle the anti-aliasing
of other drawings, use the setAntiAliasing(boolean)
method. The default
value of this property is false
.setAntiAliasing(boolean)
,
isAntiAliasingText()
public final int getBaseTextDirection()
The base text direction influences the display of text strings that are composed of segments that are read from left to right as well as of segments that are read from right to left. It determines the order of these segments.
IlvBidiUtil.COMPONENT_DIRECTION
,
IlvBidiUtil.CONTEXTUAL_DIRECTION
,
IlvBidiUtil.LEFT_TO_RIGHT
,
IlvBidiUtil.RIGHT_TO_LEFT
,
IlvBidiUtil.INHERITED_DIRECTION
.setBaseTextDirection(int)
,
getResolvedBaseTextDirection()
public void setBaseTextDirection(int btd)
The base text direction influences the display of text strings that are composed of segments that are read from left to right as well as of segments that are read from right to left. It determines the order of these segments.
Possible values are: IlvBidiUtil.COMPONENT_DIRECTION
,
IlvBidiUtil.CONTEXTUAL_DIRECTION
,
IlvBidiUtil.LEFT_TO_RIGHT
, IlvBidiUtil.RIGHT_TO_LEFT
, and
IlvBidiUtil.INHERITED_DIRECTION
, which in this case is equivalent
to IlvBidiUtil.COMPONENT_DIRECTION
.
The base text direction affects, in particular:
btd
- The base text direction.getBaseTextDirection()
public int getResolvedBaseTextDirection()
The base text direction influences the display of text strings that are composed of segments that are read from left to right as well as of segments that are read from right to left. It determines the order of these segments.
This method is based on getBaseTextDirection()
but determines the
value when it is inherited from a parent component
(IlvBidiUtil.INHERITED_DIRECTION
) or dependent on the component
orientation (IlvBidiUtil.COMPONENT_DIRECTION
).
IlvBidiUtil.CONTEXTUAL_DIRECTION
,
IlvBidiUtil.LEFT_TO_RIGHT
,
IlvBidiUtil.RIGHT_TO_LEFT
.protected void baseTextDirectionChanged()
getResolvedBaseTextDirection()
has
changed, orgetComponentOrientation()
has changed
and the value of getResolvedBaseTextDirection()
is
IlvBidiUtil.CONTEXTUAL_DIRECTION
.public void setCursor(Cursor cursor)
public boolean isCursorSet()
isCursorSet
in class Component
public final boolean isOptimizedRepaint()
setOptimizedRepaint(boolean)
public void setOptimizedRepaint(boolean optimized)
If the optimizedRepaint
property is set to true
,
the chart tries to optimize repaint requests so that only a subset of the
displayed data is redrawn. If set to false
, no optimization is
performed. The default value is true
. You may need to toggle
off the optimization when using self-adapting Paint
objects on
continuous renderers such as line, area and stair.
optimized
- Whether the handling of paint requests is optimized.public boolean isShiftScroll()
shiftScroll
property.public void setShiftScroll(boolean b)
shiftScroll
property. When this property is set to
true
, the x-axis automatically scrolls as new data come in.
The scroll ratio of the axis is specified by the setScrollRatio(double)
method. The default value of this property is false
.public double getScrollRatio()
setScrollRatio(double)
public void setScrollRatio(double ratio)
shiftScroll
property of the chart is set to true
.
It specifies the amount of the visible x-range that is scrolled back when
new data is added beyond this range. It must take a value between
0
and 1
. The exact scroll back is always a
multiple of visible range * scroll ratio
. A value of
0
means that the x-axis is scrolled by the exact amount
necessary to make the new data visible. The default scroll ratio is
0
.setShiftScroll(boolean)
public int getType()
setType(int)
public void setType(int type)
CARTESIAN
,
POLAR
,
RADAR
,
PIE
,
TREEMAP
,
getType()
,
createScale(int)
,
createGrid(int)
public void setPolarParameters(double startingAngle, double range, boolean symmetric)
POLAR
chart type.startingAngle
- The new starting angle, expressed in degrees.range
- The new range, expressed in degrees.symmetric
- If true
, the projector will use true polar
coordinates. This means that points with (-rho, theta) and (rho,
theta+180) coordinates are coincident. If set to
false
, data points with both negative and positive
y-values will be projected along the same radial.public final double getStartingAngle()
setStartingAngle(double)
public void setStartingAngle(double angle)
This method is only meaningful for the following chart types:
POLAR
, PIE
, RADAR
.
angle
- The new starting angle, expressed in degrees.public final double getAngleRange()
setAngleRange(double)
public void setAngleRange(double range)
This method is only meaningful for the following chart types:
POLAR
, PIE
.
range
- The new range, expressed in degrees.public boolean isProjectorReversed()
CARTESIAN
chart type.getType()
,
setProjectorReversed(boolean)
public void setProjectorReversed(boolean reversed)
CARTESIAN
chart type.getType()
,
isProjectorReversed()
public Color[] getDefaultColors()
IlvChartRenderer.getDefaultColors()
method for more details.setDefaultColors(java.awt.Color[])
public void setDefaultColors(Color[] colors)
getDefaultColors()
public final IlvScalableFontManager getFontManager()
IlvScalableFontManager.setFontManager(java.awt.Component, ilog.views.chart.IlvScalableFontManager, java.awt.Font)
method.IlvScalableFontManager
public boolean isScalingFont()
public void setScalingFont(boolean scalable)
public final IlvScale getScale(IlvAxis axis)
null
if the axis is not used by this chart or if no scale is
defined for that axis.public final boolean isAutoScaleTitleRotation()
public void setAutoScaleTitleRotation(boolean auto)
false
.public IlvAxis getXAxis()
public final boolean isXAxisReversed()
public void setXAxisReversed(boolean reversed)
reversed
property of the x-axis.public final IlvScale getXScale()
public void setXScale(IlvScale scale)
scale
- The new scale, or null
if the scale is removed.public boolean isXScaleVisible()
public void setXScaleVisible(boolean visible)
public String getXScaleTitle()
null
if no abscissa scale
has been set.setXScaleTitle(java.lang.String)
public void setXScaleTitle(String title)
public double getXScaleTitleRotation()
public void setXScaleTitleRotation(double angle)
public int getYAxisCount()
public IlvAxis getYAxis(int idx)
public final boolean isYAxisReversed()
public void setYAxisReversed(boolean reversed)
reversed
property of the main y-axis.public IlvAxis addYAxis(boolean createScale, boolean createGrid)
createScale
- A boolean value indicating whether a scale should be created and
connected to the new axis.createGrid
- A boolean value indicating whether a grid should be created, and
connected to the new axis.public final IlvScale getYScale(int yAxisIdx)
yAxisIdx
- The index of the considered ordinate axis.null
if no scale is defined for that axis.public void setYScale(int yAxisIdx, IlvScale scale)
yAxisIdx
- The index of the considered y-axis.scale
- The new scale. If null
, this method removes the
previous scale.IllegalArgumentException
- The specified scale is already attached to a chart.IndexOutOfBoundsException
- The specified y-axis index is invalid.public boolean isYScaleVisible()
public void setYScaleVisible(boolean visible)
public String getYScaleTitle()
null
if no ordinate scale has been set.setYScaleTitle(java.lang.String)
public void setYScaleTitle(String title)
public double getYScaleTitleRotation()
public void setYScaleTitleRotation(double angle)
public final IlvGrid getXGrid()
public void setXGrid(IlvGrid grid)
grid
- The new grid. If set to null
, the previous grid is
removed.IllegalStateException
- The specified grid is already attached to a chart.getXGrid()
public boolean isXGridVisible()
public void setXGridVisible(boolean visible)
public final IlvGrid getYGrid(int yAxisIdx)
setYGrid(int, ilog.views.chart.IlvGrid)
public void setYGrid(int yAxisIdx, IlvGrid grid)
getYGrid(int)
public boolean isYGridVisible()
setYGridVisible(boolean)
public void setYGridVisible(boolean visible)
public final IlvCoordinateSystem getCoordinateSystem(int yAxisIdx)
protected IlvScale createScale(int axisIdx)
method
. It can be overridden to
return a custom scale.
Note: This method can be called from the constructor of
IlvChart
.
axisIdx
- The index of the considered axis: -1
for the x-axis,
or the index of a given y-axis.null
if no scale is used.protected IlvGrid createGrid(int axisIdx)
method
. It can be overridden to return a custom
grid.
Note: This method can be called from the constructor of
IlvChart
.
axisIdx
- The index of the considered axis: -1
for the x-axis,
or the index of a given y-axis.null
if no scale is used.public String formatXValue(double value)
setXValueFormat(ilog.views.chart.IlvValueFormat)
method. If no format has been
defined, it uses the label format of the scale associated with this axis,
or a default format if no scale exists.value
- The value to format.public String formatYValue(int yAxisIdx, double value)
setYValueFormat(int, ilog.views.chart.IlvValueFormat)
method. If no format has been
defined, it uses the label format of the scale associated with this axis,
or a default format if no scale exists.yAxisIdx
- The index of the y-axis.value
- The value to format.public void setXValueFormat(IlvValueFormat format)
format
- The new format.formatXValue(double)
public void setYValueFormat(int yAxisIdx, IlvValueFormat format)
yAxisIdx
- The index of the y-axis.format
- The new format.formatYValue(int, double)
public List<IlvChartDecoration> getDecorations()
IlvChartDecoration
s displayed by
this chart.public void addDecoration(IlvChartDecoration decoration)
IllegalArgumentException
- The specified decoration is already displayed by another chart.public void removeDecoration(IlvChartDecoration decoration)
IllegalArgumentException
- The specified decoration is not displayed by this chart.public void setDecorations(List<IlvChartDecoration> decorations)
decorations
- The list of the new decorations, each of type
IlvChartDecoration
, or an empty list or
null
to remove all the decorations.public final Iterator<IlvChartDrawable> getDrawableIterator()
IlvChartDrawable
objects managed
by this chart.UnsupportedOperationException
is
thrown when calling the remove
method).public final Iterator<IlvChartDrawable> getReversedDrawableIterator()
IlvChartDrawable
objects managed
by this chart.UnsupportedOperationException
is thrown when calling
the remove
method).public List<IlvChartRenderer> getRenderers()
IlvChartRenderer
public Iterator<IlvChartRenderer> getRendererIterator()
IlvChartRenderer
. The
returned iterator does not allow element removal (an
UnsupportedOperationException
is thrown when calling the
remove
method).IlvChartRenderer
elementspublic Iterator<IlvChartRenderer> getAllRendererIterator()
IlvChart
and
IlvChartRenderer
instances.public IlvChartRenderer getRenderer(int idx)
public void setRenderer(int idx, IlvChartRenderer renderer) throws IllegalArgumentException
IllegalArgumentException
- The specified renderer is not supported by this chart.public void setRendererType(int idx, int type) throws IllegalArgumentException
IllegalArgumentException
- The specified type is not supported by this chart.setRenderingType(int)
public void removeRenderer(IlvChartRenderer renderer) throws IllegalArgumentException
IllegalArgumentException
public int getRendererCount()
public void addRenderer(int rank, IlvChartRenderer renderer, int yAxisIdx) throws IllegalArgumentException, IndexOutOfBoundsException
rank
- The insertion rank.renderer
- The considered renderer.yAxisIdx
- The index of the y-axis to which the renderer is connected.IllegalArgumentException
- The type of the specified renderer is not supported by this
chart.IndexOutOfBoundsException
- The axis index is not valid.public final void addRenderer(IlvChartRenderer renderer, IlvDataSet dataSet) throws IllegalArgumentException
IllegalArgumentException
- The type of the specified renderer is not supported by this
chart.public final void addRenderer(IlvChartRenderer renderer) throws IllegalArgumentException
IllegalArgumentException
- The type of the specified renderer is not supported by this
chart.addRenderer(IlvChartRenderer, int)
public void addRenderer(IlvChartRenderer renderer, int yAxisIdx) throws IllegalArgumentException
IllegalArgumentException
- The specified renderer is not supported by this chart.IndexOutOfBoundsException
- The axis index is not valid.public void setRendererAxis(IlvChartRenderer renderer, int yAxisIdx) throws IllegalArgumentException
IllegalArgumentException
- The specified renderer is not handled by this chart.IlvChartRenderer.setYAxisIdx(int)
public void addData(IlvDataSource dataSource, int chartType) throws IllegalArgumentException
IllegalArgumentException
- The specified renderer is not supported by this chart.setRenderingType(int)
public final int getRenderingType()
Note: When the type of the chart is PIE
, the
default renderer type is always IlvChartRenderer.PIE
.
setRenderingType(int)
public final int getUnconstrainedRenderingType()
public void setRenderingType(int type)
IlvChartRenderer.PIE
type is allowed for pie
charts. The specified type is used when calling the setDataSource(ilog.views.chart.data.IlvDataSource)
method to create the appropriate instance of IlvChartRenderer
. The
default values is IlvChartRenderer.POLYLINE
.type
- The type of the renderer.public Iterator<IlvDataSet> getDataSetIterator()
IlvDataSet
.
The returned iterator does not allow element removal (an
UnsupportedOperationException
is thrown when calling the
remove
method).IlvDataSet
elementspublic void setDataSource(IlvDataSource dataSource) throws IllegalArgumentException
IllegalArgumentException
- The type of the specified renderer is not supported by this
chart.setRenderingType(int)
public IlvDataSource getDataSource()
null
if no renderer has been added to the chart.public final void addChartListener(ChartListener l)
public final void removeChartListener(ChartListener l)
l
from the chart listeners.public Rectangle getProjectorRect()
IlvChart.Area.getPlotRect()
public void toDisplay(IlvDoublePoints pts, int yAxis)
pts
parameter. It considers the coordinate system
formed by the x-axis and the specified y-axis. The returned display
coordinates are expressed in the coordinate system of the chart area
component.IlvChart.Area
public final void toDisplay(IlvDoublePoints pts)
toDisplay(IlvDoublePoints, int)
public void toData(IlvDoublePoints pts, int yAxis)
pts
parameter. It considers the coordinate system
formed by the x-axis and the specified y-axis. The provided display
coordinates must be expressed in the coordinate system of the chart area
component.IlvChart.Area
public final void toData(IlvDoublePoints pts)
toData(IlvDoublePoints, int)
public IlvChartProjector getProjector()
public final IlvChartProjector getProjector2D()
This method is designed for internal use only. When the chart is rendered
in 3-D, this method returns the underlying 2-D projector. If the chart is
displayed in 2-D, the method returns the same projector as the
getProjector()
method.
public final IlvChartProjector getLocalProjector2D(Rectangle projRect, IlvCoordinateSystem coordSys)
This method is designed for internal use only. It returns a copy of the 2-D projector, configured to project data according to the specified projecting rectangle and coordinate system.
public IlvDisplayPoint getNearestPoint(IlvChartDataPicker picker)
picker
- The object holding the picking information.null
if none was found.public IlvDisplayPoint getNearestItem(IlvChartDataPicker picker, double[] distanceResult)
picker
- The object holding the picking information.distanceResult
- If not null
, this is used to return the distance to
the rendering of the item. You can pass null
if you
do not need this information.null
if none was found.public IlvDisplayPoint getDisplayItem(IlvChartDataPicker picker)
picker
- The object holding the picking information.null
if none was found.public List<IlvDisplayPoint> getDisplayItems(IlvChartDataPicker picker)
getDisplayItem(IlvChartDataPicker)
, except that it returns all
items, if several renderers happen to show an item at or near the same
point. The first returned point is the same as the one returned by
getDisplayItem(IlvChartDataPicker)
.picker
- The object holding the picking information.IlvDisplayPoint
objects,
or an empty list if none was found.public void scroll(double deltaX, double deltaY, int yAxisIdx)
public void zoom(IlvDataWindow dataWindow, int yAxisIdx)
public void invalidateScales()
updateScales()
,
updateScalesIfNeeded()
public void updateScales()
updateScales()
is equivalent to a call to
invalidateScales()
followed by a call to
updateScalesIfNeeded()
.
updateScalesIfNeeded()
public void updateScalesIfNeeded()
updateScales()
public void dataSetContentsChanged(DataSetContentsEvent event, IlvChartRenderer r)
IlvChartRenderer
when one of its data set has
changed.public boolean updateDataRange()
This method is automatically called when one of the following events occurs:
setDataRangePolicy(ilog.views.chart.IlvDataRangePolicy)
public void updateDataRangeAndRepaint()
public IlvDataRangePolicy getDataRangePolicy()
public void setDataRangePolicy(IlvDataRangePolicy policy)
getDataRangePolicy()
public final IlvChartResizingPolicy getResizingPolicy()
setResizingPolicy(ilog.views.chart.IlvChartResizingPolicy)
public void setResizingPolicy(IlvChartResizingPolicy policy)
A resizing policy determines whether the visible range of the chart axes is
modified when the chart area is resized. The policy only affects axes that
do not compute automatically their visible range (see
IlvAxis.isAutoVisibleRange()
). Note also that resizing policies only
work for two-dimensional Cartesian charts.
Note: If an axis is synchronized with the axis of another chart, the policy of this other chart is used to determine the new visible range.
policy
- The resizing policy. If the policy is set to null
,
which is the default value, the visible range of the axes is not
modified.synchronizeAxis(ilog.views.chart.IlvChart, int, boolean)
public String[] getStyleSheets()
getStyleSheets
in interface IlvStylable
public void setStyleSheets(String[] css) throws IlvStylingException
setStyleSheets
in interface IlvStylable
css
- An array of strings containing the URLs, or the file names of CSS
files (usually with a .css
suffix). A
null
array disables styling for the chart.IlvStylingException
- If an exception occurs while loading or parsing the style sheet.public String getStyleSheets(int index)
getStyleSheets
in interface IlvStylable
index
- The position of the cascading style sheet to return.index
-th style sheet.public void setStyleSheets(int index, String css) throws IlvStylingException
setStyleSheets(java.lang.String[])
. It lets you change one
particular style sheet file, instead of setting the whole style sheet
array.setStyleSheets
in interface IlvStylable
index
- The index of the style sheet to replace.css
- The URL or file name of the new style sheet file.IlvStylingException
- If an exception occurs while loading or parsing the style sheet.setStyleSheets(java.lang.String[])
public final String getStyleSheet()
styleSheet
property. This method is
equivalent to getStyleSheets(0)
.styleSheet
property, or the first of the cascading
style sheets if setStyleSheets(String[])
was used.setStyleSheet(String)
public final void setStyleSheet(String styleSheet) throws IlvStylingException
styleSheet
property. This method is
equivalent to setStyleSheets(0, styleSheet)
.
Note: The Bean property styleSheet
must not be specified
together with the Bean property symbolStyle
.
styleSheet
- The URL, the file name, or directly the style sheet string. This
method overrides the first style sheet defined in
setStyleSheets(String[])
.IlvStylingException
- If an exception occurs while loading or parsing the style sheet.public final IlvSymbolStyle getSymbolStyle()
symbolStyle
property. It is the value
that has been set through setSymbolStyle(IlvSymbolStyle)
, or
null
if none has been set.symbolStyle
property.setSymbolStyle(IlvSymbolStyle)
public final void setSymbolStyle(IlvSymbolStyle style) throws IlvStylingException
symbolStyle
property. This method
includes a call to setStyleSheets(String[])
.
Note: The Bean property symbolStyle
must not be specified
together with the Bean property styleSheet
.
style
- The style of the symbol that contains this chart, or
null
for none.IlvStylingException
- If an exception occurs while loading or parsing the style sheet.public int getStyleSheetDebugMask()
getStyleSheetDebugMask
in interface IlvStylable
setStyleSheetDebugMask(int)
public void setStyleSheetDebugMask(int mask)
setStyleSheets(java.lang.String[])
to debug
problems during the configuration. The default value traces bad class names
and "setter" methods that raise an exception.setStyleSheetDebugMask
in interface IlvStylable
mask
- The debug mask, expressed as an OR combination of the predefined
masks.setStyleSheets(java.lang.String[])
,
getStyleSheetDebugMask()
,
IlvStylable.APPLIED_RULE_MASK
,
IlvStylable.BAD_CLASS_MASK
,
IlvStylable.BAD_PROP_MASK
,
IlvStylable.CREATED_MASK
,
IlvStylable.DECL_MASK
,
IlvStylable.DECL_VALUE_MASK
,
IlvStylable.FAILED_CONVERSIONS_MASK
,
IlvStylable.TIME_REPORT_MASK
,
IlvStylable.WARNING_PROP_MASK
public final boolean isDynamicStyling()
setDynamicStyling(boolean)
public void setDynamicStyling(boolean dynamicStyling)
true
.
Note: For efficiency reasons, it is recommended to toggle off dynamic styling if your style sheet does not contain any rule based on the attributes of a data point, or if your data model is static.
dynamicStyling
- If true
, the styles specified by the
setStyleSheets(String[])
method are re-applied whenever
the content of a data set changes (for example, when new data
points are added, or when the values of a data point change). If
set to false
, the styles are only applied when the
cascading style sheets are set.setStyleSheets(String[])
,
setStyleSheets(int, String)
public final void doStyle()
protected void applyStyles()
setStyleSheets(java.lang.String[])
, just after the resetStyles()
method.protected void resetStyles()
setStyleSheets(String[])
before new styles are applied.
This method resets the chart configuration to its default state:
createScale(int)
,
createGrid(int)
,
applyStyles()
public String[] getPseudoClasses()
addPseudoClass(String)
,
removePseudoClass(String)
public void setPseudoClasses(String[] classes)
classes
- An array of strings that identify the pseudo-classes to associate
with the chart.addPseudoClass(String)
,
removePseudoClass(String)
public void addPseudoClass(String pseudoClass)
chart:magnified { font : "Dialog,plain,16"; }This rule will be applied when adding the
magnified
pseudo-class to a chart:
addPseudoClass("magnified");
pseudoClass
- A string that identifies a pseudo-class to add to the classes
already associated with the chart.removePseudoClass(String)
,
getPseudoClasses()
public void removePseudoClass(String pseudoClass)
pseudoClass
- A string that identifies a pseudo-class to remove from the classes
associated with the chart.addPseudoClass(String)
,
getPseudoClasses()
,
clearPseudoClass(String)
protected void initPseudoClasses()
The default implementation of this method adds the pseudo-class
high-contrast
if appropriate.
public String[] getPseudoClasses(IlvDataSet dataSet)
dataSet
- A data set.addPseudoClass(IlvDataSet, String)
,
removePseudoClass(IlvDataSet, String)
public void setPseudoClasses(IlvDataSet dataSet, String[] classes)
dataSet
- The data set whose pseudo-classes are to be set.classes
- An array of strings that identify the pseudo-classes to associate
with the data set.addPseudoClass(IlvDataSet, String)
,
removePseudoClass(IlvDataSet, String)
public void addPseudoClass(IlvDataSet dataSet, String pseudoClass)
series:selected { color1: red; }This rule will be applied when adding the
selected
pseudo-class to a data set:
addPseudoClass(dataSet, "selected");
dataSet
- The data set.pseudoClass
- A string that identifies a pseudo-class to add to the classes
already associated with the data set.removePseudoClass(IlvDataSet, String)
,
getPseudoClasses(IlvDataSet)
public void removePseudoClass(IlvDataSet dataSet, String pseudoClass)
dataSet
- The data set.pseudoClass
- A string that identifies a pseudo-class to remove from the classes
associated with the data set.addPseudoClass(IlvDataSet, String)
,
getPseudoClasses(IlvDataSet)
,
clearPseudoClass(String)
public String[] getPseudoClasses(IlvDataSet dataSet, int idx)
dataSet
- A data set.idx
- An index identifying the point in the data set.addPseudoClass(IlvDataSet, int, String)
,
removePseudoClass(IlvDataSet, int, String)
public void setPseudoClasses(IlvDataSet dataSet, int idx, String[] classes)
dataSet
- A data set.idx
- An index identifying the point in the data set.classes
- An array of strings that identify the pseudo-classes to associate
with the data point.addPseudoClass(IlvDataSet, int, String)
,
removePseudoClass(IlvDataSet, int, String)
public void addPseudoClass(IlvDataSet dataSet, int idx, String pseudoClass)
point:selected { color1: red; }This rule will be applied when adding the
selected
pseudo-class to a data set:
addPseudoClass(dataSet, 7, "selected");
dataSet
- A data set.idx
- An index identifying the point in the data set.pseudoClass
- A string that identifies a pseudo-class to add to the classes
already associated with the data point.removePseudoClass(IlvDataSet, int, String)
,
getPseudoClasses(IlvDataSet, int)
public void removePseudoClass(IlvDataSet dataSet, int idx, String pseudoClass)
dataSet
- A data set.idx
- An index identifying the point in the data set.pseudoClass
- A string that identifies a pseudo-class to remove from the classes
associated with the data point.addPseudoClass(IlvDataSet, int, String)
,
getPseudoClasses(IlvDataSet, int)
,
clearPseudoClass(String)
public String[] getPseudoClasses(Object object)
object
- An object contained in a model.null
for none.setPseudoClasses(Object, String[])
,
addPseudoClass(Object, String)
,
removePseudoClass(Object, String)
public void setPseudoClasses(Object object, String[] classes)
Pseudo-classes are used during styling to modify the appearance of an object depending on some state information. For example, you can specify the following rule in a style sheet:
object:selected { color1: red; }This rule will be applied to those objects for which the set of pseudo-classes contains "selected". To enable it for a particular object, you can use code like this:
chart.addPseudoClass(object, "selected");
Note: To set the pseudo-classes of data sets, for use in "series" rules
CSS, please use the setPseudoClasses(IlvDataSet, String[])
function.
object
- An object contained in a model.classes
- An array of strings that identify the pseudo-classes to associate
with the object, or null
for none.getPseudoClasses(Object)
,
addPseudoClass(Object, String)
,
removePseudoClass(Object, String)
public void addPseudoClass(Object object, String pseudoClass)
object
- An object contained in a model.pseudoClass
- A string denoting the pseudo-class to associate with the object.removePseudoClass(Object, String)
public void removePseudoClass(Object object, String pseudoClass)
object
- An object contained in a model.pseudoClass
- A string denoting the pseudo-class to disassociate from the
object.addPseudoClass(Object, String)
,
clearPseudoClass(String)
public void clearPseudoClass(String pseudoClass)
pseudoClass
- A string denoting the pseudo-class to disassociate from the chart
and all data sets, data points and objects.removePseudoClass(String)
,
removePseudoClass(IlvDataSet, String)
,
removePseudoClass(IlvDataSet, int, String)
,
removePseudoClass(Object, String)
,
clearAllPseudoClasses()
public void clearAllPseudoClasses()
clearPseudoClass(String)
public void registerFunction(IlvCSSFunction function)
registerFunction
in interface IlvAcceptFunctions
function
- The function
to be
added.public IlvChart3DView get3DView()
set3D(boolean)
public final boolean is3D()
Note: Only Cartesian and Pie charts can be displayed in 3-D.
set3D(boolean)
public void set3D(boolean b)
Note: Only Cartesian and Pie charts can be displayed in 3-D.
is3D()
,
get3DView()
public IlvChartInteractor[] getInteractors()
addInteractor(IlvChartInteractor)
public void setInteractors(IlvChartInteractor[] inters)
IllegalArgumentException
- One of the interactor is null
, or it is attached to
another chart.addInteractor(IlvChartInteractor)
public void addInteractor(IlvChartInteractor inter)
inter
- The new interactor to add.IllegalArgumentException The interactor is
null
, or it is attached to another chart.
public void addInteractor(String inter)
String
describing either the
interactor class name or the registered name associated with the
interactor.public void removeInteractor(IlvChartInteractor inter)
inter
- The interactor to remove.IllegalArgumentException
- The interactor is not attached to this chart.addInteractor(IlvChartInteractor)
public IlvChart.Area getChartArea()
public Border getChartAreaBorder()
public void setChartAreaBorder(Border border)
public Color getPlotAreaBackground()
public void setPlotAreaBackground(Color color)
public Color getBackground()
getBackground
in class Component
public final Paint getBackgroundPaint()
public void setBackgroundPaint(Paint bg)
public void setBackground(Color bg)
setBackground
in class JComponent
public void setForeground(Color fg)
setForeground
in class JComponent
public void setLayout(LayoutManager mgr)
IlvChart
only
handles IlvChartLayout
instances.setLayout
in class Container
IllegalArgumentException
- The layout is not an instance of IlvChartLayout
.IlvChartLayout
protected void addImpl(Component comp, Object constraints, int index)
setHeader
, setFooter
or addLegend
methods, or directly using the various Container.add()
methods. In the this case, the component is added only if the specified
constraint refers to a different layer index than the
JLayeredPane.DEFAULT_LAYER
index.addImpl
in class JLayeredPane
IllegalArgumentException
- The component is not valid. This exception is raised when you
call the add()
method directly with a layer index
equals to the default layer used by the chart components.public final JComponent getHeader()
public void setHeader(JComponent header)
header
- The component to add. Passing null
removes the
current header component from the chart.public String getHeaderText()
null
if no header has been
set or if the header is not an instance of JLabel
.public void setHeaderText(String text)
JLabel
displaying the given text. This method
replaces the previous header component if it is not an instance of
JLabel
.setHeader(javax.swing.JComponent)
public final JComponent getFooter()
public void setFooter(JComponent footer)
footer
- The component to add. Passing null
removes the
current footer component from the chart.public String getFooterText()
null
if no footer has been
set or if the footer is not an instance of JLabel
.public void setFooterText(String text)
JLabel
displaying the given text. This method
replaces the previous footer component if it is not an instance of
JLabel
.setFooter(javax.swing.JComponent)
protected JLabel createJLabel(String text)
setHeaderText
and setFooterText
to create the
JLabel used to display the text.public final IlvLegend getLegend()
public void setLegend(IlvLegend legend)
The old legend is disconnected from this chart. Then, if the argument is
not null
, it is connected to this chart and becomes the legend
of this chart.
Note: This method does not remove the old legend as a
JComponent
child from this chart, nor it adds the new legend
as a JComponent
child to this chart. Before calling this
method, you have to remove the old legend from the JComponent
hierarchy, by calling Container.remove(java.awt.Component)
or
setLegendVisible(boolean)
(false)
. After calling this method,
you have to add the new legend to the JComponent
hierarchy, by
calling Container.add(java.awt.Component)
or
addLegend(IlvLegend, String)
.
legend
- The new legend, or null
.addLegend(IlvLegend, String)
,
setLegendVisible(boolean)
public void addLegend(IlvLegend legend, String pos)
pos
.
Equivalent to addLegend(legend, pos, true)
.addLegend(IlvLegend, String, boolean)
public void addLegend(IlvLegend legend, String pos, boolean autoPos)
legend
- The new IlvLegend
object.pos
- A valid IlvChartLayout
constraint.autoPos
- If true
, legend
is placed automatically
according to its last known position. This parameter is only used
in absolute positioning.IlvChartLayout
,
IlvLegend
public boolean isLegendVisible()
public void setLegendVisible(boolean visible)
true
and no legend has been set yet, this method adds a new
IlvLegend
instance to the chart at the current legend
position. If false
, the current legend (if any) is removed and
the reference is nullified.protected IlvLegend createLegend()
IlvLegend
instance. This method is called by
setLegendVisible(boolean)
to create a new IlvLegend
instance.public String getLegendPosition()
IlvChartLayout
public void setLegendPosition(String pos)
pos
- A valid IlvChartLayout
position.public final void addChartRendererListener(ChartRendererListener l)
public final void removeChartRendererListener(ChartRendererListener l)
l
from the renderer listeners.public void startRendererChanges()
ChartRendererListener2
public void endRendererChanges()
ChartRendererListener2
public final void addTreemapFocusListener(TreemapFocusListener l)
public final void removeTreemapFocusListener(TreemapFocusListener l)
l
from the renderer listeners.public final void addChartDrawListener(ChartDrawListener l)
public final void removeChartDrawListener(ChartDrawListener l)
l
from the draw listeners.public void synchronizeAxis(IlvChart target, int axisType, boolean syncPlotArea)
Warning: After this method is invoked, the axis of this chart and the axis of the specified chart behave as if they were the same instance, except for attached listeners.
Note: This is a different synchronization mechanism than
IlvAxis.synchronizeWith(IlvAxis, boolean)
.
target
- The target chart.axisType
- The type of the axis that must be synchronized:
IlvAxis.X_AXIS
or IlvAxis.Y_AXIS
. Only
the x axis and the main y axis can be synchronized.syncPlotArea
- Specifies whether the plotting rectangle of both charts should
also be synchronized. If this parameter is set to
true
, the chart will try to align its plotting
rectangle with the plotting rectangle of the target chart. This
mode only works for two-dimensional Cartesian charts.UnsupportedOperationException
- if one of the charts is not a two-dimensional Cartesian chart.public void unSynchronizeAxis(int axisType)
public JScrollBar getXScrollBar()
setXScrollBar(javax.swing.JScrollBar)
public void setXScrollBar(JScrollBar scrollbar)
scrollbar
- The scroll bar to attach. Passing a null
value
disconnect the previous scroll bar.attachBoundedModel(javax.swing.BoundedRangeModel, int, boolean)
public void attachBoundedModel(BoundedRangeModel model, int axisIdx, boolean reversed)
model
- The model to be connected.axisIdx
- The index of the associated axis.reversed
- Whether the model bounds should be reversed.public void attachBoundedModel(BoundedRangeModel model, int axisIdx)
public void detachBoundedModel(BoundedRangeModel model)
public void paint(Graphics g)
paint
in class JLayeredPane
protected void paintComponent(Graphics g)
paintComponent
in class JComponent
public void revalidate()
revalidate
in class JComponent
public void repaint()
public BufferedImage toImage(BufferedImage image, boolean erase)
BufferedImage
object. The operation is
performed in the AWT-Event Thread.image
- The destination image. If null
, an new image is
created.erase
- Indicates whether the specified image should be erased. This
parameter is only taken into account if image is not
null
.public void toPNG(OutputStream output, boolean transparent) throws IOException
output
- The output stream.transparent
- Specifies whether the generated PNG image should have a
transparent background.IOException
- An error occurred during the encoding process.public void toPNG(OutputStream output) throws IOException
toPNG(output, false)
. The operation is performed in the
AWT-Event Thread.output
- The output stream.IOException
- An error occurred during the encoding process.toPNG(OutputStream, boolean)
public void toJPEG(OutputStream output) throws IOException
output
- The output stream.IOException
- An error occurred during the encoding process.public final IlvChart.IlvChartPaintContext getPaintContext()
IlvChartPaintContext
, if any.public final void startSession(IlvChart.IlvChartPaintContext context)
public final void endSession(IlvChart.IlvChartPaintContext context)
startSession(ilog.views.chart.IlvChart.IlvChartPaintContext)
public final boolean isPaintingImage()
getPaintContext()
public void paintCurrentThread(Graphics2D g, Color bgColor)
startSession()
and endSession()
.g
- Graphics context that interfaces to the graphics device.bgColor
- Background color, or null
to designate the (possibly
Swing Look&Feel dependent) default background color.getPaintContext()
public BufferedImage toImage(int width, int height, Color bgColor)
width
- The width of the image. Must be > 0.height
- The height of the image. Must be > 0.bgColor
- background color, or null
to designate the (possibly
Swing Look&Feel dependent) default background colorIOException
public void toPNG(OutputStream output, int width, int height, boolean transparent) throws IOException
output
- The output stream.width
- The width of the image.height
- The height of the image.transparent
- Specifies whether the generated PNG image should have a
transparent background.IOException
- An error occurred during the encoding process.toImage(int, int, Color)
public void toPNG(OutputStream output, int width, int height) throws IOException
toPNG(output, width, height, false)
. The operation is
performed in the caller thread.output
- The output stream.width
- The width of the image.height
- The height of the image.IOException
- An error occurred during the encoding process.toPNG(OutputStream, int, int, boolean)
public void toJPEG(OutputStream output, int width, int height) throws IOException
output
- The output stream.width
- The width of the imageheight
- The height of the imageIOException
toImage(int, int, Color)
public final boolean isPrinting()
public final IlvChartPrintContext getPrintContext()
null
if no printing
operation is being performed.public void print(Graphics g, IlvChartPrintContext context)
Note: This method must be invoked from the AWT-Event Thread, not from any other thread.
This is a low-level function. Higher-level API is found in the ilog.views.util.print package. See the tabledemo sample for how to use this API.
g
- The destination graphics context.context
- The printing context.public void printCurrentThread(Graphics g, IlvChartPrintContext context)
This is a low-level function. Higher-level API is found in the ilog.views.util.print package. See the tabledemo sample for how to use this API.
g
- The destination graphics context.context
- The printing context.public Element paintToFO(Document document, boolean wholeChart)
The chart is unscaled, that is, every pixel gets mapped onto a length of 1/72 inch (approximately 0.35 mm).
Note: This method must only be invoked from the AWT-Event Thread.
document
- The XML document that the generated element will become a part of.wholeChart
- Pass true
to draw the chart; pass false
to draw the chart area.paintToFOCurrentThread(org.w3c.dom.Document, boolean, java.awt.Color)
,
getComponentPaintable(boolean, Color)
,
IlvFOUtil
public Element paintToFO(Document document, boolean wholeChart, Color bgColor)
The chart is unscaled, that is, every pixel gets mapped onto a length of 1/72 inch (approximately 0.35 mm).
Note: This method must only be invoked from the AWT-Event Thread.
document
- The XML document that the generated element will become a part of.wholeChart
- Pass true
to draw the chart; pass false
to draw the chart area.bgColor
- Background color, or null
to designate the default
background color, which may be dependent on Swing look-and-feel.paintToFOCurrentThread(org.w3c.dom.Document, boolean, java.awt.Color)
,
getComponentPaintable(boolean, Color)
,
IlvFOUtil
public Element paintToFOCurrentThread(Document document, boolean wholeChart, Color bgColor)
The chart is unscaled, that is, every pixel gets mapped onto a length of 1/72 inch (ca. 0.35 mm).
The operation is performed in the caller thread.
document
- The XML document that the generated element shall become part of.wholeChart
- true
to draw the chart, false
to draw
the chart area.bgColor
- Background color, or null
to designate the (possibly
Swing Look&Feel dependent) default background color.paintToFOCurrentThread(org.w3c.dom.Document, boolean, java.awt.Color)
,
getComponentPaintableCurrentThread(boolean, Color)
,
IlvFOUtil
public IlvFOUtil.ComponentPaintable getComponentPaintable(boolean wholeChart, Color bgColor)
IlvFOUtil.ComponentPaintable
that
can be used to convert this chart to a PDF via
XSL-FO.
Note: This method must only be invoked from the AWT-Event Thread.
The Paintable
object must be used and disposed in the current
thread.
wholeChart
- Pass true
to draw the chart; pass false
to draw the chart area.bgColor
- Background color, or null
to designate the default
background color, which may be dependent on Swing look-and-feel.IlvFOUtil.Paintable
.IlvFOUtil.paintToFOScaled(org.w3c.dom.Document,
ilog.views.util.print.IlvFOUtil.ComponentPaintable, double)
,
IlvFOUtil.paintToFOFitted(org.w3c.dom.Document,
ilog.views.util.print.IlvFOUtil.ComponentPaintable, int, int, int,
int)
public IlvFOUtil.ComponentPaintable getComponentPaintableCurrentThread(boolean wholeChart, Color bgColor)
IlvFOUtil.ComponentPaintable
that
can be used to convert this chart to a PDF via
XSL-FO.
Use this method in thin-client applications on the server side.
The Paintable
object must be used and disposed in the current
thread.
wholeChart
- Pass true
to draw the chart; pass false
to draw the chart area.bgColor
- Background color, or null
to designate the default
background color, which may be dependent on Swing look-and-feel.IlvFOUtil.Paintable
.IlvFOUtil.paintToFOScaled(org.w3c.dom.Document,
ilog.views.util.print.IlvFOUtil.ComponentPaintable, double)
,
IlvFOUtil.paintToFOFitted(org.w3c.dom.Document,
ilog.views.util.print.IlvFOUtil.ComponentPaintable, int, int, int,
int)
public URL getProject()
public void setProject(URL project) throws IOException, IlvStylingException
project
- The URL of the project file.IOException
- If an error occurs while reading the file.IlvStylingException
- If an exception occurs while loading or parsing the style sheet.public void dispose()
Note: After calling this function, this chart is no longer functional.
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.