|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--com.objectplanet.chart.Chart
This class is the abstract superclass of all charts.
Nested Class Summary |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
static int |
BELOW
Labels display below the chart grid. |
static int |
BELOW_AND_FLOATING
Labels display both below the grid and floating over a sample. |
static int |
BOTTOM
Bottom legend position. |
protected com.objectplanet.chart.ChartData |
chartData
This contains the chart data. |
static int |
FLOATING
Floating labels display when mouse is over a sample. |
static int |
HORIZONTAL
Horizontal bar alignment. |
static int |
INSIDE
Labels display inside each sample. |
static int |
LEFT
Left legend position. |
static int |
OUTSIDE
Labels display outside pie edge next to each sample. |
protected java.util.Vector |
overlayCharts
This contains any overlayed charts. |
static int |
RIGHT
Right legend position. |
static int |
STATIC
Used to create a static label |
static int |
TARGET_LINE_ID_AND_VALUE_LABEL
Use both the ID and value label with the target lines; setTargetValueLine(). |
static int |
TARGET_LINE_ID_LABEL
Use the ID label with the target lines; setTargetValueLine(). |
static int |
TARGET_LINE_NO_LABEL
Use no label with the target lines; setTargetValueLine(). |
static int |
TARGET_LINE_VALUE_LABEL
Use the value label with the target lines; setTargetValueLine(). |
static int |
TOP
Top legend position. |
static int |
VERTICAL
Vertical bar alignment. |
protected int[] |
visibleSamples
The start index and count of the currently visible samples. |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
Chart(int count)
Creates a chart with the given number of samples and no title. |
|
Chart(int seriesCount,
int sampleCount)
Creates a chart with the given number of samples and no title. |
Method Summary | |
void |
addImage(java.lang.String name,
java.awt.Image image)
Adds an image to the chart. |
void |
addItemListener(java.awt.event.ItemListener l)
Adds an item listener to the chart. |
int |
addOverlayChart(com.objectplanet.chart.Chart chart)
Adds a new overlay chart. |
int |
appendSample(int serie,
com.objectplanet.chart.ChartSample sample,
boolean makeSpace)
Appends a sample to the given series. |
int |
appendSampleLabel(java.lang.String label,
boolean makeSpace)
Appends a sample labels If makeSpace is set to false, and all the sample labels are filled up, they will be scrolled to the left, with the left most label deleted. |
int |
appendSampleValue(int serie,
double value,
boolean makeSpace)
Appends a value to the given series. |
void |
autoRepaint()
Calls repaint() if the automaticRepaintOn is turned on. |
protected abstract void |
calculateChartData(java.awt.Rectangle grid,
java.awt.Rectangle dataBounds)
Calculates the data used for the chart. |
protected void |
checkDataIntegrity()
This method is called each time the sample count or series count changes, and ensures that all the data has the right size. |
protected com.objectplanet.chart.ChartSample |
checkSelection(java.awt.Point point)
This method is called when the user releases the mouse and checks if the given point is inside a sample. |
java.awt.Image |
createImage(int width,
int height)
Creates an offscreen image. |
void |
forceRepaint()
Forces immidiate repaint of the chart. |
java.lang.String |
formatNumber(double value,
int decimals)
Formats a floating number to the number of decimals given. |
int |
get3DDepth()
Gets the depth of the 3D effect. |
java.awt.Color |
getChartBackground()
Gets the color of the chart background itself. |
com.objectplanet.chart.ChartData |
getChartData()
Gets the chart data for this chart. |
java.awt.Color |
getChartForeground()
Gets the color of the chart foreground itself. |
double |
getCurrentLowerRange(int adjuster)
Gets the current lower range of the specified range adjuster. |
double |
getCurrentRange(int adjuster)
Gets the current upper range of the specified range adjuster. |
java.awt.Rectangle |
getDataBounds(java.awt.Rectangle grid)
This method returns the bounding box for the data to be drawn in. |
java.awt.Font |
getFont(java.lang.String label)
Gets the font for the specified label. |
abstract java.awt.Rectangle |
getGraphBounds()
This method returns the bounding box for the chart grid. |
java.awt.Insets |
getGraphInsets()
Gets the graph insets. |
double |
getGridLine(int index)
Gets grid lines positon value by its index. |
java.awt.Color |
getGridLineColor(int index)
Gets grid line's color value by it's index. |
java.awt.Color[] |
getGridLineColors()
Gets the vertical grid lines colors. |
double[] |
getGridLines()
Gets the vertical grid lines positons. |
java.awt.Image |
getImage(int width,
int height)
Returns the current chart as an image. |
java.awt.Image |
getImage(java.lang.String name)
Gets the image with the specified name. |
java.lang.String |
getLabel(java.lang.String name)
Gets the specified label from the chart. |
int |
getLabelAngle(java.lang.String name)
Gets the angle of the specified label. |
int |
getLastSelectedSample()
Gets the index of the last selected sample. |
int |
getLastSelectedSeries()
Gets the index of the last selected series. |
java.awt.Color |
getLegendColor(int index)
Gets legend entry's color value by it's index. |
java.awt.Color[] |
getLegendColors()
Gets the legend colors. |
java.lang.String |
getLegendImage(int index)
Gets a legend entry's image name. |
java.lang.String[] |
getLegendLabels()
Gets the legend labels. |
int |
getLegendPosition()
Gets the legend position. |
double |
getLowerRange(int index)
Gets the lower value of the specified range. |
double |
getMaxValue(int serie)
Gets the largest value in the specified data series. |
int |
getMaxValueLineCount()
Gets the current maxium number of value lines set. |
java.awt.Dimension |
getMinimumSize()
This method returns the minimum size of the chart. |
double |
getMinValue(int serie)
Gets the smallest value in the specified data series. |
com.objectplanet.chart.Chart |
getOverlayChart(int index)
Gets the specified overlay chart. |
java.awt.Dimension |
getPreferredSize()
This method is called by the awt, and returns the preferred size of the chart. |
double |
getRange(int index)
Gets the upper value of the specified range. |
int |
getRangeAdjusted(int adjuster)
Gets the range(s) adjusted by the specified adjuster. |
int |
getRangeAdjusterPosition(int adjuster)
Gets the position of the range adjuster. |
java.awt.Color |
getRangeColor(int index)
Gets the color of the specified range. |
int |
getRangeDecimalCount(int index)
Gets the number of decimals used in the range values. |
int |
getRangePosition(int index)
Gets the range position. |
com.objectplanet.chart.ChartSample |
getSample(int serie,
int index)
Gets the specified sample. |
com.objectplanet.chart.ChartSample |
getSample(java.lang.Object key)
Gets the sample with the given key. |
java.awt.Color |
getSampleColor(int index)
Gets the color of the specified sample. |
java.awt.Color[] |
getSampleColors()
Gets the array of colors used for the samples. |
int |
getSampleCount()
Gets the number of samples. |
int |
getSampleDecimalCount(int serie)
Gets the number of decimals used for the sample values. |
java.lang.String |
getSampleLabel(int index)
Gets the specified sample label. |
java.awt.Color |
getSampleLabelColor(int index)
Gets the color of the label of the specified sample. |
java.lang.String[] |
getSampleLabels()
Gets the sample labels. |
java.awt.Color |
getSampleLabelSelectionColor()
Gets the color used for the sample labels when a sample is selected. |
int |
getSampleLabelStyle()
Gets the current style of the sample labels. |
com.objectplanet.chart.ChartSample[] |
getSamples(int serie)
Gets the samples for the specified serie. |
double |
getSampleValue(int serie,
int index)
Gets the specified sample value. |
double[] |
getSampleValues(int serie)
Gets the sample values for the specified serie. |
java.lang.Object[] |
getSelectedObjects()
Gets the currently selected objects. |
int |
getSeriesCount()
Gets the number of series. |
java.lang.String |
getSeriesLabel(int serie)
Gets the specified series label. |
java.awt.Color |
getSeriesLabelColor(int serie)
Gets the color of the label of the specified series. |
java.lang.String[] |
getSeriesLabels()
Gets the series labels. |
int |
getSeriesLabelStyle()
Gets the current style of the series labels. |
int |
getSeriesRange(int series)
Gets the range the specified series belongs to. |
java.awt.Dimension |
getSize()
Returns the size of the chart component. |
double |
getTargetValueLine(java.lang.String id)
Gets the value of a target value line. |
java.lang.String |
getThousandsDelimeter()
Gets the current thousands delimeter for use in the display of numbers. |
java.lang.String |
getTitle()
Gets the chart title. |
java.awt.Color |
getValueLinesColor()
Gets the color of the value lines. |
static java.lang.String |
getVersion()
Returns the current version of the charts. |
boolean |
is3DModeOn()
Checks if the 3D mode is turned on. |
boolean |
isAutomaticRepaintOn()
Checks if the automatic repaint is on. |
boolean |
isDefaultGridLinesOn()
Checks if the default vertical grid lines are on. |
boolean |
isFloatingOnLegendOn()
Checks if floating labels are displayed when the mouse moves over the legend. |
boolean |
isGridAdjustmentOn(int edge)
Checks if runtime grid adjustment is on. |
boolean |
isLegendOn()
Checks if the legend is turned on. |
boolean |
isOverlayChartOn(int index)
Checks if the specified overlay chart is on. |
boolean |
isPrintAsBitmap()
Checks if the chart will be printed as a bitmap. |
boolean |
isRangeAdjusterOn(int adjuster)
Checks if the specified range adjuster is turned on. |
boolean |
isRangeLabelsOn(int range)
Checks if the range labels are on or off for the specified range. |
boolean |
isRangeOn(int index)
Checks if the specified range is on. |
boolean |
isSampleLabelsOn()
Checks if the sample labels are turned on. |
boolean |
isSampleScrollerOn()
Checks if the sample scroller is turned on. |
boolean |
isSelected(int serie,
int sample)
Checks if a sample is selected. |
boolean |
isSeriesLabelsOn()
Checks if the floating series labels is turned on. |
boolean |
isServletModeOn()
Checks if the servlet mode is turned on. |
boolean |
isTitleOn()
Checks if the title is turned on. |
boolean |
isValueLabelsOn()
Checks if the value labels are turned on for any series. |
boolean |
isValueLabelsOn(int serie)
Checks if the value labels are turned on for a specified series. |
boolean |
isValueLinesOn()
Checks if the value lines are turned on. |
java.awt.Image |
loadImage(java.lang.String name)
Loads an image from the disk. |
static void |
main(java.lang.String[] argv)
Prints out the current version number. |
void |
paint(java.awt.Graphics g)
This method is overridden to paint the chart using double buffering. |
void |
print(java.awt.Graphics g)
Call this methods if you want to print the chart from a java program. |
protected void |
processEvent(java.awt.AWTEvent e)
Handles the chart events. |
void |
removeExternalGraphics()
Removes external graphics context if there is one. |
void |
removeItemListener(java.awt.event.ItemListener l)
Removes the specified item listener from the chart. |
void |
removeOverlayChart(int index)
Removes the specified overlay chart. |
protected abstract void |
render(java.awt.Graphics g)
This method is called by paint(), and has to be implemented by the subclass to render the chart. |
protected abstract void |
renderData(java.awt.Graphics g,
java.awt.Rectangle grid,
java.awt.Rectangle dataBounds)
This method renders the data (bars, lines, pies). |
void |
reset()
Resets the chart data and features. |
void |
run()
Internal do not call. |
void |
set3DDepth(int depth)
Sets the depth of the 3D effect in number of pixels. |
void |
set3DModeOn(boolean on)
Turns on or off 3D look of the chart. |
void |
setAutomaticRepaintOn(boolean state)
Turns on or off the automatic repaint. |
void |
setBackground(java.awt.Color color)
Sets the chart component background color, outside the chart grid. |
void |
setChartBackground(java.awt.Color color)
Sets the background color of the chart itself. |
void |
setChartData(com.objectplanet.chart.ChartData chartData)
Lets the chart use the specified chart data. |
void |
setChartForeground(java.awt.Color color)
Sets the foreground color of the chart itself. |
void |
setCurrentLowerRange(int adjuster,
double lower)
Sets the current lower range of the specified range adjuster. |
void |
setCurrentRange(int adjuster,
double upper)
Sets the current upper range of the specified range adjuster. |
void |
setDefaultGridLinesColor(java.awt.Color color)
Sets the color of the default vertical grid lines. |
void |
setDefaultGridLinesOn(boolean on)
Turns on or off the default vertical grid lines. |
void |
setDefaultGridLinesOn(boolean on,
double start,
double step)
Turns on or off the default vertical grid lines. |
void |
setExternalGraphics(java.awt.Graphics g,
java.awt.Image image)
Sets an external graphics context to paint with. |
void |
setFloatingOnLegendOn(boolean on)
Turn on or off floating labels when the mouse moves over the legend. |
void |
setFont(java.lang.String label,
java.awt.Font font)
Sets the font for the specified label. |
void |
setForeground(java.awt.Color color)
Sets the color of the labels. |
void |
setGraphInsets(int top,
int left,
int bottom,
int right)
Sets the insets between the graph itself and the chart component edges. |
void |
setGridAdjustmentOn(int edge,
boolean on)
Turns on or of runtime grid adjustment. |
void |
setGridLine(int index,
double value)
Sets a single grid line value. |
void |
setGridLineColor(int index,
java.awt.Color color)
Sets a single grid line color. |
void |
setGridLineColors(java.awt.Color[] colors)
Sets the color of each vertical grid line. |
void |
setGridLines(double[] grid)
Sets the vertical grid lines positons. |
void |
setGridLinesColor(java.awt.Color color)
Sets the vertical grid lines color. |
void |
setLabel(java.lang.String name,
java.lang.String label)
Sets the specified label in the chart. |
void |
setLabelAngle(java.lang.String name,
int angle)
Sets the angle of the specified label. |
static void |
setLabelAngleCacheSize(int count)
Sets the angled label cache size. |
void |
setLegendColor(int index,
java.awt.Color color)
Sets a legend entry color. |
void |
setLegendColors(java.awt.Color[] colors)
Sets the legend colors. |
void |
setLegendImage(int index,
java.lang.String name)
Sets an image to be used in front of the legend label. |
void |
setLegendLabels(java.lang.String[] labels)
Sets the legend labels. |
void |
setLegendOn(boolean on)
Turns on or off the label legend. |
void |
setLegendPosition(int position)
Sets the legend position. |
void |
setLowerRange(int index,
double range)
Sets the lower range of the chart. |
void |
setLowerRelativeRange(double range)
Sets the lower range of the chart relative to the current minimum value. |
void |
setLowerRelativeRange(double range,
double step)
Sets the lower range of the chart relative to the minimum value of the bars in the chart. |
void |
setLowerRelativeRange(int index,
double range,
double step)
Sets the lower range of the chart relative to the minimum value of the bars in the chart. |
void |
setMaxValueLineCount(int count)
Sets the maximum number of value lines there should be in the chart. |
void |
setOverlayChart(int index,
com.objectplanet.chart.Chart chart)
Sets the specified overlay chart. |
void |
setOverlayChartOn(int index,
boolean on)
Sets the specified overlay chart on or off. |
void |
setPreferredSize(int width,
int height)
Sets the preferred size of the chart. |
void |
setPrintAsBitmap(boolean on)
Turns on printing as bimap. |
void |
setRange(int index,
double range)
Sets the upper value of the specified range. |
void |
setRangeAdjusted(int adjuster,
int range)
Sets which range(s) to be adjusted by the specified adjuster. |
void |
setRangeAdjusterOn(int adjuster,
boolean on)
Turns on or off the range adjuster. |
void |
setRangeAdjusterPosition(int adjuster,
int position)
Sets the position of the range adjuster. |
void |
setRangeColor(int index,
java.awt.Color color)
Sets the color of the specified range. |
void |
setRangeDecimalCount(int index,
int count)
Sets the number of decimals to use in the range label values. |
void |
setRangeLabelsOn(int range,
boolean on)
Turns on or off the range value labels for the specified range. |
void |
setRangeOn(int index,
boolean on)
Turns on or off the specified range. |
void |
setRangePosition(int index,
int position)
Sets the range position. |
void |
setRelativeRange(double range)
Sets the upper range of the chart relative to the maximum value of the bars in the chart. |
void |
setRelativeRange(double range,
double step)
Sets the upper range of the chart relative to the maximum value of the bars in the chart. |
void |
setRelativeRange(int index,
double range,
double step)
Sets the upper range of the chart relative to the maximum value of the bars in the chart. |
void |
setSample(int serie,
int index,
com.objectplanet.chart.ChartSample sample)
Sets the specified sample. |
void |
setSampleAxisRange(double min,
double max)
Sets the left and the right range of the chart. |
void |
setSampleColor(int index,
java.awt.Color color)
Sets the color of the specified sample. |
void |
setSampleColors(java.awt.Color[] colors)
Sets the sample colors. |
void |
setSampleCount(int count)
Sets the number of samples. |
void |
setSampleDecimalCount(int serie,
int count)
Sets the number of decimals in the sample values. |
void |
setSampleLabel(int index,
java.lang.String label)
Sets the specified sample label. |
void |
setSampleLabelColor(int index,
java.awt.Color color)
Sets the color of of the label for the specified sample. |
void |
setSampleLabels(java.lang.String[] labels)
Sets the sample labels. |
void |
setSampleLabelSelectionColor(java.awt.Color color)
Sets the color used for the sample labels when a sample is selected. |
void |
setSampleLabelsOn(boolean on)
Turns on the sample labels on the x-axis. |
void |
setSampleLabelStyle(int style)
Sets the style of the sample labels. |
void |
setSamples(int serie,
com.objectplanet.chart.ChartSample[] samples)
Sets the samples for the specified series. |
void |
setSampleScrollerOn(boolean on)
Turns on or off the sample scroller. |
void |
setSampleValue(int serie,
int index,
double value)
Sets the specified sample value. |
void |
setSampleValues(int serie,
double[] values)
Sets the sample values for the specified series. |
void |
setSelection(int serie,
int sample,
boolean selected)
Marks a sample as selected or deselected. |
void |
setSelection(int serie,
int sample,
boolean selected,
boolean notify)
Marks a sample as selected or deselected. |
void |
setSeriesCount(int count)
Sets the number of series. |
void |
setSeriesLabel(int serie,
java.lang.String label)
Sets the specified series label. |
void |
setSeriesLabelColor(int serie,
java.awt.Color color)
Sets the color of of the label for the specified series. |
void |
setSeriesLabels(java.lang.String[] labels)
Sets the series labels. |
void |
setSeriesLabelsOn(boolean on)
Turns on the floating series labels. |
void |
setSeriesLabelStyle(int style)
Sets the style of the series labels. |
void |
setSeriesRange(int series,
int range)
Sets wich range the specified series should belong to. |
void |
setServletModeOn(boolean on)
Turns on or off servlet mode. |
void |
setTargetValueLine(java.lang.String id,
double value,
java.awt.Color color,
int style)
Sets a target value line with the specified ID, value, and color. |
void |
setThousandsDelimeter(java.lang.String delimiter)
Sets the delimeter for use in the display of numbers. |
void |
setTitle(java.lang.String title)
Sets the chart title. |
void |
setTitleOn(boolean on)
Turns on or off the chart title. |
void |
setValueLabelsOn(boolean on)
Turns on or off the value labels. |
void |
setValueLabelsOn(int serie,
boolean on)
Turns on or off the value labels for the specified series. |
void |
setValueLinesColor(java.awt.Color color)
Sets the color of the value lines in the chart. |
void |
setValueLinesOn(boolean on)
Turns on or off the chart value lines. |
void |
setVisibleSamples(int start,
int count)
Sets the visible samples in the chart. |
java.lang.String |
toString()
Returns the title of the chart. |
void |
update(java.awt.Graphics g)
This method is overridden to avoid flicker when the chart is repainted. |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle, validate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int BELOW
public static final int BELOW_AND_FLOATING
public static final int BOTTOM
protected com.objectplanet.chart.ChartData chartData
public static final int FLOATING
public static final int HORIZONTAL
public static final int INSIDE
public static final int LEFT
public static final int OUTSIDE
protected java.util.Vector overlayCharts
public static final int RIGHT
public static final int STATIC
public static final int TARGET_LINE_ID_AND_VALUE_LABEL
public static final int TARGET_LINE_ID_LABEL
public static final int TARGET_LINE_NO_LABEL
public static final int TARGET_LINE_VALUE_LABEL
public static final int TOP
public static final int VERTICAL
protected int[] visibleSamples
Constructor Detail |
public Chart(int count)
public Chart(int seriesCount, int sampleCount)
seriesCount
- The number of series for the chart.sampleCount
- The number of samples for the chart.Method Detail |
public void addImage(java.lang.String name, java.awt.Image image)
name
- The unique name of the imageimage
- The image to add, use null to remove the image.public void addItemListener(java.awt.event.ItemListener l)
addItemListener
in interface java.awt.ItemSelectable
l
- The item listener to add.removeItemListener(java.awt.event.ItemListener)
public int addOverlayChart(com.objectplanet.chart.Chart chart)
chart
- The chart to be layed over this one.
public int appendSample(int serie, com.objectplanet.chart.ChartSample sample, boolean makeSpace)
If the makeSpace parameter is set to false, all the current samples will shift to the left, and the new sample will be added at the end.
If the makeSpace parameter is set to true, the sample count will be increased by one, and the sample will be added at the end.
The sample labels are also moved to the left with the samples.
serie
- The series to append the sample to.sample
- The sample to append.makeSpace
- True to make space for the new parameter.
java.lang.IllegalArgumentException
- If the serie is invalid.public int appendSampleLabel(java.lang.String label, boolean makeSpace)
label
- The label to append.makeSpace
- True to make space for the new parameter.
public int appendSampleValue(int serie, double value, boolean makeSpace)
If the makeSpace parameter is set to false, all the current values will shift one sample to the left (the sample itself will not move, only the value) and the new value will be set in the last sample.
If the makeSpace parameter is set to true, the sample count will be increased by one, and a new sample will be added at the end.
serie
- The series to append the sample to.value
- The value to append.makeSpace
- True to make space for the new parameter.
java.lang.IllegalArgumentException
- If the serie is invalid.public void autoRepaint()
protected abstract void calculateChartData(java.awt.Rectangle grid, java.awt.Rectangle dataBounds)
grid
- The chart grid bounds to paint data within.dataBounds
- The scrolled bounds to calculate the data within.protected void checkDataIntegrity()
protected com.objectplanet.chart.ChartSample checkSelection(java.awt.Point point)
point
- The point to check for.
public java.awt.Image createImage(int width, int height)
createImage
in class java.awt.Component
width
- The width of the image in pixels.height
- The height of the image in pixels.public void forceRepaint()
public java.lang.String formatNumber(double value, int decimals)
value
- The value to format.decimals
- The number of decimals to use.
public int get3DDepth()
set3DDepth(int)
public java.awt.Color getChartBackground()
public com.objectplanet.chart.ChartData getChartData()
public java.awt.Color getChartForeground()
public double getCurrentLowerRange(int adjuster)
adjuster
- The index of the range adjuster (0 or 1).setCurrentLowerRange(int, double)
public double getCurrentRange(int adjuster)
adjuster
- The index of the range adjuster (0 or 1).setCurrentRange(int, double)
public java.awt.Rectangle getDataBounds(java.awt.Rectangle grid)
grid
- The bounds of the chart grid.
java.lang.IllegalArgumentException
- if the grid is null.public java.awt.Font getFont(java.lang.String label)
label
- The name of the label.
public abstract java.awt.Rectangle getGraphBounds()
public java.awt.Insets getGraphInsets()
setGraphInsets(int, int, int, int)
public double getGridLine(int index)
index
- The index of the line to get value from.
public java.awt.Color getGridLineColor(int index)
index
- The index of the line to get color from.
public java.awt.Color[] getGridLineColors()
public double[] getGridLines()
public java.awt.Image getImage(int width, int height)
width
- The width of the chart in pixels.height
- The height of the chart in pixels.
public java.awt.Image getImage(java.lang.String name)
name
- The name of the image.
public java.lang.String getLabel(java.lang.String name)
name
- The name of the label.
setLabel(java.lang.String, java.lang.String)
public int getLabelAngle(java.lang.String name)
name
- The name of the label.
setLabel(java.lang.String, java.lang.String)
public int getLastSelectedSample()
public int getLastSelectedSeries()
public java.awt.Color getLegendColor(int index)
index
- The index of the legend entry to get color from.
public java.awt.Color[] getLegendColors()
public java.lang.String getLegendImage(int index)
index
- The index of the legend entry.
public java.lang.String[] getLegendLabels()
setLegendLabels(java.lang.String[])
public int getLegendPosition()
public double getLowerRange(int index)
index
- The index of the range.public double getMaxValue(int serie)
serie
- The index of the serie (0-based).public int getMaxValueLineCount()
setMaxValueLineCount(int)
public java.awt.Dimension getMinimumSize()
getMinimumSize
in class java.awt.Component
public double getMinValue(int serie)
serie
- The index of the serie (0-based).public com.objectplanet.chart.Chart getOverlayChart(int index)
index
- The index of the overlay chart.
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class java.awt.Component
public double getRange(int index)
index
- The index of the range (0 or 1).public int getRangeAdjusted(int adjuster)
adjuster
- The index of the adjuster (0 or 1).
public int getRangeAdjusterPosition(int adjuster)
adjuster
- The index of the adjuster (0 or 1).
public java.awt.Color getRangeColor(int index)
index
- The index of the range (0 or 1).public int getRangeDecimalCount(int index)
index
- The index of the range (0 or 1).public int getRangePosition(int index)
index
- The index of the range (0 or 1).
public com.objectplanet.chart.ChartSample getSample(int serie, int index)
serie
- The index of the serie (0-based).index
- The index of the sample (0-based).
java.lang.IllegalArgumentException
- if the serie or index is invalid.public com.objectplanet.chart.ChartSample getSample(java.lang.Object key)
key
- The key of the sample to get.
public java.awt.Color getSampleColor(int index)
index
- The index of the sample.public java.awt.Color[] getSampleColors()
public int getSampleCount()
public int getSampleDecimalCount(int serie)
serie
- The index of the serie.public java.lang.String getSampleLabel(int index)
index
- The index of the sample (0-based).
java.lang.IllegalArgumentException
- if the index is invalid.public java.awt.Color getSampleLabelColor(int index)
index
- The index of the sample (0-based).
public java.lang.String[] getSampleLabels()
public java.awt.Color getSampleLabelSelectionColor()
public int getSampleLabelStyle()
public com.objectplanet.chart.ChartSample[] getSamples(int serie)
serie
- The index of the serie (0-based).
java.lang.IllegalArgumentException
- if the serie is invalid.public double getSampleValue(int serie, int index)
serie
- The index of the serie (0-based).index
- The index of the sample (0-based).
java.lang.IllegalArgumentException
- if the serie or index is invalid.public double[] getSampleValues(int serie)
serie
- The index of the serie (0-based).
java.lang.IllegalArgumentException
- if the serie is invalid.public java.lang.Object[] getSelectedObjects()
getSelectedObjects
in interface java.awt.ItemSelectable
public int getSeriesCount()
public java.lang.String getSeriesLabel(int serie)
serie
- The index of the serie (0-based).
java.lang.IllegalArgumentException
- if the index is invalid.public java.awt.Color getSeriesLabelColor(int serie)
serie
- The index of the series (0-based).
java.lang.IllegalArgumentException
- if the series index is invalid.public java.lang.String[] getSeriesLabels()
public int getSeriesLabelStyle()
public int getSeriesRange(int series)
series
- The index of the series.
public java.awt.Dimension getSize()
getSize
in class java.awt.Component
public double getTargetValueLine(java.lang.String id)
id
- The id of the target line.
public java.lang.String getThousandsDelimeter()
public java.lang.String getTitle()
setTitle(java.lang.String)
public java.awt.Color getValueLinesColor()
public static java.lang.String getVersion()
public boolean is3DModeOn()
public boolean isAutomaticRepaintOn()
setAutomaticRepaintOn(boolean)
public boolean isDefaultGridLinesOn()
public boolean isFloatingOnLegendOn()
setFloatingOnLegendOn(boolean)
public boolean isGridAdjustmentOn(int edge)
edge
- TOP, LEFT, BOTTOM, or RIGHT.
public boolean isLegendOn()
public boolean isOverlayChartOn(int index)
index
- The index of the overlay chart.
public boolean isPrintAsBitmap()
public boolean isRangeAdjusterOn(int adjuster)
adjuster
- The index of the adjuster (0 or 1)
public boolean isRangeLabelsOn(int range)
range
- The index of the range to check for.
public boolean isRangeOn(int index)
index
- The index of the range (0 or 1).
public boolean isSampleLabelsOn()
public boolean isSampleScrollerOn()
public boolean isSelected(int serie, int sample)
serie
- The series index (-1 is whole series).sample
- The sample index (-1 is all samples in series).
java.lang.IllegalArgumentException
- If the serie or sample is invalid.public boolean isSeriesLabelsOn()
public boolean isServletModeOn()
setServletModeOn(boolean)
public boolean isTitleOn()
public boolean isValueLabelsOn()
public boolean isValueLabelsOn(int serie)
serie
- The serie to check for.
public boolean isValueLinesOn()
public java.awt.Image loadImage(java.lang.String name)
name
- The file name of the image.
public static void main(java.lang.String[] argv)
public final void paint(java.awt.Graphics g)
paint
in class java.awt.Component
render(java.awt.Graphics)
public final void print(java.awt.Graphics g)
print
in class java.awt.Component
protected void processEvent(java.awt.AWTEvent e)
processEvent
in class java.awt.Component
public void removeExternalGraphics()
setExternalGraphics(java.awt.Graphics, java.awt.Image)
public void removeItemListener(java.awt.event.ItemListener l)
removeItemListener
in interface java.awt.ItemSelectable
l
- The item listener to remove.addItemListener(java.awt.event.ItemListener)
public void removeOverlayChart(int index)
index
- The index of the chart to be removed.
java.lang.IllegalArgumentException
- If the index is invalid.protected abstract void render(java.awt.Graphics g)
g
- The graphics context used to paint with.paint(java.awt.Graphics)
protected abstract void renderData(java.awt.Graphics g, java.awt.Rectangle grid, java.awt.Rectangle dataBounds)
g
- The graphics context used to paint with.grid
- The chart grid bounds to paint data within.dataBounds
- The scrolled bounds to calculate the data within.public void reset()
public void run()
run
in interface java.lang.Runnable
public void set3DDepth(int depth)
depth
- The number of pixels, -1 for default (variable) depth.public void set3DModeOn(boolean on)
on
- True for 3D, false for 2D look.public void setAutomaticRepaintOn(boolean state)
state
- True for on, false for off.public void setBackground(java.awt.Color color)
setBackground
in class java.awt.Component
color
- The color to use.setChartBackground(java.awt.Color)
public void setChartBackground(java.awt.Color color)
color
- The color to use.public void setChartData(com.objectplanet.chart.ChartData chartData)
chartData
- The chart data to use for the chart.public void setChartForeground(java.awt.Color color)
color
- The color to use.public void setCurrentLowerRange(int adjuster, double lower)
adjuster
- The index of the range adjuster (0 or 1).lower
- The range to use, larger or equal to the lower range.public void setCurrentRange(int adjuster, double upper)
adjuster
- The index of the adjuster (0 or 1)upper
- The range to use, less or equal to the full range.public void setDefaultGridLinesColor(java.awt.Color color)
color
- The color to set for default grid lines.public void setDefaultGridLinesOn(boolean on)
on
- True for on, false for off.setGridLines(double[])
public void setDefaultGridLinesOn(boolean on, double start, double step)
on
- True for on, false for off.start
- Position of the first line.step
- Distance between lines.setGridLines(double[])
public void setExternalGraphics(java.awt.Graphics g, java.awt.Image image)
g
- The graphics context used for painting.image
- The image to which graphics context belongs.
See here for an example.public void setFloatingOnLegendOn(boolean on)
on
- True for on, false for off.public void setFont(java.lang.String label, java.awt.Font font)
label
- "titleFont" or "legendFont".font
- The font to set for the label.public void setForeground(java.awt.Color color)
setForeground
in class java.awt.Component
color
- The color to use.setChartBackground(java.awt.Color)
public void setGraphInsets(int top, int left, int bottom, int right)
top
- The top insets in pixels.left
- The left insets in pixels.bottom
- The bottom insets in pixels.right
- The right insets in pixels.public void setGridAdjustmentOn(int edge, boolean on)
edge
- TOP,LEFT,BOTTOM, or RIGHT.on
- True or on, false for off.public void setGridLine(int index, double value)
index
- The index of the line to set value for.value
- The value to set.
java.lang.IllegalArgumentException
- if the index is invalid.public void setGridLineColor(int index, java.awt.Color color)
index
- The index of the line to set Color for.color
- The color to set for the grid line.
java.lang.IllegalArgumentException
- if the index is invalid.public void setGridLineColors(java.awt.Color[] colors)
colors
- The array with grid lines colors.public void setGridLines(double[] grid)
grid
- The array with grid lines position values.setSampleAxisRange(double, double)
public void setGridLinesColor(java.awt.Color color)
color
- The color to set for all lines.public void setLabel(java.lang.String name, java.lang.String label)
name
- The name of the label.label
- The label to use, null for no label.public void setLabelAngle(java.lang.String name, int angle)
name
- The name of the label.angle
- The angle to use for the label.public static void setLabelAngleCacheSize(int count)
count
- The image cache count, less than 0 to turn it off.public void setLegendColor(int index, java.awt.Color color)
index
- The index of the legend entry to set Color for.color
- The color to set for the legend entry.setLegendColors(java.awt.Color[])
,
setLegendImage(int, java.lang.String)
public void setLegendColors(java.awt.Color[] colors)
colors
- The array with legend colors.
java.lang.IllegalArgumentException
- if the colors is null.setLegendColor(int, java.awt.Color)
,
setLegendImage(int, java.lang.String)
public void setLegendImage(int index, java.lang.String name)
index
- The index of the legend entry to set the image for.name
- The image to use, null for the default legend box.addImage(java.lang.String, java.awt.Image)
public void setLegendLabels(java.lang.String[] labels)
labels
- The labels to use, null for default behavior.public void setLegendOn(boolean on)
on
- True if the legend should be displayed.setLegendPosition(int)
public void setLegendPosition(int position)
position
- TOP, BOTTOM, LEFT, or RIGHT.
java.lang.IllegalArgumentException
- If the position is invalid.public void setLowerRange(int index, double range)
index
- The index of the range to set (0 or 1).range
- The range to set.setRange(int, double)
public void setLowerRelativeRange(double range)
range
- The relative range;setLowerRelativeRange(double)
public void setLowerRelativeRange(double range, double step)
range
- The relative range (0.0->);step
- The range will be divisible by this value.setLowerRelativeRange(double)
public void setLowerRelativeRange(int index, double range, double step)
index
- The index of the range (0 or 1).range
- The relative range (0.0->);step
- The range will be divisible by this value.setLowerRelativeRange(double)
public void setMaxValueLineCount(int count)
count
- The value line count.public void setOverlayChart(int index, com.objectplanet.chart.Chart chart)
index
- The index of the overlay chart.chart
- The chart to set for this overlay position.
java.lang.IllegalArgumentException
- If the index is invalid.public void setOverlayChartOn(int index, boolean on)
index
- The index of the overlay chart.on
- True for on, false for off (on by default).public void setPreferredSize(int width, int height)
width
- The preferred width.height
- The preferred height.public void setPrintAsBitmap(boolean on)
on
- True for on, false for off.public void setRange(int index, double range)
index
- The index of the range to set (0 or 1).range
- The range to set.setLowerRange(int, double)
public void setRangeAdjusted(int adjuster, int range)
adjuster
- The index of the adjuster (0 or 1).range
- 0 = range 0, 1 = range 1, 2 = both ranges.public void setRangeAdjusterOn(int adjuster, boolean on)
adjuster
- The index of the adjuster (0 or 1)on
- True for on, false for off.public void setRangeAdjusterPosition(int adjuster, int position)
adjuster
- The index of the adjuster (0 or 1).position
- 0 for left, 1 for right (default is right).public void setRangeColor(int index, java.awt.Color color)
index
- The index of the range (0 or 1).color
- The color to use for the range.public void setRangeDecimalCount(int index, int count)
index
- The index of the range (0 or 1).count
- The number of decimals to use.public void setRangeLabelsOn(int range, boolean on)
range
- The index of the range.on
- True for on, false for off.public void setRangeOn(int index, boolean on)
index
- The index of the range (0 or 1).on
- True for on, false of off.public void setRangePosition(int index, int position)
index
- The index of the range (0 or 1).position
- 0 for left, 1 for rightpublic void setRelativeRange(double range)
range
- The relative range (0.0->);setRelativeRange(double, double)
public void setRelativeRange(double range, double step)
range
- The relative range (0.0->);step
- The range will be divisible by this value.setRelativeRange(double)
public void setRelativeRange(int index, double range, double step)
index
- The index of the range to set (0 or 1).range
- The relative range (0.0->);step
- The range will be divisible by this value.setRelativeRange(double)
public void setSample(int serie, int index, com.objectplanet.chart.ChartSample sample)
serie
- The index of the serie (0-based).index
- The index of the sample (0-based).sample
- The sample to use.
java.lang.IllegalArgumentException
- if the serie or index is invalid.public void setSampleAxisRange(double min, double max)
min
- The left rangemax
- The right range
java.lang.IllegalArgumentException
- if min more or equal than max.public void setSampleColor(int index, java.awt.Color color)
index
- The index of the sample (0-based).color
- The color to be used for the sample.public void setSampleColors(java.awt.Color[] colors)
colors
- An array with the colors to be used, null for default colors.public void setSampleCount(int count)
count
- The number of samples.public void setSampleDecimalCount(int serie, int count)
serie
- The index of the series (-1 for all).count
- The number of decimals to use.public void setSampleLabel(int index, java.lang.String label)
index
- The index of the sample (0-based).label
- The label of the sample.
java.lang.IllegalArgumentException
- if the index is invalid.public void setSampleLabelColor(int index, java.awt.Color color)
index
- The index of the sample (0-based).color
- The color to use, null for the default color.
java.lang.IllegalArgumentException
- if the sample index is invalid.public void setSampleLabels(java.lang.String[] labels)
labels
- The labels to use.public void setSampleLabelSelectionColor(java.awt.Color color)
color
- The color to use, or null for no color.public void setSampleLabelsOn(boolean on)
on
- True for on, false for off.public void setSampleLabelStyle(int style)
style
- BELOW, FLOATING, BELOW_AND_FLOATING, OUTSIDE.public void setSamples(int serie, com.objectplanet.chart.ChartSample[] samples)
serie
- The index of the serie (0-based).samples
- The samples to set.
java.lang.IllegalArgumentException
- if the serie is invalid.public void setSampleScrollerOn(boolean on)
on
- True for on, false for off.public void setSampleValue(int serie, int index, double value)
serie
- The index of the serie (0-based).index
- The index of the sample (0-based).value
- The value to use for the sample.
java.lang.IllegalArgumentException
- if the serie or index is invalid.public void setSampleValues(int serie, double[] values)
serie
- The index of the serie (0-based).values
- The values to use for the series.
java.lang.IllegalArgumentException
- if the serie is invalid.public void setSelection(int serie, int sample, boolean selected)
serie
- The series index.sample
- The sample index.selected
- True for selected, false for deselected.
java.lang.IllegalArgumentException
- If the serie or sample is invalid.public void setSelection(int serie, int sample, boolean selected, boolean notify)
serie
- The series index.sample
- The sample index.selected
- True for selected, false for deselected.notify
- True if listeners should be notified, false otherwise.
java.lang.IllegalArgumentException
- If the serie or sample is invalid.public void setSeriesCount(int count)
count
- The number of series.public void setSeriesLabel(int serie, java.lang.String label)
serie
- The index of the serie (0-based).label
- The label of the sample.
java.lang.IllegalArgumentException
- if the index is invalid.public void setSeriesLabelColor(int serie, java.awt.Color color)
serie
- The index of the serie (0-based).color
- The color to use, null for the default color.
java.lang.IllegalArgumentException
- if the series index is invalid.public void setSeriesLabels(java.lang.String[] labels)
labels
- The labels to use.public void setSeriesLabelsOn(boolean on)
on
- True for on, false for off.public void setSeriesLabelStyle(int style)
style
- FLOATING, INSIDE, OUTSIDE.public void setSeriesRange(int series, int range)
series
- The index of the series.range
- The index of the range (0 or 1).public void setServletModeOn(boolean on)
on
- True for servlet mode on, false for
servlet mode off.public void setTargetValueLine(java.lang.String id, double value, java.awt.Color color, int style)
id
- The id of the target line.value
- The value where the line should appear.color
- The color of the line, if null, the line is removed.style
- TARGET_LINE_NO_LABEL, TARGET_LINE_ID_LABEL,
TARGET_LINE_VALUE_LABEL, or TARGET_LINE_ID_AND_VALUE_LABEL.
java.lang.IllegalArgumentException
- if the style is invalid.public void setThousandsDelimeter(java.lang.String delimiter)
delimiter
- The delimiter to set, use null for default.public void setTitle(java.lang.String title)
title
- The title to set.getTitle()
,
setTitleOn(boolean)
public void setTitleOn(boolean on)
on
- True for on, false for off.setTitle(java.lang.String)
public void setValueLabelsOn(boolean on)
on
- True for on, false for off.setSampleValue(int, int, double)
,
setSampleValues(int, double[])
public void setValueLabelsOn(int serie, boolean on)
serie
- The index of the serie (-1) for all.on
- True for on, false for off.setSampleValue(int, int, double)
,
setSampleValues(int, double[])
public void setValueLinesColor(java.awt.Color color)
color
- The color to use.public void setValueLinesOn(boolean on)
on
- True for on, false for off.setMaxValueLineCount(int)
public void setVisibleSamples(int start, int count)
start
- The index of the start sample.count
- The number of samples to be displayed, -1 for all after start.public java.lang.String toString()
toString
in class java.awt.Component
public final void update(java.awt.Graphics g)
update
in class java.awt.Component
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |