All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jclass.chart.JCChart

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----jclass.bwt.JCComponent
                           |
                           +----jclass.chart.JCChart

public class JCChart
extends JCComponent
implements Changeable, JCSerializable, KeyListener, MouseListener, MouseMotionListener, TimerListener, HTMLDriver
JCChart is the core charting class. It acts as a template for the other JClass charting classes. It allows the retrieval of related objects such as JCChartArea, JCTitle (header and footer), and JCLegend. Each chart type is represented by a charting class derived from JCChart. The derived classes are responsible for constructing the appropriate JCChartArea, JCTitle and JCLegend objects.

Properties

Name Description
About The About property displays contact information for KL Group in the bean box.
AllowUserChanges The AllowUserChanges property determines whether the user viewing the graph can modify graph values. Default value is false.
Background The Background property determines the background color used to draw inside the chart region. Note that the Background property is inherited from the parent JCComponent.
BorderType Determines the style of border drawn around the Chart. Valid values come from BWTEnum, and include SHADOW_NONE, SHADOW_ETCHED_IN, SHADOW_ETCHED_OUT, SHADOW_IN, SHADOW_OUT, SHADOW_PLAIN, SHADOW_FRAME_IN, SHADOW_FRAME_OUT. The default value is SHADOW_IN (inherited from JCComponent).
BorderWidth The BorderWidth property determines the width of the border drawn around the chart. Default value is 0.
BottomMargin The BottomMargin property controls the bottom margin on the chart. Default value is 1.
CancelKey The CancelKey property specifies the key used to perform a cancel operation.
Changed The Changed property determines whether the chart requires recalculation. Default value is false.
ChartArea The ChartArea property controls the object that controls the display of the graph. Default value is null.
ChartLabels The ChartLabels property controls a list of chart labels managed by the chart. Default value is an empty JCVector.
DataView The DataView property is an indexed property that contains all the data to be displayed in Chart. See ChartDataView for details on data format. By default, one ChartDataView is created.
DoubleBuffer The DoubleBuffer property controls whether the chart rendering uses an off-screen image or renders directly to the screen. Default value is true.
FillColorIndex The FillColorIndex property controls the fill color index. Default value is 0.
Font The Font property determines what font is used to render text inside the chart region. Note that the Font property is inherited from the parent JCComponent.
Footer The Footer property controls the object that controls the display of the footer. Default value is null.
Foreground The Foreground property determines the foreground color used to draw inside the chart region. Note that the Foreground property is inherited from the parent JCComponent.
Header The Header property controls the object that controls the display of the header. Default value is null.
IsBatched The IsBatched property controls whether chart updates are accumulated. Default value is false.
Legend The Legend property controls the object that controls the display of the legend. Default value is null.
LeftMargin The LeftMargin property controls the left margin on the chart. Default value is 1.
LineColorIndex The LineColorIndex property controls the line color index. Default value is 0.
NumChartLabels The NumChartLabels property indicates how many chart labels there are. This property is read-only. Default value is calculated.
NumData The NumData property indicates how many ChartDataView objects are stored in JCChart. This is a read-only property. Default value is 1.
NumTriggers The NumTriggers property indicates how many event triggers have been specified.
ResetKey The ResetKey property specifies the key used to perform a reset operation.
RightMargin The RightMargin property controls the right margin on the chart. Default value is 1.
SaveParamStream The SaveParamStream property specifies the output stream to save Chart HTML tags to. Default value is null.
SymbolColorIndex The SymbolColorIndex property controls the symbol color index. Default value is 0.
SymbolShapeIndex The SymbolShapeIndex property controls the symbol shape index. Default value is 1.
TopMargin The TopMargin property controls the top margin on the chart. Default value is 1.
Trigger The Trigger property is an indexed property that contains all the information necessary to map user events into Chart actions. The Trigger property is made up of a number of EventTrigger objects. Default value is empty.
Version The Version property specifies the JClass Chart version number. This property is read-only. Default value is calculated.


Variable Index

 o AREA
 o BAR
 o CANDLE
 o current
 o dataviewHashtable
 o eventAction_strings
 o eventAction_values
 o eventMod_strings
 o eventMod_values
 o expiry
 o FILLED_RADAR
 o HILO
 o HILO_OPEN_CLOSE
 o indexHashtable
 o NONE
 o PIE
 o PLOT
 o POLAR
 o RADAR
 o SCATTER_PLOT
 o STACKING_BAR

Constructor Index

 o JCChart()
Default constructor, required by Java Beans
 o JCChart(Applet, String)
Constructor so that we can get property values from the HTML file
 o JCChart(int)
Constructor that creates a JCChart of a particular type.

Method Index

 o addChartLabel(JCChartLabel)
Add a chart label
 o addChartListener(JCChartListener)
 o addDataView(int)
Creates a new data view and added it to the chart at the specified index.
 o addNotify()
 o addPickListener(JCPickListener)
 o addTrigger()
