JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.chart
Class JCChartArea

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--com.klg.jclass.chart.ChartRegion
                          |
                          +--com.klg.jclass.chart.JCChartArea
All Implemented Interfaces:
Changeable, Changeable, ImageObserver, MenuContainer, Serializable

public class JCChartArea
extends ChartRegion

Class controlling the charting region in the Chart instance. JCChartArea handles rendering of the charts by using JCAxis and ChartDataView object instances to determine how data is plotted. A single JCChartArea can plot several ChartDataView objects against a number of axes. JCChartArea is a Swing-based component and should behave accordingly. It is transparent by default, meaning that the Opaque property must be set to true if any background color is to be drawn.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  int angleUnit
           
protected  boolean axisBoundingBox
           
protected  boolean axisDrawOkay
           
 Hashtable axisHashtable
          Hash table containing axes.
protected  Rectangle backplane
           
protected  Rectangle chartAreaRect
           
 int deltaX
           
 int deltaY
           
protected  int depth
           
 boolean draw3D
           
protected  int elevation
           
static String ERRMSG_INVALID_XAXIS_INDEX
          Error message for invalid x axis index.
static String ERRMSG_INVALID_YAXIS_INDEX
          Error message for invalid y axis index.
protected  boolean fastAction
           
protected  com.klg.jclass.chart.ActionHandler handler
           
 boolean hasBar
           
protected  com.klg.jclass.chart.JCAxis horizActionAxis
           
protected  com.klg.jclass.util.ImageMapInfo imageMapInfo
          The image map information for the JCChartArea.
protected  boolean inAction
           
protected  boolean inSuperReshape
           
protected static int INVALID_INDEX
           
protected  Point last
           
static int MAX_DEPTH
          Maximum depth value.
static int MAX_ELEVATION
          Maximum elevation value.
static int MAX_ROTATION
          Maximum rotation value.
 boolean pieFirst
           
 Rectangle plotRect
           
protected  com.klg.jclass.chart.PolarAxisParams polarChartParams
           
 boolean polarFirst
           
 boolean radarFirst
           
protected  Graphics rbGC
          Non-property public methods.
protected  int rotation
           
protected  boolean saveDBState
           
protected  int symbolPad
           
protected  com.klg.jclass.chart.JCAxis vertActionAxis
           
protected  Vector xaxes
           
protected  Vector yaxes
           
 
Fields inherited from class com.klg.jclass.chart.ChartRegion
cellRendererPane, changed, changedFlag, preferredSize, updateParent
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface com.klg.jclass.chart.Changeable
BASIC_CHANGE_MASK, NOTIFY_AXES_RECALC, NOTIFY_AXES_REDRAW, NOTIFY_CA_RECALC, NOTIFY_CA_REDRAW, NOTIFY_LEGEND_RECALC, NOTIFY_LEGEND_REDRAW
 
Fields inherited from interface com.klg.jclass.util.Changeable
LAYOUT, NO_CHANGE, NOTIFY_PARENT_LAYOUT, RECALC, REDRAW
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JCChartArea()
          Constructs a chart area for the provided chart.
JCChartArea(Locale locale)
           
 
Method Summary
protected  void adjustForPolarAnnoExtents(com.klg.jclass.chart.JCAxis ax, com.klg.jclass.chart.Deltas chartDeltas)
          Applies delta values to the center coordinates and radius of a Polar or Radar chart.
Called in layoutChartArea() to keep the axis annotations within view.
protected  void calcAnchors(List axes)
          Calculates the annotation anchor positions for the provided axis objects.
protected  void calcLimits()
          Calculates the data limits and axis limits.
protected  void cancel()
          Performs a cancel operation.
protected  void checkAxisVertical()
          Can't have inverted axes for Polar/Radar charts.
protected  void clearDrawables()
          Sets the drawable to null and resets hashtable.
protected  void clearLimits()
          Clears the data limits.
 void drawRubberBand(Point p, Point start)
          Method that draws a rubber band rectangle from the point in "start" to the provided point.
 void drawRubberLine(Point start, Point end)
          Method used to draw a rubber band line on the chart area.
 com.klg.jclass.chart.JCAxis findAxisByName(String axisName)
          Finds an axis by searching for it using the specified name.
