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.
|
-
AREA
-
-
BAR
-
-
CANDLE
-
-
current
-
-
dataviewHashtable
-
-
eventAction_strings
-
-
eventAction_values
-
-
eventMod_strings
-
-
eventMod_values
-
-
expiry
-
-
FILLED_RADAR
-
-
HILO
-
-
HILO_OPEN_CLOSE
-
-
indexHashtable
-
-
NONE
-
-
PIE
-
-
PLOT
-
-
POLAR
-
-
RADAR
-
-
SCATTER_PLOT
-
-
STACKING_BAR
-
-
JCChart()
- Default constructor, required by Java Beans
-
JCChart(Applet, String)
- Constructor so that we can get property values from the HTML file
-
JCChart(int)
- Constructor that creates a JCChart of a particular type.
-
addChartLabel(JCChartLabel)
- Add a chart label
-
addChartListener(JCChartListener)
-
-
addDataView(int)
- Creates a new data view and added it to the chart at
the specified index.
-
addNotify()
-
-
addPickListener(JCPickListener)
-
-
addTrigger()
- Adds a new event trigger to the Triggers property.
-
cancel()
- Performs a cancel on the chart.
-
closeSaveParams()
- Writes the closing statements of a saved HTML file
-
expired()
-
-
findDataView(String)
- Method used to find a data view given its name
-
getAbout()
- Gets the value of the About property
The About property displays contact information for KL Group
in the bean box.
-
getAllowUserChanges()
- Gets the value of the AllowUserChanges property, which determines whether
the user viewing the graph can modify graph values.
-
getBorderType()
- Gets the BorderType property of the Chart.
-
getBorderWidth()
- Gets the BorderWidth property of the Chart.
-
getBottomMargin()
- Gets the BottomMargin property.
-
getCancelKey()
- Gets the value of the CancelKey property.
-
getChanged()
- Gets the value of the Changed property, which determines whether the
chart requires a recalculation.
-
getChanged(int)
- Checks the value of the ChangedFlag property for the specified mask (see
Changeable for a list of valid masks).
-
getChartArea()
- Gets the value of the ChartArea property.
-
getChartLabels()
- Gets the value of the ChartLabels indexed property.
-
getChartLabels(int)
- Gets a value of the ChartLabels indexed property.
-
getDataView()
- Gets the value of the DataView property.
-
getDataView(int)
- Gets the value of the Data property.
-
getFillColorIndex()
- Get the initial fill color index
-
getFooter()
- Sets the Footer property.
-
getHeader()
- Gets the Header property.
-
getIsBatched()
- Gets the value of the IsBatched property.
-
getLeftMargin()
- Gets the LeftMargin property.
-
getLegend()
- Gets the Legend property
The Legend property controls the object that controls
the display of the legend.
-
getLineColorIndex()
- Get the initial line color index
-
getNumChartLabels()
- Get the current number of chart labels
-
getNumData()
- Gets the value of the NumData property.
-
getNumTriggers()
- Gets the NumTriggers property, which indicates how many
event triggers have been specified.
-
getResetKey()
- Gets the value of the ResetKey property.
-
getRightMargin()
- Gets the RightMargin property.
-
getSaveParamStream()
- Gets the outputstream the Chart HTML tags are stored to
If none is currently set, return FileOutputStream,
the file name is 'chart.html'.
-
getSymbolColorIndex()
- Get the initial symbol color index
-
getSymbolShapeIndex()
- Get the initial symbolshape index
-
getTopMargin()
- Gets the TopMargin property.
-
getTrigger(int)
- Gets a single trigger from the Triggers property of JCChart.
-
getVersion()
- Gets the value of the Version property.
-
initSaveParams(String)
- Writes the header for the saved HTML file
-
insets()
- Returns the chart margins.
-
isChanged()
- Gets the value of the Changed property, which determines whether the
chart requires a recalculation.
-
isChanged(int)
- Checks the value of the ChangedFlag property for the specified mask (see
Changeable for a list of valid masks).
-
isNetscape()
- Returns true if Chart is being run inside netscape.
-
keyDown(Event, int)
-
keyDown() provides default JDK 1.0.2 functionality
Called by keyPressed() under JDK 1.1.1
-
keyPressed(KeyEvent)
-
-
keyReleased(KeyEvent)
-
-
keyTyped(KeyEvent)
-
-
launchPropertyPage(Point)
-
-
layout()
- JCChart layout method.
-
loadParams(String)
- Load HTML paramters from an inputstream and create a chart
-
locateChartRegion(int, int)
-
-
main(String[])
-
-
minimumSize()
- Calculates and returns the minimum size of the chart component.
-
mouseClicked(MouseEvent)
-
-
mouseDown(Event, int, int)
- If currently over an URL anchor, returns.
-
mouseDrag(Event, int, int)
-
mouseDrag() provides default JDK 1.0.2 functionality
Called by mouseDragged() under JDK 1.1.1
-
mouseDragged(MouseEvent)
-
-
mouseEntered(MouseEvent)
-
-
mouseExit(Event, int, int)
-
mouseExit() provides default JDK 1.0.2 functionality
Called by mouseExited() under JDK 1.1.1
-
mouseExited(MouseEvent)
-
-
mouseMove(Event, int, int)
-
-
mouseMoved(MouseEvent)
-
-
mousePressed(MouseEvent)
-
-
mouseReleased(MouseEvent)
-
-
mouseUp(Event, int, int)
- If currently over an URL anchor, display it.
-
paint(Graphics)
- Override superclass' paint() so that the chart is fully painted and
flushed before the listeners are called.
-
paintComponent(Graphics)
- The top-level paint routine in JCChart.
-
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.
-
preferredSize()
- Calculates and returns the preferred size of the chart component.
-
printAll(Graphics)
- Disables double-buffering, and calls Container.printAll
-
processMouseEvent(MouseEvent)
-
-
recalc()
- If necessary, forces recalculation of the entire chart by
calling the recalc() method for its components.
-
removeAllChartLabels()
- Remove all the chart labels
-
removeChartLabel(JCChartLabel)
- Remove a chart label
-
removeChartListener(JCChartListener)
-
-
removeDataView(int)
- Removes a ChartDataView from the index specified.
-
removePickListener(JCPickListener)
-
-
removeTrigger(int)
- Removes the event trigger at the specified index.
-
reset()
- Performs a reset on the chart.
-
resetDefaults()
- Reset the line, symbol and fill color and pattern
to the default index values
The colors are defined in JCStyle
-
rotate()
- A call to rotate a graph to the specified locations.
-
rotateEnd()
- A call to signify the end of a rotate event.
-
rotateStart()
- A call to signify the beginning of a rotate event.
-
saveParams(String)
- Save parameters from an existing chart into an equivalent HTML file
-
scale(double, JCAxis, boolean)
- Performs a scale operation.
-
setAbout(String)
- Sets the value of the About property
The About property displays contact information for KL Group
in the bean box.
-
setAllowUserChanges(boolean)
- Sets the value of the AllowUserChanges property, which determines whether
the user viewing the graph can modify graph values.
-
setBackground(Color)
- Override super's method so that changes will generate redraws.
-
setBorderType(int)
- Sets the BorderType property of the Chart.
-
setBorderWidth(int)
- Sets the BorderWidth property of the Chart.
-
setBottomMargin(int)
- Sets the BottomMargin property.
-
setCancelKey(int)
- Sets the value of the CancelKey property.
-
setChanged(boolean, int)
- Sets the value of the Changed property, which determines whether the
chart requires recalculation.
-
setChanged(boolean, int, boolean)
- Sets the value of the Changed property, which determines whether the
chart requires recalculation.
-
setChartArea(JCChartArea)
- Sets the value of the ChartArea property.
-
setChartLabels(int, JCChartLabel)
- Sets a value of the ChartLabels indexed property.
-
setChartLabels(JCChartLabel[])
- Sets the value of the ChartLabels indexed property.
-
setDataView(ChartDataView[])
- Sets the value of the DataView property.
-
setDataView(int, ChartDataView)
- Creates a new ChartDataView and adds it at the index specified.
-
setFillColorIndex(int)
- Set the initial fill color index
-
setFont(Font)
- Override super's method so that changes will generate redraws.
-
setFooter(JCTitle)
- Sets the Footer property.
-
setForeground(Color)
- Override super's method so that changes will generate redraws.
-
setHeader(JCTitle)
- Sets the Header property.
-
setIsBatched(boolean)
- Sets the value of the IsBatched property, which controls whether chart
updates are accumulated.
-
setLeftMargin(int)
- Sets the LeftMargin property.
-
setLegend(JCLegend)
- Sets the Legend property
The Legend property controls the object that controls
the display of the legend.
-
setLineColorIndex(int)
- Set the initial line color index
-
setResetKey(int)
- Sets the value of the ResetKey property.
-
setRightMargin(int)
- Sets the RightMargin property.
-
setSaveParamStream(OutputStream)
-
Sets the outputstream to save Chart HTML tags to.
-
setSymbolColorIndex(int)
- Set the initial symbol color index
-
setSymbolShapeIndex(int)
- Set the initial symbol shape index
-
setTopMargin(int)
- Sets the TopMargin property.
-
setTrigger(int, EventTrigger)
- Sets the value of the Trigger property at a specified
index.
-
setVersion(String)
- Does nothing (Version property is read-only).
-
snapshot()
-
-
timerExpired(Timer)
- Implement the TimerListener interface.
-
translate(double, JCAxis, boolean)
- A call to perform a translation of a specified amount along the
specified axis.
-
translateStart(JCAxis)
- A call to signify the start of a translate event.
-
unpick(ChartDataView, int, int)
- Returns the position in screen pixels of a particular point in a
particular data series.
-
unpick(int, ChartDataViewSeries)
- Returns the position in screen pixels of a particular point in a
particular data series.
-
update()
- Forces the chart to re-layout and recalculate.
-
writeParam(String, boolean)
- Write the boolean HTML param tag
-
writeParam(String, boolean, boolean)
-
-
writeParam(String, Color)
- Write the color HTML param tag
-
writeParam(String, Color, Color)
-
-
writeParam(String, Date)
- Write the date HTML param tag
-
writeParam(String, double)
- Write the double HTML param tag
-
writeParam(String, double, double)
-
-
writeParam(String, Font)
- Write the font HTML param tag
-
writeParam(String, Font, Font)
-
-
writeParam(String, Insets, Insets)
-
-
writeParam(String, int)
- Write the int HTML param tag
-
writeParam(String, int, int)
-
-
writeParam(String, JCAxis, JCAxis)
-
-
writeParam(String, String)
- Write the string HTML param tag
-
writeParam(String, String, String)
-
-
zoom(double, double, JCAxis, boolean)
- Performs a zoom operation along the specified axis
NONE
public static final int NONE
PLOT
public static final int PLOT
SCATTER_PLOT
public static final int SCATTER_PLOT
POLAR
public static final int POLAR
RADAR
public static final int RADAR
FILLED_RADAR
public static final int FILLED_RADAR
HILO
public static final int HILO
HILO_OPEN_CLOSE
public static final int HILO_OPEN_CLOSE
CANDLE
public static final int CANDLE
AREA
public static final int AREA
BAR
public static final int BAR
STACKING_BAR
public static final int STACKING_BAR
PIE
public static final int PIE
dataviewHashtable
public Hashtable dataviewHashtable
indexHashtable
public Hashtable indexHashtable
eventMod_strings
public static final String eventMod_strings[]
eventMod_values
public static final int eventMod_values[]
eventAction_strings
public static final String eventAction_strings[]
eventAction_values
public static final int eventAction_values[]
expiry
public static final Date expiry
current
public static final Date current
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
JCChart
public JCChart()
- Default constructor, required by Java Beans
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
expired
public static final boolean expired()
processMouseEvent
public void processMouseEvent(MouseEvent e)
- Overrides:
- processMouseEvent in class JCComponent
mousePressed
public void mousePressed(MouseEvent event)
mouseClicked
public void mouseClicked(MouseEvent event)
mouseReleased
public void mouseReleased(MouseEvent event)
mouseEntered
public void mouseEntered(MouseEvent event)
mouseExited
public void mouseExited(MouseEvent event)
mouseDragged
public void mouseDragged(MouseEvent event)
mouseMoved
public void mouseMoved(MouseEvent event)
keyTyped
public void keyTyped(KeyEvent event)
keyPressed
public void keyPressed(KeyEvent event)
keyReleased
public void keyReleased(KeyEvent event)
launchPropertyPage
protected void launchPropertyPage(Point p)
isChanged
public final boolean isChanged()
- Gets the value of the Changed property, which determines whether the
chart requires a recalculation.
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.
getChanged
public boolean getChanged()
- Gets the value of the Changed property, which determines whether the
chart requires a recalculation.
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.
recalc
public void recalc()
- If necessary, forces recalculation of the entire chart by
calling the recalc() method for its components.
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
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
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
paintComponent
public void paintComponent(Graphics gc)
- The top-level paint routine in JCChart.
- Overrides:
- paintComponent in class JCComponent
printAll
public void printAll(Graphics g)
- Disables double-buffering, and calls Container.printAll
- Overrides:
- printAll in class JCComponent
layout
public void layout()
- JCChart layout method. It lays out the header, footer, legend and
chart area.
- Overrides:
- layout in class JCComponent
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
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
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.
getIsBatched
public boolean getIsBatched()
- Gets the value of the IsBatched property.
- Returns:
- true if updates are being accumulated, if false, updates are
not accumulated
update
public void update()
- Forces the chart to re-layout and recalculate.
addNotify
public void addNotify()
- Overrides:
- addNotify in class JCComponent
setBackground
public void setBackground(Color c)
- Override super's method so that changes will generate redraws.
- Overrides:
- setBackground in class JCComponent
setForeground
public void setForeground(Color c)
- Override super's method so that changes will generate redraws.
- Overrides:
- setForeground in class JCComponent
setFont
public void setFont(Font f)
- Override super's method so that changes will generate redraws.
- Overrides:
- setFont in class JCComponent
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.
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
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
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
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
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
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
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
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.
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.
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
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
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.
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.
findDataView
public ChartDataView findDataView(String name)
- Method used to find a data view given its name
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
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
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
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
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
addTrigger
public EventTrigger addTrigger()
- Adds a new event trigger to the Triggers property.
- Returns:
- EventTrigger instance, to be manipulated by the
developer
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.
removeTrigger
public void removeTrigger(int index)
- Removes the event trigger at the specified index.
- Parameters:
- index - index of the EventTrigger instance to
be removed
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
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
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
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
rotateStart
public void rotateStart()
- A call to signify the beginning of a rotate event.
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
rotateEnd
public void rotateEnd()
- A call to signify the end of a rotate event.
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.
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
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.
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.
reset
public void reset()
- Performs a reset on the chart. Returns the chart back to the
default min and max.
cancel
public void cancel()
- Performs a cancel on the chart. Cancel will stop any current
action.
insets
public Insets insets()
- Returns the chart margins.
- Returns:
- insets object representing the margins for the chart
- Overrides:
- insets in class JCComponent
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
getTopMargin
public int getTopMargin()
- Gets the TopMargin property. The TopMargin property controls
the top margin on the chart.
- Returns:
- top margin value
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
getLeftMargin
public int getLeftMargin()
- Gets the LeftMargin property. The LeftMargin property controls
the left margin on the chart.
- Returns:
- left margin value
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
getRightMargin
public int getRightMargin()
- Gets the RightMargin property. The RightMargin property controls
the right margin on the chart.
- Returns:
- right margin value
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
getBottomMargin
public int getBottomMargin()
- Gets the BottomMargin property. The BottomMargin property controls
the bottom margin on the chart.
- Returns:
- bottom margin value
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
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
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
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
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.
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
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.
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.
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.
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.
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.
addChartListener
public void addChartListener(JCChartListener l)
removeChartListener
public void removeChartListener(JCChartListener l)
addPickListener
public void addPickListener(JCPickListener l)
removePickListener
public void removePickListener(JCPickListener l)
isNetscape
public boolean isNetscape()
- Returns true if Chart is being run inside netscape.
mouseUp
public boolean mouseUp(Event event,
int x,
int y)
- If currently over an URL anchor, display it.
- Overrides:
- mouseUp in class Component
mouseDown
public boolean mouseDown(Event event,
int x,
int y)
- If currently over an URL anchor, returns.
- Overrides:
- mouseDown in class JCComponent
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
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
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
locateChartRegion
public ChartRegion locateChartRegion(int x,
int y)
mouseMove
public boolean mouseMove(Event event,
int x,
int y)
- Overrides:
- mouseMove in class Component
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.
snapshot
public Image snapshot()
resetDefaults
public void resetDefaults()
- Reset the line, symbol and fill color and pattern
to the default index values
The colors are defined in JCStyle
setLineColorIndex
public void setLineColorIndex(int colorIndex)
- Set the initial line color index
setFillColorIndex
public void setFillColorIndex(int colorIndex)
- Set the initial fill color index
setSymbolColorIndex
public void setSymbolColorIndex(int colorIndex)
- Set the initial symbol color index
setSymbolShapeIndex
public void setSymbolShapeIndex(int shapeIndex)
- Set the initial symbol shape index
getLineColorIndex
public int getLineColorIndex()
- Get the initial line color index
getFillColorIndex
public int getFillColorIndex()
- Get the initial fill color index
getSymbolColorIndex
public int getSymbolColorIndex()
- Get the initial symbol color index
getSymbolShapeIndex
public int getSymbolShapeIndex()
- Get the initial symbolshape index
addChartLabel
public void addChartLabel(JCChartLabel label)
- Add a chart label
removeChartLabel
public void removeChartLabel(JCChartLabel label)
- Remove a chart label
getNumChartLabels
public int getNumChartLabels()
- Get the current number of chart labels
removeAllChartLabels
public void removeAllChartLabels()
- Remove all the chart labels
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
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.
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.
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.
setSaveParamStream
public void setSaveParamStream(OutputStream out)
- Sets the outputstream to save Chart HTML tags to.
- Parameters:
- out - the OutputStream to save params to
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'.
writeParam
public void writeParam(String param,
boolean value)
- Write the boolean HTML param tag
writeParam
public void writeParam(String param,
Date value)
- Write the date HTML param tag
writeParam
public void writeParam(String param,
Color value)
- Write the color HTML param tag
writeParam
public void writeParam(String param,
String value)
- Write the string HTML param tag
writeParam
public void writeParam(String param,
int value)
- Write the int HTML param tag
writeParam
public void writeParam(String param,
double value)
- Write the double HTML param tag
writeParam
public void writeParam(String param,
Font value)
- Write the font HTML param tag
writeParam
public void writeParam(String param,
Color orig,
Color curr)
writeParam
public void writeParam(String param,
Font orig,
Font curr)
writeParam
public void writeParam(String param,
String orig,
String curr)
writeParam
public void writeParam(String param,
boolean orig,
boolean curr)
writeParam
public void writeParam(String param,
int orig,
int curr)
writeParam
public void writeParam(String param,
double orig,
double curr)
writeParam
public void writeParam(String param,
Insets orig,
Insets curr)
writeParam
public void writeParam(String param,
JCAxis orig,
JCAxis curr)
initSaveParams
public void initSaveParams(String name)
- Writes the header for the saved HTML file
closeSaveParams
public void closeSaveParams()
- Writes the closing statements of a saved HTML file
saveParams
public void saveParams(String name)
- Save parameters from an existing chart into an equivalent HTML file
- Parameters:
- name - the PARAM NAME
loadParams
public void loadParams(String name)
- Load HTML paramters from an inputstream and create a chart
- Parameters:
- name - the PARAM NAME
main
public static void main(String args[])
All Packages Class Hierarchy This Package Previous Next Index