Adds a new event trigger to the Triggers property.
 o cancel()
Performs a cancel on the chart.
 o closeSaveParams()
Writes the closing statements of a saved HTML file
 o expired()
 o findDataView(String)
Method used to find a data view given its name
 o getAbout()
Gets the value of the About property The About property displays contact information for KL Group in the bean box.
 o getAllowUserChanges()
Gets the value of the AllowUserChanges property, which determines whether the user viewing the graph can modify graph values.
 o getBorderType()
Gets the BorderType property of the Chart.
 o getBorderWidth()
Gets the BorderWidth property of the Chart.
 o getBottomMargin()
Gets the BottomMargin property.
 o getCancelKey()
Gets the value of the CancelKey property.
 o getChanged()
Gets the value of the Changed property, which determines whether the chart requires a recalculation.
 o getChanged(int)
Checks the value of the ChangedFlag property for the specified mask (see Changeable for a list of valid masks).
 o getChartArea()
Gets the value of the ChartArea property.
 o getChartLabels()
Gets the value of the ChartLabels indexed property.
 o getChartLabels(int)
Gets a value of the ChartLabels indexed property.
 o getDataView()
Gets the value of the DataView property.
 o getDataView(int)
Gets the value of the Data property.
 o getFillColorIndex()
Get the initial fill color index
 o getFooter()
Sets the Footer property.
 o getHeader()
Gets the Header property.
 o getIsBatched()
Gets the value of the IsBatched property.
 o getLeftMargin()
Gets the LeftMargin property.
 o getLegend()
Gets the Legend property The Legend property controls the object that controls the display of the legend.
 o getLineColorIndex()
Get the initial line color index
 o getNumChartLabels()
Get the current number of chart labels
 o getNumData()
Gets the value of the NumData property.
 o getNumTriggers()
Gets the NumTriggers property, which indicates how many event triggers have been specified.
 o getResetKey()
Gets the value of the ResetKey property.
 o getRightMargin()
Gets the RightMargin property.
 o getSaveParamStream()
Gets the outputstream the Chart HTML tags are stored to If none is currently set, return FileOutputStream, the file name is 'chart.html'.
 o getSymbolColorIndex()
Get the initial symbol color index
 o getSymbolShapeIndex()
Get the initial symbolshape index
 o getTopMargin()
Gets the TopMargin property.
 o getTrigger(int)
Gets a single trigger from the Triggers property of JCChart.
 o getVersion()
Gets the value of the Version property.
 o initSaveParams(String)
Writes the header for the saved HTML file
 o insets()
Returns the chart margins.
 o isChanged()
Gets the value of the Changed property, which determines whether the chart requires a recalculation.
 o isChanged(int)
Checks the value of the ChangedFlag property for the specified mask (see Changeable for a list of valid masks).
 o isNetscape()
Returns true if Chart is being run inside netscape.
 o keyDown(Event, int)
keyDown() provides default JDK 1.0.2 functionality Called by keyPressed() under JDK 1.1.1
 o keyPressed(KeyEvent)
 o keyReleased(KeyEvent)
 o keyTyped(KeyEvent)
 o launchPropertyPage(Point)
 o layout()
JCChart layout method.
 o loadParams(String)
Load HTML paramters from an inputstream and create a chart
 o locateChartRegion(int, int)
 o main(String[])
 o minimumSize()
Calculates and returns the minimum size of the chart component.
 o mouseClicked(MouseEvent)
 o mouseDown(Event, int, int)
If currently over an URL anchor, returns.
 o mouseDrag(Event, int, int)
mouseDrag() provides default JDK 1.0.2 functionality Called by mouseDragged() under JDK 1.1.1
 o mouseDragged(MouseEvent)
 o mouseEntered(MouseEvent)
 o mouseExit(Event, int, int)
mouseExit() provides default JDK 1.0.2 functionality Called by mouseExited() under JDK 1.1.1
 o mouseExited(MouseEvent)
 o mouseMove(Event, int, int)
 o mouseMoved(MouseEvent)
 o mousePressed(MouseEvent)
 o mouseReleased(MouseEvent)
 o mouseUp(Event, int, int)
If currently over an URL anchor, display it.
 o paint(Graphics)
Override superclass' paint() so that the chart is fully painted and flushed before the listeners are called.
 o paintComponent(Graphics)
The top-level paint routine in JCChart.
 o pick(Point, ChartDataView)
Given a screen position in pixels, returns a JCDataIndex object which represents the closest point in a data series in the specified ChartDataView instance.
 o preferredSize()
Calculates and returns the preferred size of the chart component.
 o printAll(Graphics)
Disables double-buffering, and calls Container.printAll
 o processMouseEvent(MouseEvent)
 o recalc()
If necessary, forces recalculation of the entire chart by calling the recalc() method for its components.
 o removeAllChartLabels()
Remove all the chart labels
 o removeChartLabel(JCChartLabel)
Remove a chart label
 o removeChartListener(JCChartListener)
 o removeDataView(int)