protected  com.klg.jclass.chart.JCAxis findAxisByName(String axisName, boolean x)
          Searches for the axis with the specified name.
 com.klg.jclass.chart.ActionHandler getActionHandler()
          Gets the action handler for this chart area.
 int getAngleUnit()
          Gets the value of the AngleUnit property.
 boolean getAxisBoundingBox()
          Gets the value of the AxisBoundingBox property.
protected  int getBiggestSymbolSize()
          Finds the biggest symbols size of all data views to be drawn in this chart area.
 boolean getChanged()
          Gets the value of the Changed property.
 Rectangle getChartAreaRect()
          Returns the current Rectangle representing the chart area.
protected  com.klg.jclass.chart.ChartDataView getDataView(int index)
           
protected  Iterator getDataViews()
           
 int getDeltaX()
          Gets the value of the DeltaX property.
 int getDeltaY()
          Gets the value of the DeltaY property.
 int getDepth()
          Gets the Depth property, which controls the apparent depth of a graph.
 boolean getDraw3D()
          Gets the value of the Draw3D property, which determines whether the chart area will attempt to draw chart types as 3D chart types.
 com.klg.jclass.chart.ChartDraw getDrawable(com.klg.jclass.chart.ChartDataView dataObject)
          Given a data view object, finds the corresponding drawable.
 int getElevation()
          Gets the Elevation property, which controls distance above the x axis for the 3D effect.
 boolean getFastAction()
          Gets the value of the FastAction property.
protected  com.klg.jclass.chart.ChartDataView getFirstVisibleDataView()
          This method returns the first visible data view.
 Graphics getGraphics()
          Overrides parent getGraphics().
 boolean getHasBar()
          Gets the value of the HasBar property.
 com.klg.jclass.chart.JCAxis getHorizActionAxis()
          Gets the value of the HorizActionAxis property.
 com.klg.jclass.util.ImageMapInfo getImageMapInfo()
          Retrieve the image map information for this JCChartArea.
 boolean getInAction()
          Gets the value of the InAction property, which is a flag that determines whether an action is in process.
 Dimension getMinimumSize()
          Returns the minimum size for the chart area.
 com.klg.jclass.chart.PlotArea getPlotArea()
          Gets the value of the PlotArea property, which represents the region of the ChartArea that is inside the axes.
 Rectangle getPlotRect()
          Returns the current Rectangle representing the plotting region in chart area.
protected  void getPolarChartDeltas(com.klg.jclass.chart.ChartDataView dv, com.klg.jclass.chart.Deltas chartDeltas)
          Computes size and position offsets needed to keep the axis annotations of a Polar or Radar chart in view.
 Dimension getPreferredSize()
          Returns the preferred size for the chart area.
 int getRotation()
          Gets the Rotation property, which controls the position of the eye relative to the y axis for the 3D effect.
 com.klg.jclass.chart.JCAxis getVertActionAxis()
          Gets the value of the VertActionAxis property.
 List getXAxes()
          Gets the value of the XAxes property.
 com.klg.jclass.chart.JCAxis getXAxis(int index)
          Gets the value of the XAxis property at a specified index.
 List getYAxes()
          Gets the value of the YAxes property.
 com.klg.jclass.chart.JCAxis getYAxis(int index)
          Gets the value of the YAxis property at a specified index.
protected  boolean hasMatchingDrawable(com.klg.jclass.chart.ChartDataView dataObject)
          Checks to see if the specified ChartDataView object has a Drawable.
 boolean isDirty()
          Determines if the data is "dirty" (that is, if the data has changed since the last redisplay).
protected  boolean isPolar()
           
protected  boolean isPolarRadar()
           
protected  boolean isRadar()
           
protected  boolean isWebShaped(com.klg.jclass.chart.JCAxis ax)
           
protected  void layoutAnnotations(List axes)
          Layout annotation for the given axes list.
 void layoutChartArea()
          Positions axes and calculates the true plot area size based on the position of the axes.
 void paintComponent(Graphics gc)
          Renders the JCChartArea contents.
