All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jclass.chart.JCChartArea

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

public class JCChartArea
extends ChartCanvas
JCChartArea controls the charting region in the Chart instance. The JCChartArea handles rendering of the charts by using JCAxis and ChartGroup object instances to determine how data is plotted. A single JCChartArea can plot several ChartGroups against a number of axes.

Properties

Name Method
IsShowing If true, the ChartCanvas will appear on the screen. If false, it will not appear on the screen. (Note that legend, header, footer and chart area are all ChartCanvas instances). Default value is true.
BorderType Determines the style of border drawn around the ChartCanvas. 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. (Note that legend, header, footer and chart area are all ChartCanvas instances). Default value is BWTEnum.SHADOW_IN.
BorderWidth The BorderWidth property determines the width of the border drawn around the canvas. (Note that legend, header, footer and chart area are all ChartCanvas instances). Default value is 2.
AngleUnit The AngleUnit property determines the unit of all angle values. Default value is DEGREES.
XAxis The XAxis property is an indexed property that contains all the x axes for the chart area. Default value is one x axis.
YAxis The YAxis property is an indexed property that contains all the y axes for the chart area. Default value is one y axis.
HorizActionAxis The HorizActionAxis property determines the axis used for actions (zooming, translating) in the horizontal direction. Default value is null.
VertActionAxis The VertActionAxis property determines the axis used for actions (zooming, translating) in the vertical direction. Default value is null.
AxisBoundingBox The AxisBoundingBox property determines whether a box is drawn around the area bound by the inner axes.
FastAction The FastAction property determines whether chart actions will use an optimized mode in which it does not bother to display axis annotations or gridlines. Default value is false.
Depth The Depth property controls the apparent depth of a graph. Default value is 0.0.
Elevation The Elevation property controls distance from the x axis. Default value is 0.0.
Rotation The Rotation property controls the position of the eye relative to the y axis. Default value is 0.0.
Top The Top property determines the location of the top of the ChartCanvas. The default value is calculated.
TopIsDefault The TopIsDefault property determines whether the top position of the chart canvas is calculated by Chart (true) or taken from the Top property (false). Default value is false.
Left The Left property determines the location of the left of the ChartCanvas. The default value is calculated.
LeftIsDefault The LeftIsDefault property determines whether the left position of the chart canvas is calculated by Chart (true) or taken from the Left property (false). Default value is false.
Width The Width property determines the width of the ChartCanvas. The default value is calculated.
WidthIsDefault The WidthIsDefault property determines whether the width of the chart canvas is calculated by Chart (true) or taken from the Width property (false). Default value is false.
Height The Height property determines the height of the ChartCanvas. The default value is calculated.
HeightIsDefault The HeightIsDefault property determines whether the height of the chart canvas is calculated by Chart (true) or taken from the Height property (false). Default value is false.
PlotArea The PlotArea property is a ChartRegion object that models the plot area margins around


Constructor Index

 o JCChartArea()
Constructs a chart area for the provided chart.

Method Index

 o getAngleUnit()
Gets the value of the AngleUnit property.
 o getAxisBoundingBox()
Gets the value of the AxisBoundingBox property.
 o getChanged()
Gets the value of the Changed property.
 o getDepth()
Gets the Depth property, which controls the apparent depth of a graph.
 o getElevation()
Gets the Elevation property, which controls distance from the x axis.
 o getFastAction()
Gets the value of the FastAction property.
 o getHorizActionAxis()
Gets the value of the HorizActionAxis property.
 o getMarker(int)
Gets a single value from the Markers property.
 o getMarkers()
Gets the value of the Markers property.
 o getPlotArea()
Gets the value of the PlotArea property.
 o getReentrance()
 o getRotation()
Gets the Rotation property, which controls the position of the eye relative to the y axis.
 o getVertActionAxis()
Gets the value of the VertActionAxis property.
 o getXAxis()
Gets the value of the XAxis property.
 o getXAxis(int)
Gets the value of the XAxis property at a specified index.
 o getYAxis()
Gets the value of the YAxis property.
 o getYAxis(int)