Removes a ChartDataView from the index specified.
 o removePickListener(JCPickListener)
 o removeTrigger(int)
Removes the event trigger at the specified index.
 o reset()
Performs a reset on the chart.
 o resetDefaults()
Reset the line, symbol and fill color and pattern to the default index values The colors are defined in JCStyle
 o rotate()
A call to rotate a graph to the specified locations.
 o rotateEnd()
A call to signify the end of a rotate event.
 o rotateStart()
A call to signify the beginning of a rotate event.
 o saveParams(String)
Save parameters from an existing chart into an equivalent HTML file
 o scale(double, JCAxis, boolean)
Performs a scale operation.
 o setAbout(String)
Sets the value of the About property The About property displays contact information for KL Group in the bean box.
 o setAllowUserChanges(boolean)
Sets the value of the AllowUserChanges property, which determines whether the user viewing the graph can modify graph values.
 o setBackground(Color)
Override super's method so that changes will generate redraws.
 o setBorderType(int)
Sets the BorderType property of the Chart.
 o setBorderWidth(int)
Sets the BorderWidth property of the Chart.
 o setBottomMargin(int)
Sets the BottomMargin property.
 o setCancelKey(int)
Sets the value of the CancelKey property.
 o setChanged(boolean, int)
Sets the value of the Changed property, which determines whether the chart requires recalculation.
 o setChanged(boolean, int, boolean)
Sets the value of the Changed property, which determines whether the chart requires recalculation.
 o setChartArea(JCChartArea)
Sets the value of the ChartArea property.
 o setChartLabels(int, JCChartLabel)
Sets a value of the ChartLabels indexed property.
 o setChartLabels(JCChartLabel[])
Sets the value of the ChartLabels indexed property.
 o setDataView(ChartDataView[])
Sets the value of the DataView property.
 o setDataView(int, ChartDataView)
Creates a new ChartDataView and adds it at the index specified.
 o setFillColorIndex(int)
Set the initial fill color index
 o setFont(Font)
Override super's method so that changes will generate redraws.
 o setFooter(JCTitle)
Sets the Footer property.
 o setForeground(Color)
Override super's method so that changes will generate redraws.
 o setHeader(JCTitle)
Sets the Header property.
 o setIsBatched(boolean)
Sets the value of the IsBatched property, which controls whether chart updates are accumulated.
 o setLeftMargin(int)
Sets the LeftMargin property.
 o setLegend(JCLegend)
Sets the Legend property The Legend property controls the object that controls the display of the legend.
 o setLineColorIndex(int)
Set the initial line color index
 o setResetKey(int)
Sets the value of the ResetKey property.
 o setRightMargin(int)
Sets the RightMargin property.
 o setSaveParamStream(OutputStream)
Sets the outputstream to save Chart HTML tags to.
 o setSymbolColorIndex(int)
Set the initial symbol color index
 o setSymbolShapeIndex(int)
Set the initial symbol shape index
 o setTopMargin(int)
Sets the TopMargin property.
 o setTrigger(int, EventTrigger)
Sets the value of the Trigger property at a specified index.
 o setVersion(String)
Does nothing (Version property is read-only).
 o snapshot()
 o timerExpired(Timer)
Implement the TimerListener interface.
 o translate(double, JCAxis, boolean)
A call to perform a translation of a specified amount along the specified axis.
 o translateStart(JCAxis)
A call to signify the start of a translate event.
 o unpick(ChartDataView, int, int)
Returns the position in screen pixels of a particular point in a particular data series.
 o unpick(int, ChartDataViewSeries)
Returns the position in screen pixels of a particular point in a particular data series.
 o update()
Forces the chart to re-layout and recalculate.
 o writeParam(String, boolean)
Write the boolean HTML param tag
 o writeParam(String, boolean, boolean)
 o writeParam(String, Color)
Write the color HTML param tag
 o writeParam(String, Color, Color)
 o writeParam(String, Date)
Write the date HTML param tag
 o writeParam(String, double)
Write the double HTML param tag
 o writeParam(String, double, double)
 o writeParam(String, Font)
Write the font HTML param tag
 o writeParam(String, Font, Font)
 o writeParam(String, Insets, Insets)
 o writeParam(String, int)
Write the int HTML param tag
 o writeParam(String, int, int)
 o writeParam(String, JCAxis, JCAxis)
 o writeParam(String, String)
Write the string HTML param tag
 o writeParam(String, String, String)
 o zoom(double, double, JCAxis, boolean)
Performs a zoom operation along the specified axis