protected  com.klg.jclass.chart.JCDataIndex pick(Point p, com.klg.jclass.chart.ChartDataView data, int focus)
          Chooses the point closest to the provided position.
protected  void printErrorMessages(String text1, String text2, String[] messages)
           
 void recalc()
          If necessary, forces recalculation of the chart area.
protected  void removeDrawable(com.klg.jclass.chart.ChartDataView dataObject)
          Removes the Drawable created for the specified ChartDataView object.
 void repaint()
          Overrides the superclass's method in order to avoid repaint if super.setBounds() is called.
protected  void reset()
          Performs a reset operation.
 void setAngleUnit(int unit)
          Sets the value of the AngleUnit property.
 void setAxisBoundingBox(boolean bb)
          Sets the value of the AxisBoundingBox property.
 void setBackground(Color bg)
          Overrides setBackground to make sure entire chart is redrawn if background is set on this subcomponent.
Note that the Opaque property needs to be set to true for the background color to be visible.
 void setBounds(int x, int y, int w, int h)
          An overridden setBounds() method, which makes sure that the Changed property is set and that a recalc occurs as a result of the reshape.
 void setChanged(boolean n, int cf)
          Sets the value of the Changed property.
 void setDeltaX(int dx)
          Sets the value of the DeltaX property.
 void setDeltaY(int dy)
          Sets the value of the DeltaY property.
 void setDepth(int newDepth)
          Sets the Depth property, which controls the apparent depth of a graph.
 void setElevation(int newElevation)
          Sets the Elevation property, which controls distance above the x axis for the 3D effect.
 void setFastAction(boolean fr)
          Sets the value of the FastAction property.
 void setForeground(Color c)
          Overrides setForeground to make sure legend is marked for redraw.
 void setGraphics(Graphics g)
          Provides a way for the chart area to draw to a custom Graphics object.
 void setHorizActionAxis(com.klg.jclass.chart.JCAxis ax)
          Sets the value of the HorizActionAxis property.
 void setImageMapInfo(com.klg.jclass.util.ImageMapInfo imageMapInfo)
          Set the image map information for this JCChartArea.
 void setInAction(boolean ia)
          Sets the value of the InAction property, which is a flag that determines whether an action is in process.
 void setOpaque(boolean op)
          Overrides setOpaque to make sure entire chart is redrawn if opacity is set on this subcomponent.
protected  void setParentOnAxes(com.klg.jclass.chart.JCChart chart)
          Sets the parent chart for all children axes.
 void setRotation(int newRotation)
          Sets the Rotation property, which controls the position of the eye relative to the y axis for the 3D effect.
 void setVertActionAxis(com.klg.jclass.chart.JCAxis ax)
          Sets the value of the VertActionAxis property.
 void setXAxes(List ax)
          Sets the value of the XAxes property.
 void setXAxis(int index, com.klg.jclass.chart.JCAxis ax)
          Sets the value of the XAxis property at a specified index.
 void setYAxes(List ay)
          Sets the value of the YAxes property.
 void setYAxis(int index, com.klg.jclass.chart.JCAxis ax)
          Sets the value of the YAxis property at a specified index.
 
Methods inherited from class com.klg.jclass.chart.ChartRegion
getCellRendererPane, getChanged, getDrawingArea, getDrawingArea, isBatched, isChanged, isChanged, setChanged, setPreferredSize, updateParent
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, resize, resize, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_ELEVATION

public static final int MAX_ELEVATION
Maximum elevation value.

See Also:
Constant Field Values

MAX_ROTATION

public static final int MAX_ROTATION
Maximum rotation value.

See Also:
Constant Field Values

MAX_DEPTH

public static final int MAX_DEPTH
Maximum depth value.

See Also:
Constant Field Values

ERRMSG_INVALID_XAXIS_INDEX

public static final String ERRMSG_INVALID_XAXIS_INDEX
Error message for invalid x axis index.

See Also:
Constant Field Values

ERRMSG_INVALID_YAXIS_INDEX

public static final String ERRMSG_INVALID_YAXIS_INDEX
Error message for invalid y axis index.

See Also:
Constant Field Values

INVALID_INDEX

protected static final int INVALID_INDEX
See Also:
Constant Field Values