Gets the value of the YAxis property at a specified index.
 o isDirty()
Determines if the data is "dirty" (ie the data has changed since the last redisplay).
 o keyDown(Event, int)
ChartArea processes key events in order to reset the view when "r" is hit.
 o layoutChartArea()
Positions axes and calculates the true plot area size based on the position of the axes.
 o minimumSize()
Returns the minimum size for the chart area.
 o mouseDown(Event, int, int)
ChartArea processes mouseDown events by creating the appropriate handler based on the modifier, then calling the handler's start method
 o mouseDrag(Event, int, int)
ChartArea processes mouseDrag events in order to show a rubber band rectangle around a possible zoom area.
 o mouseUp(Event, int, int)
ChartArea processes mouseUp events by calling the end method in the current action handler.
 o paintComponent(Graphics)
Responsible for rendering the JCChartArea contents.
 o preferredSize()
Returns the preferred size for the chart area.
 o recalc()
If necessary, forces recalculation of the chart area.
 o repaint()
Need to avoid repaint if super.reshape() called.
 o reshape(int, int, int, int)
An overridden reshape() method, which makes sure that the Changed property is set and that a recalc occurs as a result of the reshape.
 o setAngleUnit(int)
Sets the value of the AngleUnit property.
 o setAxisBoundingBox(boolean)
Sets the value of the AxisBoundingBox property.
 o setChanged(boolean)
Sets the value of the Changed property.
 o setDepth(int)
Sets the Depth property, which controls the apparent depth of a graph.
 o setElevation(int)
Sets the Elevation property, which controls distance from the x axis.
 o setFastAction(boolean)
Sets the value of the FastAction property.
 o setHorizActionAxis(JCAxis)
Sets the value of the HorizActionAxis property.
 o setReentrance(boolean)
 o setRotation(int)
Sets the Rotation property, which controls the position of the eye relative to the y axis.
 o setVertActionAxis(JCAxis)
Sets the value of the VertActionAxis property.
 o setXAxis(int, JCAxis)
Sets the value of the XAxis property at a specified index.
 o setXAxis(JCAxis[])
Sets the value of the XAxis property.
 o setYAxis(int, JCAxis)
Sets the value of the YAxis property at a specified index.
 o setYAxis(JCAxis[])
Sets the value of the YAxis property.

Constructors

 o JCChartArea
 public JCChartArea()
Constructs a chart area for the provided chart.

Methods

 o getAngleUnit
 public int getAngleUnit()
Gets the value of the AngleUnit property. The AngleUnit property determines the unit of all angle values in this chart area. One of DEGREES, RADIANS or GRADS.

 o setAngleUnit
 public synchronized void setAngleUnit(int unit)
Sets the value of the AngleUnit property. The AngleUnit property determines the unit of all angle values in this chart area. One of DEGREES, RADIANS or GRADS.

Parameters:
unit - unit value
Throws: IllegalArgumentException
If the unit isn't one of DEGREES, RADIANS or GRADS.
 o getMarkers
 public JCMarker[] getMarkers()
Gets the value of the Markers property. The Markers property is an indexed property that controls the markers that appear on a particular JCChartArea instance. JCChartArea will pre-allocate an array of JCMarkers. Initially, the markers will have their axis and series properties set to null, so the markers will not appear.

Returns:
array of JCMarker instances
 o getMarker
 public JCMarker getMarker(int index)
Gets a single value from the Markers property. The Markers property is an indexed property that controls the markers that appear on a particular JCChartArea instance. JCChartArea will pre-allocate an array of JCMarkers. Initially, the markers will have their axis and series properties set to null, so the markers will not appear.

Parameters:
index - index of JCMarker instance
Returns:
JCMarker instance
 o getXAxis
 public JCAxis getXAxis(int index)
Gets the value of the XAxis property at a specified index. The XAxis property is an indexed property, and contains all the x axes for the chart area.

Parameters:
index - index of the JCAxis object
Returns:
JCAxis object at the specified index
 o setXAxis
 public synchronized void setXAxis(int index,
                                   JCAxis ax)
Sets the value of the XAxis property at a specified index. The XAxis property is an indexed property, and contains all the x axes for the chart area.