Variables

 o NONE
 public static final int NONE
 o PLOT
 public static final int PLOT
 o SCATTER_PLOT
 public static final int SCATTER_PLOT
 o POLAR
 public static final int POLAR
 o RADAR
 public static final int RADAR
 o FILLED_RADAR
 public static final int FILLED_RADAR
 o HILO
 public static final int HILO
 o HILO_OPEN_CLOSE
 public static final int HILO_OPEN_CLOSE
 o CANDLE
 public static final int CANDLE
 o AREA
 public static final int AREA
 o BAR
 public static final int BAR
 o STACKING_BAR
 public static final int STACKING_BAR
 o PIE
 public static final int PIE
 o dataviewHashtable
 public Hashtable dataviewHashtable
 o indexHashtable
 public Hashtable indexHashtable
 o eventMod_strings
 public static final String eventMod_strings[]
 o eventMod_values
 public static final int eventMod_values[]
 o eventAction_strings
 public static final String eventAction_strings[]
 o eventAction_values
 public static final int eventAction_values[]
 o expiry
 public static final Date expiry
 o current
 public static final Date current

Constructors

 o JCChart
 public JCChart(int tp)
Constructor that creates a JCChart of a particular type. Note that the ChartType is actually a property of ChartDataView. This constructor is provided as a convenience.

Parameters:
tp - the chart type
See Also:
ChartDataView
 o JCChart
 public JCChart()
Default constructor, required by Java Beans

 o JCChart
 public JCChart(Applet applet,
                String name)
Constructor so that we can get property values from the HTML file

Parameters:
applet - the applet that this chart is contained in
name - a name for this chart

Methods

 o expired
 public static final boolean expired()
 o processMouseEvent
 public void processMouseEvent(MouseEvent e)
Overrides:
processMouseEvent in class JCComponent
 o mousePressed
 public void mousePressed(MouseEvent event)
 o mouseClicked
 public void mouseClicked(MouseEvent event)
 o mouseReleased
 public void mouseReleased(MouseEvent event)
 o mouseEntered
 public void mouseEntered(MouseEvent event)
 o mouseExited
 public void mouseExited(MouseEvent event)
 o mouseDragged
 public void mouseDragged(MouseEvent event)
 o mouseMoved
 public void mouseMoved(MouseEvent event)
 o keyTyped
 public void keyTyped(KeyEvent event)
 o keyPressed
 public void keyPressed(KeyEvent event)
 o keyReleased
 public void keyReleased(KeyEvent event)
 o launchPropertyPage
 protected void launchPropertyPage(Point p)
 o isChanged
 public final boolean isChanged()
Gets the value of the Changed property, which determines whether the chart requires a recalculation.

 o isChanged
 public final boolean isChanged(int mask)
Checks the value of the ChangedFlag property for the specified mask (see Changeable for a list of valid masks). The ChangedFlag property determines the type of action the chart needs to take in regards to the current change.

 o getChanged
 public boolean getChanged()
Gets the value of the Changed property, which determines whether the chart requires a recalculation.

 o getChanged
 public boolean getChanged(int mask)
Checks the value of the ChangedFlag property for the specified mask (see Changeable for a list of valid masks). The ChangedFlag property determines the type of action the chart needs to take in regards to the current change.

 o recalc
 public void recalc()
If necessary, forces recalculation of the entire chart by calling the recalc() method for its components.

 o setChanged
 public void setChanged(boolean n,
                        int cf)
Sets the value of the Changed property, which determines whether the chart requires recalculation. This value is propagated to all child components.

Parameters:
n - boolean value of the Changed property
 o setChanged
 public void setChanged(boolean n,
                        int cf,
                        boolean updateParent)
Sets the value of the Changed property, which determines whether the chart requires recalculation. This value is propagated to all the child components. Note: This method is mandated by the Changeable interface, but has no use in JCChart. It is usually used for cases in which the Changed property must be changed without forcing a recalculation.

Parameters:
n - boolean value of the Changed property
 o paint
 public void paint(Graphics gc)
Override superclass' paint() so that the chart is fully painted and flushed before the listeners are called.

Overrides:
paint in class JCComponent
 o paintComponent
 public void paintComponent(Graphics gc)
The top-level paint routine in JCChart.

Overrides:
paintComponent in class JCComponent
 o printAll
 public void printAll(Graphics g)
Disables double-buffering, and calls Container.printAll

Overrides:
printAll in class JCComponent
 o layout
 public void layout()
JCChart layout method. It lays out the header, footer, legend and chart area.

Overrides:
layout in class JCComponent
 o preferredSize
 public Dimension preferredSize()
Calculates and returns the preferred size of the chart component.

Returns:
the preferred size of the chart component
Overrides:
preferredSize in class JCComponent
 o minimumSize
 public Dimension minimumSize()
Calculates and returns the minimum size of the chart component.

Returns:
the minimum size of the chart component
Overrides:
minimumSize in class JCComponent
 o setIsBatched
 public void setIsBatched(boolean bt)
Sets the value of the IsBatched property, which controls whether chart updates are accumulated.

Parameters:
bt - if true, it will accumulate chart updates. If false, it forces the accumulated updates to be processed.
 o getIsBatched
 public boolean getIsBatched()
Gets the value of the IsBatched property.

Returns:
true if updates are being accumulated, if false, updates are not accumulated
 o update
 public void update()