xaxes

protected Vector xaxes

yaxes

protected Vector yaxes

angleUnit

protected int angleUnit

horizActionAxis

protected com.klg.jclass.chart.JCAxis horizActionAxis

vertActionAxis

protected com.klg.jclass.chart.JCAxis vertActionAxis

axisBoundingBox

protected boolean axisBoundingBox

fastAction

protected boolean fastAction

inAction

protected boolean inAction

depth

protected int depth

elevation

protected int elevation

rotation

protected int rotation

imageMapInfo

protected com.klg.jclass.util.ImageMapInfo imageMapInfo
The image map information for the JCChartArea.


axisHashtable

public transient Hashtable axisHashtable
Hash table containing axes.


chartAreaRect

protected Rectangle chartAreaRect

plotRect

public Rectangle plotRect

polarChartParams

protected com.klg.jclass.chart.PolarAxisParams polarChartParams

deltaX

public int deltaX

deltaY

public int deltaY

draw3D

public boolean draw3D

hasBar

public boolean hasBar

axisDrawOkay

protected boolean axisDrawOkay

pieFirst

public boolean pieFirst

polarFirst

public boolean polarFirst

radarFirst

public boolean radarFirst

backplane

protected Rectangle backplane

symbolPad

protected int symbolPad

handler

protected transient com.klg.jclass.chart.ActionHandler handler

saveDBState

protected transient boolean saveDBState

rbGC

protected Graphics rbGC
Non-property public methods.


last

protected Point last

inSuperReshape

protected boolean inSuperReshape
Constructor Detail

JCChartArea

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


JCChartArea

public JCChartArea(Locale locale)
Method Detail

setParentOnAxes

protected void setParentOnAxes(com.klg.jclass.chart.JCChart chart)
Sets the parent chart for all children axes. This used to be done in addNotify, but the axes (especially in the beans) need to know their parent chart before addNotify() is finally called. Hence, this is now called manually in JCChartArea immediately following an add.

Parameters:
chart - the parent JCChart instance

setForeground

public void setForeground(Color c)
Overrides setForeground to make sure legend is marked for redraw. (Needed for outline color of swatches, which is derived from ChartArea.)

Overrides:
setForeground in class JComponent
Parameters:
c - the new foreground color

setBackground

public void setBackground(Color bg)
Overrides setBackground to make sure entire chart is redrawn if background is set on this subcomponent.
Note that the Opaque property needs to be set to true for the background color to be visible. JCChartArea is transparent by default.

Overrides:
setBackground in class JComponent
Parameters:
bg - the new background color

setOpaque

public void setOpaque(boolean op)
Overrides setOpaque to make sure entire chart is redrawn if opacity is set on this subcomponent.

Overrides:
setOpaque in class JComponent
Parameters:
op - the new value of the opaque property

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.

Returns:
the current angle unit

setAngleUnit

public 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.

getXAxis