Parameters:
index - index of the JCAxis object
ax - JCAxis object to place at the specified index
Throws: IllegalArgumentException
If the index does not address a valid x axis object.
 o setXAxis
 public synchronized void setXAxis(JCAxis ax[])
Sets the value of the XAxis property. The XAxis property is an indexed property, and contains all the x axes for the chart area.

Parameters:
ax - Array of JCAxis objects to be used for the x axies.
 o getXAxis
 public JCAxis[] getXAxis()
Gets the value of the XAxis property. The XAxis property is an indexed property, and contains all the x axes for the chart area.

Returns:
Array of JCAxis objects to be used for the x axies.
 o getYAxis
 public JCAxis getYAxis(int index)
Gets the value of the YAxis property at a specified index. The YAxis property is an indexed property, and contains all the y axes for the chart area.

Parameters:
index - index of the JCAxis object
Returns:
JCAxis object at the specified index
 o setYAxis
 public synchronized void setYAxis(int index,
                                   JCAxis ax)
Sets the value of the YAxis property at a specified index. The YAxis property is an indexed property, and contains all the y axes for the chart area.

Parameters:
index - index of the JCAxis object
ax - JCAxis object to place at the specified index
Throws: IllegalArgumentException
If the index does not address a valid y axis object.
 o setYAxis
 public synchronized void setYAxis(JCAxis ax[])
Sets the value of the YAxis property. The YAxis property is an indexed property, and contains all the y axes for the chart area.

Parameters:
ax - Array of JCAxis objects to be used for the y axes.
 o getYAxis
 public JCAxis[] getYAxis()
Gets the value of the YAxis property. The YAxis property is an indexed property, and contains all the y axes for the chart area.

Returns:
Array of JCAxis objects to be used for the y axes.
 o setHorizActionAxis
 public synchronized void setHorizActionAxis(JCAxis ax)
Sets the value of the HorizActionAxis property. The HorizActionAxis property determines the axis used for actions (zooming, translating) in the horizontal direction.

Parameters:
ax - JCAxis object to use for chart actions in the horizontal direction.
Throws: IllegalArgumentException
If the provided axis is vertical or if it isn't in the list of x or y axes.
 o getHorizActionAxis
 public JCAxis getHorizActionAxis()
Gets the value of the HorizActionAxis property. The HorizActionAxis property determines the axis used for actions (zooming, translating) in the horizontal direction.

Returns:
JCAxis object to use for chart actions in the horizontal direction.
 o setVertActionAxis
 public synchronized void setVertActionAxis(JCAxis ax)
Sets the value of the VertActionAxis property. The VertActionAxis property determines the axis used for actions (zooming, translating) in the vertical direction.

Parameters:
ax - JCAxis object to use for chart actions in the vertical direction.
Throws: IllegalArgumentException
If the provided axis is horizontal or if it isn't in the list of x or y axes.
 o getVertActionAxis
 public JCAxis getVertActionAxis()
Gets the value of the VertActionAxis property. The VertActionAxis property determines the axis used for actions (zooming, translating) in the horizontal direction.

Returns:
JCAxis object to use for chart actions in the vertical direction.
 o setAxisBoundingBox
 public synchronized void setAxisBoundingBox(boolean bb)
Sets the value of the AxisBoundingBox property. The AxisBoundingBox property determines whether a box is drawn around the area bound by the inner axes.

Parameters:
bb - If true, bounding box is drawn. Otherwise, box is not drawn.
 o getAxisBoundingBox
 public boolean getAxisBoundingBox()
Gets the value of the AxisBoundingBox property. The AxisBoundingBox property determines whether a box is drawn around the area bound by the inner axes.

Returns:
If true, bounding box is drawn. Otherwise, box is not drawn.
 o getFastAction
 public boolean getFastAction()
Gets the value of the FastAction property. The FastAction property determines whether chart actions will use an optimized mode in which it does not bother to display axis annotations or gridlines.

Returns:
true if grid lines and axis annotations will be absent during the action, false otherwise.
 o setFastAction
 public synchronized void setFastAction(boolean fr)