Forces the chart to re-layout and recalculate.

 o addNotify
 public void addNotify()
Overrides:
addNotify in class JCComponent
 o setBackground
 public void setBackground(Color c)
Override super's method so that changes will generate redraws.

Overrides:
setBackground in class JCComponent
 o setForeground
 public void setForeground(Color c)
Override super's method so that changes will generate redraws.

Overrides:
setForeground in class JCComponent
 o setFont
 public void setFont(Font f)
Override super's method so that changes will generate redraws.

Overrides:
setFont in class JCComponent
 o setAllowUserChanges
 public void setAllowUserChanges(boolean change)
Sets the value of the AllowUserChanges property, which determines whether the user viewing the graph can modify graph values.

Parameters:
change - true means the user is allowed to modify graph values. If false, the user is not allowed to modify graph values.
 o getAllowUserChanges
 public boolean getAllowUserChanges()
Gets the value of the AllowUserChanges property, which determines whether the user viewing the graph can modify graph values.

Returns:
true if the user is allowed to modify the graph values, false otherwise
 o getHeader
 public JCTitle getHeader()
Gets the Header property. The Header property controls the object that controls the display of the header.

Returns:
head the JCTitle object associated with the header
 o setHeader
 public void setHeader(JCTitle head)
Sets the Header property. The Header property controls the object that controls the display of the header.

Parameters:
head - the JCTitle object associated with the header
 o getFooter
 public JCTitle getFooter()
Sets the Footer property. The Footer property controls the object that controls the display of the footer.

Returns:
the JCTitle object associated with the footer
 o setFooter
 public void setFooter(JCTitle foot)
Sets the Footer property. The Footer property controls the object that controls the display of the footer.

Parameters:
foot - the JCTitle object associated with the footer
 o getLegend
 public JCLegend getLegend()
Gets the Legend property The Legend property controls the object that controls the display of the legend.

Returns:
the JCLegend object associated with the legend
 o setLegend
 public void setLegend(JCLegend jl)
Sets the Legend property The Legend property controls the object that controls the display of the legend.

Parameters:
jl - the JCLegend object associated with the legend
 o getChartArea
 public JCChartArea getChartArea()
Gets the value of the ChartArea property. The ChartArea property controls the object that controls the display of the graph.

Returns:
the JCChartArea object associated with this JCChart.
 o setChartArea
 public void setChartArea(JCChartArea ca)
Sets the value of the ChartArea property. The ChartArea property controls the object that controls the display of the graph.

Returns:
the JCChartArea object associated with this JCChart.
 o getDataView
 public ChartDataView getDataView(int index)
Gets the value of the Data property. The Data property is an indexed property of JCChart that contains one or more ChartDataView objects. Each ChartDataView object controls the display of data using a particular chart type.

Parameters:
index - index of the data object to return
Returns:
ChartDataView object
 o addDataView
 public ChartDataView addDataView(int index)
Creates a new data view and added it to the chart at the specified index. Relies on setDataView, so look there for additional information

 o setDataView
 public void setDataView(int index,
                         ChartDataView ndv)
Creates a new ChartDataView and adds it at the index specified. The act of adding a new ChartDataView to the JCChart will cause all existing ChartDataView objects to re-order themselves.

Parameters:
index - position at which to add the new object
ndv - New data view object
Returns:
new ChartDataView object
Throws: IllegalArgumentException
If the index does not address a valid ChartDataView.
 o setDataView
 public void setDataView(ChartDataView views[])
Sets the value of the DataView property. The DataView property is an indexed property that contains all the data to be displayed in Chart.

Parameters:
views - array of data views to be included in the DataView property.
 o findDataView
 public ChartDataView findDataView(String name)
Method used to find a data view given its name

 o getDataView
 public ChartDataView[] getDataView()
Gets the value of the DataView property. The DataView property is an indexed property that contains all the data to be displayed in Chart.

Returns:
array of data views that are included in the DataView property
 o removeDataView
 public void removeDataView(int index)
Removes a ChartDataView from the index specified. The act of removing a ChartDataView to the JCChart will cause all existing ChartDataView objects to re-order themselves.

Parameters:
index - position from which to remove the object
 o getNumData
 public int getNumData()
Gets the value of the NumData property. The NumData property indicates how many ChartDataView objects are stored in JCChart. It is a read-only property.

Returns:
number of ChartDataView objects inside this JCChart instance
 o getTrigger
 public EventTrigger getTrigger(int index)
Gets a single trigger from the Triggers property of JCChart. The Triggers property is an indexed property that contains a series of mappings from AWT events to JCChart actions.

Parameters:
index - index of trigger
Returns:
EventTrigger instance
 o getNumTriggers
 public int getNumTriggers()
Gets the NumTriggers property, which indicates how many event triggers have been specified.

Returns:
number of EventTrigger instances in the Triggers property
 o addTrigger
 public EventTrigger addTrigger()
Adds a new event trigger to the Triggers property.