public com.klg.jclass.chart.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 void setXAxis(int index,
                     com.klg.jclass.chart.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.

setXAxes

public void setXAxes(List ax)
Sets the value of the XAxes property. The XAxes property is a collection of all the x axes for the chart area.

Parameters:
ax - collection of JCAxis objects to be used for the x axes
Since:
JClass 4.0K for Java 2. If you are using JClass 4.0J, which is based on JDK 1.1, this field's or method's return type is based on the corresponding com.sun.java.util class.

getXAxes

public List getXAxes()
Gets the value of the XAxes property. The XAxes property is a collection of all the x axes for the chart area.

Returns:
collection of JCAxis objects to be used for the x axes
Since:
JClass 4.0K for Java 2. If you are using JClass 4.0J, which is based on JDK 1.1, this field's or method's return type is based on the corresponding com.sun.java.util class.

getYAxis

public com.klg.jclass.chart.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 void setYAxis(int index,
                     com.klg.jclass.chart.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.

setYAxes

public void setYAxes(List ay)
Sets the value of the YAxes property. The YAxes property is a collection of all the y axes for the chart area.

Parameters:
ay - collection of JCAxis objects to be used for the y axes
Since:
JClass 4.0K for Java 2. If you are using JClass 4.0J, which is based on JDK 1.1, this field's or method's return type is based on the corresponding com.sun.java.util class.

getYAxes

public List getYAxes()
Gets the value of the YAxes property. The YAxes property is a collection of all the y axes for the chart area.

Returns:
collection of JCAxis objects to be used for the y axes
Since:
JClass 4.0K for Java 2. If you are using JClass 4.0J, which is based on JDK 1.1, this field's or method's return type is based on the corresponding com.sun.java.util class.

setHorizActionAxis

public void setHorizActionAxis(com.klg.jclass.chart.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 com.klg.jclass.chart.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 void setVertActionAxis(com.klg.jclass.chart.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 com.klg.jclass.chart.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 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
See Also:
PlotArea.setForeground(java.awt.Color)

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 gridlines and axis annotations will be absent during the action; otherwise, false

setFastAction

public 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 gridlines and axis annotations will be absent during the action; otherwise, false

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 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; valid values are 0 - 500

getElevation

public int getElevation()
Gets the Elevation property, which controls distance above the x axis for the 3D effect.

Returns:
the number of degrees above the x axis

setElevation

public void setElevation(int newElevation)
Sets the Elevation property, which controls distance above the x axis for the 3D effect.

Parameters:
newElevation - the number of degrees above the x axis; valid values are between -45 and 45

getRotation

public int getRotation()
Gets the Rotation property, which controls the position of the eye relative to the y axis for the 3D effect.

Returns:
the number of degrees to the right of the y axis

setRotation

public void setRotation(int newRotation)
Sets the Rotation property, which controls the position of the eye relative to the y axis for the 3D effect.

Parameters:
newRotation - the number of degrees to the right of the Y-axis; valid values are between -45 and 45

getImageMapInfo

public com.klg.jclass.util.ImageMapInfo getImageMapInfo()
Retrieve the image map information for this JCChartArea.

Returns:
The current image map information.

setImageMapInfo

public void setImageMapInfo(com.klg.jclass.util.ImageMapInfo imageMapInfo)
Set the image map information for this JCChartArea.

Parameters:
imageMapInfo - The new image map information.

getChanged

public boolean getChanged()
Gets the value of the Changed property. The Changed property determines whether the chart area requires a recalculation.

Specified by:
getChanged in interface Changeable
Overrides:
getChanged in class ChartRegion
Returns:
the current value of the changed flag

setChanged

public void setChanged(boolean n,
                       int cf)
Sets the value of the Changed property. The Changed property determines whether the chart area requires a recalculation.

Specified by:
setChanged in interface Changeable
Overrides:
setChanged in class ChartRegion
Parameters:
n - boolean value of the Changed property
cf - the changed flag to add in

getPlotArea

public com.klg.jclass.chart.PlotArea getPlotArea()
Gets the value of the PlotArea property, which represents the region of the ChartArea that is inside the axes.

Returns:
the current plot area

printErrorMessages

protected void printErrorMessages(String text1,
                                  String text2,
                                  String[] messages)

paintComponent

public void paintComponent(Graphics gc)
Renders the JCChartArea contents.

Overrides:
paintComponent in class ChartRegion
Parameters:
gc - graphics context used for drawing

getPreferredSize

public Dimension getPreferredSize()
Returns the preferred size for the chart area.

Overrides:
getPreferredSize in class ChartRegion
Returns:
the current preferred size

getMinimumSize

public Dimension getMinimumSize()
Returns the minimum size for the chart area.

Overrides:
getMinimumSize in class JComponent
Returns:
the current minimum size

checkAxisVertical

protected void checkAxisVertical()
Can't have inverted axes for Polar/Radar charts. If the chart type of the first data view is Polar/Radar, set the i_vertical flags of the axes to appropriate values.


recalc

public void recalc()
If necessary, forces recalculation of the chart area.


layoutChartArea

public void layoutChartArea()
Positions axes and calculates the true plot area size based on the position of the axes.


adjustForPolarAnnoExtents

protected void adjustForPolarAnnoExtents(com.klg.jclass.chart.JCAxis ax,
                                         com.klg.jclass.chart.Deltas chartDeltas)
Applies delta values to the center coordinates and radius of a Polar or Radar chart.
Called in layoutChartArea() to keep the axis annotations within view.

Parameters:
ax - the axis to which this applies
chartDeltas - object containing delta values to be applied

getDataViews

protected Iterator getDataViews()

getFirstVisibleDataView

protected com.klg.jclass.chart.ChartDataView getFirstVisibleDataView()
This method returns the first visible data view. If none exist, the method returns null.

Returns:
the first visible data view

getDataView

protected com.klg.jclass.chart.ChartDataView getDataView(int index)

isPolar

protected boolean isPolar()

isRadar

protected boolean isRadar()

isPolarRadar

protected boolean isPolarRadar()

getPolarChartDeltas

protected void getPolarChartDeltas(com.klg.jclass.chart.ChartDataView dv,
                                   com.klg.jclass.chart.Deltas chartDeltas)
Computes size and position offsets needed to keep the axis annotations of a Polar or Radar chart in view.

Parameters:
dv - a ChartDataView object
chartDeltas - object to contain the x, y, and radius delta values

isWebShaped

protected boolean isWebShaped(com.klg.jclass.chart.JCAxis ax)

getBiggestSymbolSize

protected int getBiggestSymbolSize()
Finds the biggest symbols size of all data views to be drawn in this chart area.

Returns:
the size of the biggest symbol

isDirty

public boolean isDirty()
Determines if the data is "dirty" (that is, if 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.

setBounds

public void setBounds(int x,
                      int y,
                      int w,
                      int h)
An overridden setBounds() method, which makes sure that the Changed property is set and that a recalc occurs as a result of the reshape. This overridden reshape doesn't do a repaint(); it is up to the caller to make a proper repaint call so that all of the chart children get redrawn in the correct order.

Overrides:
setBounds in class Component
Parameters:
x - the new x-coordinate of this component
y - the new y-coordinate of this component
w - the new width of this component
h - the new height of this component

repaint

public void repaint()
Overrides the superclass's method in order to avoid repaint if super.setBounds() is called.

Overrides:
repaint in class Component

getDeltaX

public int getDeltaX()
Gets the value of the DeltaX property. The DeltaX property controls the shift in the x direction to create the 3D effect in 3D chart types. It is derived from elevation, rotation, and depth, and should only be set by drawables and other internal classes that need to modify the delta in certain cases.

Returns:
number of pixels to shift in the x direction

setDeltaX

public void setDeltaX(int dx)
Sets the value of the DeltaX property. The DeltaX property controls the shift in the x direction to create the 3D effect in 3D chart types. It is derived from elevation, rotation, and depth, and should only be set by drawables and other internal classes that need to modify the delta in certain cases.

Parameters:
dx - number of pixels to shift in the x direction

getDeltaY

public int getDeltaY()
Gets the value of the DeltaY property. The DeltaY property controls the shift in the y direction to create the 3D effect in 3D chart types. It is derived from elevation, rotation, and depth, and should only be set by drawables and other internal classes that need to modify the delta in certain cases.

Returns:
number of pixels to shift in the y direction

setDeltaY

public void setDeltaY(int dy)
Sets the value of the DeltaY property. The DeltaY property controls the shift in the y direction to create the 3D effect in 3D chart types. It is derived from elevation, rotation, and depth, and should only be set by drawables and other internal classes that need to modify the delta in certain cases.

Parameters:
dy - number of pixels to shift in the y direction

getDraw3D

public boolean getDraw3D()
Gets the value of the Draw3D property, which determines whether the chart area will attempt to draw chart types as 3D chart types.

Returns:
true if 3D drawing will be attempted

getHasBar

public boolean getHasBar()
Gets the value of the HasBar property. The HasBar property determines whether the chart area includes a bar chart (bar or stacking bar).

Returns:
true if the chart area includes a bar chart type

getPlotRect

public Rectangle getPlotRect()
Returns the current Rectangle representing the plotting region in chart area.

Returns:
the plotting region rectangle

getChartAreaRect

public Rectangle getChartAreaRect()
Returns the current Rectangle representing the chart area. This is the same as getDrawingArea().

Returns:
the chart area rectangle

getActionHandler

public com.klg.jclass.chart.ActionHandler getActionHandler()
Gets the action handler for this chart area. The action handler handles the interactions for this chart area.

Returns:
the current action handler

getInAction

public boolean getInAction()
Gets the value of the InAction property, which is a flag that determines whether an action is in process.

Returns:
Is an action in progress?

setInAction

public void setInAction(boolean ia)
Sets the value of the InAction property, which is a flag that determines whether an action is in process.

Parameters:
ia - if set to true, an action is now in process

findAxisByName

public com.klg.jclass.chart.JCAxis findAxisByName(String axisName)
Finds an axis by searching for it using the specified name.

Parameters:
axisName - the name to search for
Returns:
the found JCAxis instance, or null if no matching axis is found.

findAxisByName

protected com.klg.jclass.chart.JCAxis findAxisByName(String axisName,
                                                     boolean x)
Searches for the axis with the specified name.

Parameters:
axisName - the name of the axis to search for
x - if true, will search the x axis list; if false, will search the y axis list
Returns:
the axis that was found; null if none is found

layoutAnnotations

protected void layoutAnnotations(List axes)
Layout annotation for the given axes list.

Parameters:
axes - the list of axes for which to layout annotations

removeDrawable

protected void removeDrawable(com.klg.jclass.chart.ChartDataView dataObject)
Removes the Drawable created for the specified ChartDataView object.

Parameters:
dataObject - ChartDataView object for which the Drawable is to be removed

clearDrawables

protected void clearDrawables()
Sets the drawable to null and resets hashtable.


hasMatchingDrawable

protected boolean hasMatchingDrawable(com.klg.jclass.chart.ChartDataView dataObject)
Checks to see if the specified ChartDataView object has a Drawable.

Parameters:
dataObject - ChartDataView object to check
Returns:
if true, a Drawable exists for the dataObject; if false, no Drawable exists for the dataObject

getDrawable

public com.klg.jclass.chart.ChartDraw getDrawable(com.klg.jclass.chart.ChartDataView dataObject)
Given a data view object, finds the corresponding drawable.

Parameters:
dataObject - data view object
Returns:
drawable corresponding to the provided data view object

calcAnchors

protected void calcAnchors(List axes)
Calculates the annotation anchor positions for the provided axis objects.

Parameters:
axes - vector of axis objects

calcLimits

protected void calcLimits()
Calculates the data limits and axis limits.


clearLimits

protected void clearLimits()
Clears the data limits.


cancel

protected void cancel()
Performs a cancel operation.


reset

protected void reset()
Performs a reset operation.


drawRubberBand

public void drawRubberBand(Point p,
                           Point start)
Method that draws a rubber band rectangle from the point in "start" to the provided point.

Parameters:
p - coordinates to use as the end point for the rectangle
start - the start point

drawRubberLine

public void drawRubberLine(Point start,
                           Point end)
Method used to draw a rubber band line on the chart area.

Parameters:
start - the start point of the line
end - the end point of the line

pick

protected com.klg.jclass.chart.JCDataIndex pick(Point p,
                                                com.klg.jclass.chart.ChartDataView data,
                                                int focus)
Chooses the point closest to the provided position. If a data view is supplied, picks a point on the provided data view only. Otherwise, tries to find the closest point from any data view.

Parameters:
p - pick point in pixels relative to JCChartArea object
data - data view on which to perform pick. If null, all data views are used.
focus - pick focus used to determine distance between point and data point. If equal to ChartDataView.PICK_FOCUS_LOCAL, the pick focus specified in the appropriate ChartDataView object will be used.
Returns:
JCDataIndex object representing the picked point.

getGraphics

public Graphics getGraphics()
Overrides parent getGraphics(). If another Graphics object has been set to be the current one, it is returned; otherwise, the superclass's getGraphics() method is called.

Overrides:
getGraphics in class JComponent
Returns:
the Graphics object to use to draw this chart area

setGraphics

public void setGraphics(Graphics g)
Provides a way for the chart area to draw to a custom Graphics object. Call with null to specify use of the default Graphics object used to draw to the screen.

Parameters:
g - Graphics object to use for drawing

Copyright © 2004 Quest Software Inc..
All rights reserved.