Sets the value of the FastAction property. The FastAction property determines whether chart actions will use an optimized mode in which it does not bother to display axis annotations or gridlines.

Parameters:
fr - true if grid lines and axis annotations will be absent during the action, false otherwise.
 o getDepth
 public int getDepth()
Gets the Depth property, which controls the apparent depth of a graph.

Returns:
the depth as a percentage of the width
 o setDepth
 public synchronized void setDepth(int newDepth)
Sets the Depth property, which controls the apparent depth of a graph.

Parameters:
NewDepth - the depth as a percentage of the width
 o getElevation
 public int getElevation()
Gets the Elevation property, which controls distance from the x axis.

Returns:
the number of degrees above the X axis
 o setElevation
 public synchronized void setElevation(int newElevation)
Sets the Elevation property, which controls distance from the x axis.

Parameters:
NewElevation - the number of degrees above the X axis
 o getRotation
 public int getRotation()
Gets the Rotation property, which controls the position of the eye relative to the y axis.

Returns:
the number of degrees to the right of the y axis
 o setRotation
 public synchronized void setRotation(int newRotation)
Sets the Rotation property, which controls the position of the eye relative to the y axis.

Parameters:
NewRotation - the number of degrees to the right of the y axis
 o getChanged
 public boolean getChanged()
Gets the value of the Changed property. The Changed property determines whether the chart area requires a recalculation.

Overrides:
getChanged in class ChartCanvas
 o setReentrance
 public void setReentrance(boolean nv)
 o getReentrance
 public boolean getReentrance()
 o setChanged
 public void setChanged(boolean n)
Sets the value of the Changed property. The Changed property determines whether the chart area requires a recalculation.

Overrides:
setChanged in class ChartCanvas
 o getPlotArea
 public PlotArea getPlotArea()
Gets the value of the PlotArea property. The PlotArea property is a ChartRegion object that models the plot area margins around

 o paintComponent
 public synchronized void paintComponent(Graphics gc)
Responsible for rendering the JCChartArea contents.

Parameters:
gc - graphics context used for drawing
Overrides:
paintComponent in class ChartCanvas
 o preferredSize
 public Dimension preferredSize()
Returns the preferred size for the chart area.

Overrides:
preferredSize in class ChartCanvas
 o minimumSize
 public Dimension minimumSize()
Returns the minimum size for the chart area.

Overrides:
minimumSize in class ChartCanvas
 o recalc
 public void recalc()
If necessary, forces recalculation of the chart area.

Overrides:
recalc in class ChartCanvas
 o layoutChartArea
 public void layoutChartArea()
Positions axes and calculates the true plot area size based on the position of the axes.

 o isDirty
 public boolean isDirty()
Determines if the data is "dirty" (ie the data has changed since the last redisplay).

Returns:
if true, the data has changed. If false, the data has not changed. Takes all ChartDataView objects into account.
 o reshape
 public void reshape(int x,
                     int y,
                     int w,
                     int h)
An overridden reshape() method, which makes sure that the Changed property is set and that a recalc occurs as a result of the reshape.

Overrides:
reshape in class ChartCanvas
 o repaint
 public void repaint()
Need to avoid repaint if super.reshape() called.

Overrides:
repaint in class ChartCanvas
 o mouseDrag
 public boolean mouseDrag(Event evt,
                          int x,
                          int y)
ChartArea processes mouseDrag events in order to show a rubber band rectangle around a possible zoom area.

Overrides:
mouseDrag in class Component
 o mouseDown
 public boolean mouseDown(Event evt,
                          int x,
                          int y)
ChartArea processes mouseDown events by creating the appropriate handler based on the modifier, then calling the handler's start method

Overrides:
mouseDown in class JCComponent
 o mouseUp
 public boolean mouseUp(Event evt,
                        int x,
                        int y)
ChartArea processes mouseUp events by calling the end method in the current action handler.

Overrides:
mouseUp in class Component
 o keyDown
 public boolean keyDown(Event evt,
                        int key)
ChartArea processes key events in order to reset the view when "r" is hit.

Overrides:
keyDown in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index