Returns:
EventTrigger instance, to be manipulated by the developer
 o setTrigger
 public void setTrigger(int index,
                        EventTrigger trig)
Sets the value of the Trigger property at a specified index. The Trigger property is an indexed property, and int contains all the information necessary to map user events into Chart actions. The Trigger property is made up of a number of EventTrigger objects.

Parameters:
index - index within the Trigger property
trig - EventTrigger object to be placed at the specified index
Throws: IllegalArgumentException
If the index does not address a valid event trigger.
 o removeTrigger
 public void removeTrigger(int index)
Removes the event trigger at the specified index.

Parameters:
index - index of the EventTrigger instance to be removed
 o setResetKey
 public void setResetKey(int k)
Sets the value of the ResetKey property. The ResetKey property specifies the key used to perform a reset operation.

Parameters:
k - Key that will trigger a reset
 o getResetKey
 public int getResetKey()
Gets the value of the ResetKey property. The ResetKey property specifies the key used to perform a reset operation.

Returns:
Key that will trigger a reset
 o setCancelKey
 public void setCancelKey(int k)
Sets the value of the CancelKey property. The CancelKey property specifies the key used to perform a cancel operation.

Parameters:
k - Key that will trigger a cancel
 o getCancelKey
 public int getCancelKey()
Gets the value of the CancelKey property. The CancelKey property specifies the key used to perform a cancel operation.

Returns:
Key that will trigger a cancel
 o rotateStart
 public void rotateStart()
A call to signify the beginning of a rotate event.

 o rotate
 public void rotate()
A call to rotate a graph to the specified locations.

Parameters:
rotation - rotation around the y axis
inclination - rotation above the x axis
 o rotateEnd
 public void rotateEnd()
A call to signify the end of a rotate event.

 o zoom
 public void zoom(double start,
                  double end,
                  JCAxis axis,
                  boolean update)
Performs a zoom operation along the specified axis

Parameters:
start - new axis minimum value
end - new axis maximum value
axis - axis along which to perform zoom
update - if true, a redisplay is forced. If false, the redisplay does not occur. If translating along two axes, the first translate() call should have update=false, and the second should have update=true.
 o scale
 public void scale(double sc,
                   JCAxis axis,
                   boolean update)
Performs a scale operation. A scale factor of 0.5 is 50% and makes everything smaller (zoom out), a scale factor of 2 is 200% and makes everything bigger (zoom in)

Parameters:
sc - scale percentage relative to the default appearance of the graph
 o translateStart
 public void translateStart(JCAxis axis)
A call to signify the start of a translate event.

Parameters:
axis - axis along which to begin translating. Note that it is possible to translate along multiple axes simultaneously.
 o translate
 public void translate(double delta,
                       JCAxis axis,
                       boolean update)
A call to perform a translation of a specified amount along the specified axis.

Parameters:
delta - amount to translate along the axis
axis - axis along which to perform the translation
update - if true, a redisplay is forced. If false, the redisplay does not occur. If translating along two axes, the first translate() call should have update=false, and the second should have update=true.
 o reset
 public void reset()
Performs a reset on the chart. Returns the chart back to the default min and max.

 o cancel
 public void cancel()
Performs a cancel on the chart. Cancel will stop any current action.

 o insets
 public Insets insets()
Returns the chart margins.

Returns:
insets object representing the margins for the chart
Overrides:
insets in class JCComponent
 o setTopMargin
 public void setTopMargin(int val)
Sets the TopMargin property. The TopMargin property controls the top margin on the chart.

Parameters:
val - top margin value
 o getTopMargin
 public int getTopMargin()
Gets the TopMargin property. The TopMargin property controls the top margin on the chart.

Returns:
top margin value
 o setLeftMargin
 public void setLeftMargin(int val)
Sets the LeftMargin property. The LeftMargin property controls the left margin on the chart.

Parameters:
val - left margin value
 o getLeftMargin
 public int getLeftMargin()
Gets the LeftMargin property. The LeftMargin property controls the left margin on the chart.

Returns:
left margin value
 o setRightMargin
 public void setRightMargin(int val)
Sets the RightMargin property. The RightMargin property controls the right margin on the chart.

Parameters:
val - right margin value
 o getRightMargin
 public int getRightMargin()
Gets the RightMargin property. The RightMargin property controls the right margin on the chart.

Returns:
right margin value
 o setBottomMargin
 public void setBottomMargin(int val)
Sets the BottomMargin property. The BottomMargin property controls the bottom margin on the chart.

Parameters:
val - bottom margin value
 o getBottomMargin
 public int getBottomMargin()
Gets the BottomMargin property. The BottomMargin property controls the bottom margin on the chart.

Returns:
bottom margin value
 o getAbout
 public String getAbout()
Gets the value of the About property The About property displays contact information for KL Group in the bean box.

Overrides:
getAbout in class JCComponent
 o setAbout
 public void setAbout(String s)
