|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent com.objectplanet.chart.GenericChart com.objectplanet.chart.Chart
public abstract class Chart
This class is the abstract superclass of all charts.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces 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 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. |
static int |
POINTING
Lines point to the corresponding slices. |
static int |
RIGHT
Right legend position. |
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 com.objectplanet.chart.GenericChart |
---|
chartType, DEFAULT_SAMPLE_COLORS, depth3dPoint, display3dOn, displayVersionOn, dragged_label, grid, gridRenderer, legend, legendRenderer, legendSelection, needChartCalculation, needGraphBounds, needRender, new_cursor, old_cursor, overlayCharts, renderer |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
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()
|
|
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 |
addItemListener(java.awt.event.ItemListener l)
Adds an item listener to the chart. |
int |
appendSample(int serie,
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. |
protected void |
calculateChartData(java.awt.Rectangle gridBounds,
java.awt.Rectangle dataBounds)
Calculates the position and size of each bar in 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 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. |
protected java.lang.String |
constructLabel(int series,
int sample,
int style,
boolean paintSeriesOn,
java.lang.String percentLabel)
Constructs the combination of labels. |
void |
displayFloatingLabel(int serie,
int sample)
Displays the floating labels for the specified series and/or sample. |
java.lang.String |
formatRangeNumber(int index,
double value)
Formats a floating number to the number of decimals given for the specified range. |
java.lang.String |
formatSeriesNumber(int index,
double value)
Formats a floating number to the number of decimals given for the specified series. |
int |
get3DDepth()
Gets the depth of the 3D effect. |
static java.util.Hashtable |
getAngledLabelCache()
Getter for the angledLabelCache where the angled labels are stored. |
ChartData |
getChartData()
Gets the chart data for this chart. |
double |
getCurrentLowerRange(int range)
Gets the current lower range of the specified range. |
double |
getCurrentRange(int range)
Gets the current upper range of the specified range. |
java.awt.Rectangle |
getDataBounds(java.awt.Rectangle gridBounds)
This method returns the bounding box for the data to be drawn in. |
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. |
protected double |
getHighestValue(int rangeIndex)
Gets the highest value in the chart larger than 0. |
java.awt.Dimension |
getLabelSize(java.lang.String label,
java.awt.FontMetrics fm)
Calculates the size of a multiline 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.lang.String[] |
getLegendLabels()
Gets the legend labels. |
double |
getLowerRange(int index)
Gets the lower value of the specified range. |
protected double |
getLowestValue(int rangeIndex)
Gets the lowest value in the chart. |
double |
getMaxValue(int serie)
Gets the largest value in the specified data series. |
int |
getMaxValueLineCount()
Gets the current maxium number of value lines set. |
double |
getMinValue(int serie)
Gets the smallest value in the specified data series. |
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()
Gets the position of the first range adjuster. |
java.awt.Color |
getRangeColor(int index)
Gets the color of the specified range. |
int |
getRangeCount()
|
int |
getRangeDecimalCount(int index)
Gets the number of decimals used in the range values. |
java.text.NumberFormat |
getRangeFormatter(int index)
Get the number formatter of this range. |
double |
getRangeInterval(int range)
Gets the interval between the ticks on the specified range. |
int |
getRangePosition(int index)
Gets the range position. |
ChartSample |
getSample(int serie,
int index)
Gets the specified sample. |
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 |
getSampleColor2(int index)
Gets the color of the specified sample. |
java.awt.Color[] |
getSampleColors()
Gets the array of colors used for the samples. |
java.awt.Color[] |
getSampleColors2()
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. |
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.text.NumberFormat |
getSeriesFormatter(int index)
Get the number formatter of this 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. |
static java.lang.String[] |
getStringValues(java.lang.String string,
java.lang.String delimiter)
Conterts a separated string to an array of string. |
int |
getTargetLabelsPosition()
Gets the target labels position |
double |
getTargetValueLine(java.lang.String id)
Gets the value of a target value line. |
java.awt.Color |
getValueLabelColor(int serie)
Gets the color of the value labels of the specified series. |
int |
getValueLabelStyle()
Gets the value label style. |
java.awt.Color |
getValueLinesColor()
Gets the color of the value lines. |
int[] |
getVisibleSamples()
Gets the visible samples in the chart. |
boolean |
hasDataChangedSince(long time)
Checks if the data has been changed since the specified time. |
static int |
hashCode(java.lang.String s)
Returns a hashcode for the specified string. |
boolean |
isDefaultGridLinesOn()
Checks if the default vertical grid lines are on. |
boolean |
isGridAdjustmentOn(int edge)
Checks if runtime grid adjustment is on. |
boolean |
isLegendBoxSizeAsFont()
Check if the legend box size should be the same as the legend font size. |
boolean |
isRangeAdjusterOn(int adjuster)
Checks if the specified range adjuster is turned on. |
boolean |
isRangeLabelsOn(int index)
Checks if the range labels are on or off. |
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 |
isSeriesEmpty(int index)
Checks if the series contains any data. |
boolean |
isSeriesLabelsOn()
Checks if the floating series labels 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. |
static void |
main(java.lang.String[] argv)
Prints out the current version number. |
protected void |
paintGrid(java.awt.Graphics g,
java.awt.Rectangle gridBounds)
Paints the chart grid. |
protected void |
processEvent(java.awt.AWTEvent event)
Handles the chart events. |
void |
removeItemListener(java.awt.event.ItemListener l)
Removes the specified item listener from the chart. |
protected void |
renderData(java.awt.Graphics g,
java.awt.Rectangle gridBounds,
java.awt.Rectangle dataBounds)
Renders the bars and the value labels. |
void |
reset()
Resets the chart data and features. |
void |
set3DDepth(int depth)
Sets the depth of the 3D effect in number of pixels. |
void |
setChartData(ChartData chartData)
Lets the chart use the specified chart data. |
void |
setCurrentLowerRange(int range,
double lower)
Sets the current lower range of the specified range. |
void |
setCurrentRange(int range,
double upper)
Sets the current upper range of the specified range. |
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 |
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[] lines)
Sets the vertical grid lines positons. |
void |
setGridLinesColor(java.awt.Color color)
Sets the vertical grid lines color. |
void |
setLegendBoxSizeAsFont(boolean on)
If set to true the legend box size is set to the same size as the legend font. |
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 |
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 position)
Sets the position of the first 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 |
setRangeFormatter(int index,
java.text.NumberFormat formatter)
Sets a number formatter for the specific range. |
void |
setRangeInterval(int range,
double interval)
Sets interval between the ticks on the specified range. |
void |
setRangeLabelsOn(int index,
boolean on)
Turns on or off the range value labels for 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,
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 |
setSampleColor2(int index,
java.awt.Color color)
Sets the color of the specified sample. |
void |
setSampleColors(java.awt.Color[] colors)
Sets the sample colors. |
void |
setSampleColors2(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. |
void |
setSampleLabelStyle(int style)
Sets the style of the sample labels. |
void |
setSamples(int serie,
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 |
setSelection(int serie,
int sample,
boolean selected,
boolean clear,
boolean notify)
Marks a sample as selected or deselected. |
void |
setSeriesCount(int count)
Sets the number of series. |
void |
setSeriesFormatter(int index,
java.text.NumberFormat formatter)
Sets a number formatter for the specific 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 |
setTargetLabelsPosition(int position)
Sets the target labels position. |
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 |
setTargetValueLine(java.lang.String id,
double value,
java.awt.Color color,
int style,
int range)
Sets a target value line with the specified ID, value, and color. |
void |
setValueLabelColor(int serie,
java.awt.Color color)
Sets the color of the value labels for the specified series. |
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 |
setValueLabelStyle(int style)
Sets the style of the value labels. |
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. |
void |
setVisibleSamples(int start,
int count,
boolean adjustScrollers)
Sets the visible samples in the chart. |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, 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, updateUI |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, 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, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusUpCycle |
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 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
public static final int POINTING
public static final int RIGHT
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()
public Chart(int count)
count
- The number of samples for the chart.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 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 appendSample(int serie, 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.protected void calculateChartData(java.awt.Rectangle gridBounds, java.awt.Rectangle dataBounds)
gridBounds
- The chart grid bounds.dataBounds
- The data bounds.protected void checkDataIntegrity()
checkDataIntegrity
in class GenericChart
protected ChartSample checkSelection(java.awt.Point point)
point
- The point to check for.
protected java.lang.String constructLabel(int series, int sample, int style, boolean paintSeriesOn, java.lang.String percentLabel)
constructLabel
in class GenericChart
series
- The series index.sample
- The sample index.style
- The style of the label: INSIDE, OUTSIDE, FLOATING or POINTING.paintSeriesOn
- True if the series label should be on.percentLabel
- A percent label for pie chart.
public void displayFloatingLabel(int serie, int sample)
serie
- The series index, -1 for no floating labels.sample
- The sample index, -1 for all the samples in a serie.public java.lang.String formatRangeNumber(int index, double value)
index
- The range index.value
- The value to format.
public java.lang.String formatSeriesNumber(int index, double value)
index
- The series index.value
- The value to format.
public int get3DDepth()
set3DDepth(int)
public static java.util.Hashtable getAngledLabelCache()
public ChartData getChartData()
public double getCurrentLowerRange(int range)
range
- The index of the range.setCurrentLowerRange(int, double)
public double getCurrentRange(int range)
range
- The index of the rangesetCurrentRange(int, double)
public java.awt.Rectangle getDataBounds(java.awt.Rectangle gridBounds)
gridBounds
- The bounds of the chart grid.
java.lang.IllegalArgumentException
- if the grid is null.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()
protected double getHighestValue(int rangeIndex)
getHighestValue
in class GenericChart
rangeIndex
- The index of the range (0 or 1).
public java.awt.Dimension getLabelSize(java.lang.String label, java.awt.FontMetrics fm)
label
- The label to check the size of.fm
- The font metrics used to measure labels with.
public int getLastSelectedSample()
public int getLastSelectedSeries()
public java.awt.Color getLegendColor(int index)
getLegendColor
in class GenericChart
index
- The index of the legend entry to get color from.
public java.lang.String[] getLegendLabels()
getLegendLabels
in class GenericChart
GenericChart.setLegendLabels(java.lang.String[])
public double getLowerRange(int index)
index
- The index of the range.protected double getLowestValue(int rangeIndex)
getLowestValue
in class GenericChart
rangeIndex
- The index of the range (0 or 1)public double getMaxValue(int serie)
serie
- The index of the serie (0-based).public int getMaxValueLineCount()
setMaxValueLineCount(int)
public double getMinValue(int serie)
serie
- The index of the serie (0-based).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.
public int getRangeAdjusterPosition()
public java.awt.Color getRangeColor(int index)
index
- The index of the range (0 or 1).public int getRangeCount()
public int getRangeDecimalCount(int index)
index
- The index of the range (0 or 1).public java.text.NumberFormat getRangeFormatter(int index)
index
- The index of the range.
public double getRangeInterval(int range)
range
- The index of the range.
public int getRangePosition(int index)
index
- The index of the range (0 or 1).
public 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 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 getSampleColor2(int index)
index
- The index of the sample.public java.awt.Color[] getSampleColors()
public java.awt.Color[] getSampleColors2()
public int getSampleCount()
getSampleCount
in class GenericChart
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 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()
getSeriesCount
in class GenericChart
public java.text.NumberFormat getSeriesFormatter(int index)
index
- The index of the series.
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 static java.lang.String[] getStringValues(java.lang.String string, java.lang.String delimiter)
string
- The delimited string.delimiter
- The delimiter.
public int getTargetLabelsPosition()
public double getTargetValueLine(java.lang.String id)
id
- The id of the target line.
public java.awt.Color getValueLabelColor(int serie)
serie
- The index of the series (0-based).
java.lang.IllegalArgumentException
- if the series index is invalid.public int getValueLabelStyle()
setValueLabelStyle(int)
public java.awt.Color getValueLinesColor()
public int[] getVisibleSamples()
public boolean hasDataChangedSince(long time)
hasDataChangedSince
in class GenericChart
time
- The time to check for.
public static int hashCode(java.lang.String s)
s
- The string to calculate hash code for.
public boolean isDefaultGridLinesOn()
public boolean isGridAdjustmentOn(int edge)
edge
- TOP, LEFT, BOTTOM, or RIGHT.
public boolean isLegendBoxSizeAsFont()
public boolean isRangeAdjusterOn(int adjuster)
adjuster
- The index of the adjuster (0 or 1)
public boolean isRangeLabelsOn(int index)
index
- 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 isSeriesEmpty(int index)
isSeriesEmpty
in class GenericChart
index
- The series index.
public boolean isSeriesLabelsOn()
public boolean isValueLabelsOn()
public boolean isValueLabelsOn(int serie)
serie
- The serie to check for.
public boolean isValueLinesOn()
public static void main(java.lang.String[] argv)
protected void paintGrid(java.awt.Graphics g, java.awt.Rectangle gridBounds)
g
- The graphics context used to paint with.gridBounds
- The chart grid bounds.protected void processEvent(java.awt.AWTEvent event)
processEvent
in class GenericChart
event
- The event to process.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)
protected void renderData(java.awt.Graphics g, java.awt.Rectangle gridBounds, java.awt.Rectangle dataBounds)
g
- The graphics context used to paint with.gridBounds
- The grid bounds to paint within.dataBounds
- The scrolled data bounds to calculate the bars from.public void reset()
reset
in class GenericChart
public void set3DDepth(int depth)
depth
- The number of pixels, -1 for default (variable) depth.public void setChartData(ChartData chartData)
chartData
- The chart data to use for the chart.public void setCurrentLowerRange(int range, double lower)
range
- The index of the range .lower
- The range to use, larger or equal to the lower range.public void setCurrentRange(int range, double upper)
range
- The index of the rangeupper
- 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 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[] lines)
lines
- 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 setLegendBoxSizeAsFont(boolean on)
on
- True or falsepublic 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 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
- The range to be adjusted. -1 = all 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 position)
position
- 0 for left, 1 for 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 setRangeFormatter(int index, java.text.NumberFormat formatter)
index
- The index of the range.formatter
- The number formatter to set.public void setRangeInterval(int range, double interval)
range
- The index of the range.interval
- The interval between the to range ticks.public void setRangeLabelsOn(int index, boolean on)
index
- The index of the range to turn on/off the labels for.
If index == -1, the property is set for all ranges.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, 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 setSampleColor2(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 setSampleColors2(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
- INSIDE, OUTSIDE, BELOW, FLOATING, BELOW_AND_FLOATING, POINTING.public void setSamples(int serie, 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 setSelection(int serie, int sample, boolean selected, boolean clear, boolean notify)
setSelection
in class GenericChart
serie
- The series index.sample
- The sample index.selected
- True for selected, false for deselected.clear
- True if the other samples should be cleared.notify
- True if the listeners should be notified.
java.lang.IllegalArgumentException
- If the serie or sample is invalid.public void setSeriesCount(int count)
count
- The number of series.public void setSeriesFormatter(int index, java.text.NumberFormat formatter)
index
- The index of the series.formatter
- The number formatter to set.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, POINTING.public void setSeriesRange(int series, int range)
series
- The index of the series.range
- The index of the range.public void setTargetLabelsPosition(int position)
position
- 0 for left, 1 for right, -1 - the target labels
will be displayed on the same side as the range with index 0.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 setTargetValueLine(java.lang.String id, double value, java.awt.Color color, int style, int range)
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.range
- The range where the label will appear, and the value line is related to.
java.lang.IllegalArgumentException
- if the style is invalid.public void setValueLabelColor(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 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 setValueLabelStyle(int style)
style
- INSIDE, OUTSIDE, BELOW, FLOATING, BELOW_AND_FLOATING, POINTING.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 void setVisibleSamples(int start, int count, boolean adjustScrollers)
start
- The index of the start sample.count
- The number of samples to be displayed, -1 for all after start.adjustScrollers
- True if the scroller should be adjusted according to the visible samples.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |