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