Sets the value of the About property The About property displays contact information for KL Group in the bean box.

Overrides:
setAbout in class JCComponent
 o getVersion
 public String getVersion()
Gets the value of the Version property. The Version property specifies the JClass Chart version number.

Overrides:
getVersion in class JCComponent
 o setVersion
 public void setVersion(String s)
Does nothing (Version property is read-only). A set method is required for the Version property to appear in a Bean editor (eg BeanBox).

Overrides:
setVersion in class JCComponent
 o setBorderType
 public void setBorderType(int bt)
Sets the BorderType property of the Chart. The BorderType property determines the style of border drawn around the Chart. Valid values come from BWTEnum, and include SHADOW_NONE, SHADOW_ETCHED_IN, SHADOW_ETCHED_OUT, SHADOW_IN, SHADOW_OUT, SHADOW_PLAIN, SHADOW_FRAME_IN, SHADOW_FRAME_OUT.

Parameters:
bt - enum specifying border type
Throws: IllegalArgumentException
If the BorderType isn't a valid shadow type from BWTEnum.
 o getBorderType
 public int getBorderType()
Gets the BorderType property of the Chart. The BorderType property determines the style of border drawn around the Chart. Valid values come from BWTEnum, and include SHADOW_NONE, SHADOW_ETCHED_IN, SHADOW_ETCHED_OUT, SHADOW_IN, SHADOW_OUT, SHADOW_PLAIN, SHADOW_FRAME_IN, SHADOW_FRAME_OUT.

Returns:
enum specifying border type
 o setBorderWidth
 public void setBorderWidth(int thick)
Sets the BorderWidth property of the Chart. The BorderWidth property determines the width of the border drawn around the chart

Parameters:
thick - border width in pixels
Throws: IllegalArgumentException
If the BorderWidth isn't positive, throw an error.
 o getBorderWidth
 public int getBorderWidth()
Gets the BorderWidth property of the Chart. The BorderWidth property determines the width of the border drawn around the chart

Returns:
Border width in pixels.
 o pick
 public synchronized JCDataIndex pick(Point p,
                                      ChartDataView data)
Given a screen position in pixels, returns a JCDataIndex object which represents the closest point in a data series in the specified ChartDataView instance. If no data view is supplied, all data views are considered when finding the closest point.

Parameters:
p - pick point in pixels relative to the JCChart object.
data - data view on which to perform pick. If null, all data views are used.
Returns:
JCDataIndex object representing the picked point.
 o unpick
 public synchronized Point unpick(ChartDataView dv,
                                  int pt,
                                  int series)
Returns the position in screen pixels of a particular point in a particular data series.

Parameters:
dv - the data view containing the specified series
pt - point index
series - data series index or JCPieChartFormat.OTHER_SLICE if specifying the other slice of a pie chart.
Returns:
AWT Point object representing position in screen pixels relative to the JCChart object or null if series or point does not exist or is not showing.
 o unpick
 public Point unpick(int pt,
                     ChartDataViewSeries series)
Returns the position in screen pixels of a particular point in a particular data series.

Parameters:
pt - point index
series - data series
Returns:
AWT Point object representing position in screen pixels relative to the JCChart object or null if series or point does not exist or is not showing.
 o addChartListener
 public void addChartListener(JCChartListener l)
 o removeChartListener
 public void removeChartListener(JCChartListener l)
 o addPickListener
 public void addPickListener(JCPickListener l)
 o removePickListener
 public void removePickListener(JCPickListener l)
 o isNetscape
 public boolean isNetscape()
Returns true if Chart is being run inside netscape.

 o mouseUp
 public boolean mouseUp(Event event,
                        int x,
                        int y)
If currently over an URL anchor, display it.

Overrides:
mouseUp in class Component
 o mouseDown
 public boolean mouseDown(Event event,
                          int x,
                          int y)
If currently over an URL anchor, returns.

Overrides:
mouseDown in class JCComponent
 o mouseDrag
 public boolean mouseDrag(Event event,
                          int x,
                          int y)
mouseDrag() provides default JDK 1.0.2 functionality Called by mouseDragged() under JDK 1.1.1

Overrides:
mouseDrag in class Component
 o mouseExit
 public boolean mouseExit(Event event,
                          int x,
                          int y)
mouseExit() provides default JDK 1.0.2 functionality Called by mouseExited() under JDK 1.1.1

Overrides:
mouseExit in class Component
 o keyDown
 public boolean keyDown(Event evt,
                        int key)
keyDown() provides default JDK 1.0.2 functionality Called by keyPressed() under JDK 1.1.1

Overrides:
keyDown in class JCComponent
 o locateChartRegion
 public ChartRegion locateChartRegion(int x,
                                      int y)
 o mouseMove
 public boolean mouseMove(Event event,
                          int x,
                          int y)
Overrides:
mouseMove in class Component
 o timerExpired
 public void timerExpired(Timer t)
Implement the TimerListener interface. This method will be called after when a dwell label has a delay specified. Determine if the mouse is still at the same DataIndex that it was when the Timer was set, and show the label if it is.

 o snapshot
 public Image snapshot()
 o resetDefaults
 public void resetDefaults()
Reset the line, symbol and fill color and pattern to the default index values The colors are defined in JCStyle

 o setLineColorIndex
 public void setLineColorIndex(int colorIndex)
Set the initial line color index

 o setFillColorIndex
 public void setFillColorIndex(int colorIndex)
Set the initial fill color index

 o setSymbolColorIndex
 public void setSymbolColorIndex(int colorIndex)
Set the initial symbol color index

 o setSymbolShapeIndex
 public void setSymbolShapeIndex(int shapeIndex)
Set the initial symbol shape index

 o getLineColorIndex
 public int getLineColorIndex()
Get the initial line color index

 o getFillColorIndex
 public int getFillColorIndex()
Get the initial fill color index

 o getSymbolColorIndex
 public int getSymbolColorIndex()
Get the initial symbol color index

 o getSymbolShapeIndex
 public int getSymbolShapeIndex()
Get the initial symbolshape index

 o addChartLabel
 public void addChartLabel(JCChartLabel label)
Add a chart label

 o removeChartLabel
 public void removeChartLabel(JCChartLabel label)
Remove a chart label

 o getNumChartLabels
 public int getNumChartLabels()
Get the current number of chart labels

 o removeAllChartLabels
 public void removeAllChartLabels()
Remove all the chart labels

 o getChartLabels
 public JCChartLabel getChartLabels(int index)
Gets a value of the ChartLabels indexed property. The ChartLabels property controls a list of chart labels managed by the chart.

Parameters:
index - position at which to add the new object.
Returns:
requested chart label
 o setChartLabels
 public void setChartLabels(int index,
                            JCChartLabel lbl)
Sets a value of the ChartLabels indexed property. The ChartLabels property controls a list of chart labels managed by the chart.

Parameters:
index - position at which to add the new object. To add a new item at the end, set the position to the current size of the labels array.
lbl - new chart label to be added
Throws: IllegalArgumentException
thrown if the index is larger than the size of the array.
 o getChartLabels
 public JCChartLabel[] getChartLabels()
Gets the value of the ChartLabels indexed property. The ChartLabels property controls a list of chart labels managed by the chart.

Returns:
array containing all the chart labels for this JCChart.
 o setChartLabels
 public void setChartLabels(JCChartLabel s[])
Sets the value of the ChartLabels indexed property. The ChartLabels property controls a list of chart labels managed by the chart.

Parameters:
s - array of chart labels to add to this JCChart.
 o setSaveParamStream
 public void setSaveParamStream(OutputStream out)
Sets the outputstream to save Chart HTML tags to.

Parameters:
out - the OutputStream to save params to
 o getSaveParamStream
 public OutputStream getSaveParamStream()
Gets the outputstream the Chart HTML tags are stored to If none is currently set, return FileOutputStream, the file name is 'chart.html'.

 o writeParam
 public void writeParam(String param,
                        boolean value)
Write the boolean HTML param tag

 o writeParam
 public void writeParam(String param,
                        Date value)
Write the date HTML param tag

 o writeParam
 public void writeParam(String param,
                        Color value)
Write the color HTML param tag

 o writeParam
 public void writeParam(String param,
                        String value)
Write the string HTML param tag

 o writeParam
 public void writeParam(String param,
                        int value)
Write the int HTML param tag

 o writeParam
 public void writeParam(String param,
                        double value)
Write the double HTML param tag

 o writeParam
 public void writeParam(String param,
                        Font value)
Write the font HTML param tag

 o writeParam
 public void writeParam(String param,
                        Color orig,
                        Color curr)
 o writeParam
 public void writeParam(String param,
                        Font orig,
                        Font curr)
 o writeParam
 public void writeParam(String param,
                        String orig,
                        String curr)
 o writeParam
 public void writeParam(String param,
                        boolean orig,
                        boolean curr)
 o writeParam
 public void writeParam(String param,
                        int orig,
                        int curr)
 o writeParam
 public void writeParam(String param,
                        double orig,
                        double curr)
 o writeParam
 public void writeParam(String param,
                        Insets orig,
                        Insets curr)
 o writeParam
 public void writeParam(String param,
                        JCAxis orig,
                        JCAxis curr)
 o initSaveParams
 public void initSaveParams(String name)
Writes the header for the saved HTML file

 o closeSaveParams
 public void closeSaveParams()
Writes the closing statements of a saved HTML file

 o saveParams
 public void saveParams(String name)
Save parameters from an existing chart into an equivalent HTML file

Parameters:
name - the PARAM NAME
 o loadParams
 public void loadParams(String name)
Load HTML paramters from an inputstream and create a chart

Parameters:
name - the PARAM NAME
 o main
 public static void main(String args[])

All Packages  Class Hierarchy  This Package  Previous  Next  Index