JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.chart
Class JCChart

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--com.klg.jclass.chart.JCChart
All Implemented Interfaces:
AncestorListener, Changeable, Changeable, EventListener, ImageObserver, com.klg.jclass.util.JCName, KeyListener, LegendComponentLayoutUser, MenuContainer, MouseListener, MouseMotionListener, RenderProperties, Serializable, com.klg.jclass.util.ServerRenderable
Direct Known Subclasses:
BaseChart, MultiChart

public class JCChart
extends JComponent
implements Changeable, LegendComponentLayoutUser, com.klg.jclass.util.ServerRenderable, Serializable, KeyListener, MouseListener, MouseMotionListener, AncestorListener, com.klg.jclass.util.JCName, RenderProperties

The core charting class. JCChart allows the retrieval of related objects, such as the chart area, the legend, the header, and the footer. Bean classes are represented by a charting class derived from JCChart.

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 antiAliasing
           
static int AREA
           
static int AREA_RADAR
           
static int BAR
           
protected  int cancelKey
           
static int CANDLE
           
protected  Applet chartApplet
           
protected  com.klg.jclass.chart.JCChartArea chartArea
           
protected  Rectangle chartAreaLayoutHints
           
protected  com.klg.jclass.chart.JCChartLabelManager chartLabelManager
           
 com.klg.jclass.chart.JCCustomizerPage customizer
           
protected  String customizerName
           
protected  Vector data
           
static String ERRMSG_INVALID_TRIGGER_INDEX
          Error message for invalid trigger index.
protected  int fillColorIndex
           
protected  JComponent footer
           
protected  com.klg.jclass.util.ImageMapInfo footerImageMapInfo
          The image map information for the footer.
protected  Rectangle footerLayoutHints
           
protected  JComponent header
           
protected  com.klg.jclass.util.ImageMapInfo headerImageMapInfo
          The image map information for the header.
protected  Rectangle headerLayoutHints
           
static int HILO
           
static int HILO_OPEN_CLOSE
           
protected  com.klg.jclass.util.ImageMapInfo imageMapInfo
          The image map information for the chart.
static int LAST_PREDEFINED_CHART_TYPE
           
protected  boolean layoutDone
           
protected  com.klg.jclass.util.legend.JCLegend legend
           
protected  Rectangle legendLayoutHints
           
protected  com.klg.jclass.chart.JCChartLegendManager legendManager
           
protected  int lineColorIndex
           
protected  com.klg.jclass.util.JCListenerList listeners
           
protected  Locale locale
           
static int NONE
          Chart Types.
protected  com.klg.jclass.util.JCListenerList pickListeners
           
static int PIE
           
static int PLOT
           
static int POLAR
           
protected  Graphics prevSetGraphics
          Temporary Graphics object used to draw without showing to screen.
protected  Graphics queryGraphics
          Temporary Graphics object created from current graphics object.
static int RADAR
           
protected  int resetKey
           
static int SCATTER_PLOT
           
static int STACKING_AREA
           
static int STACKING_BAR
           
protected  int symbolColorIndex
           
protected  int symbolShapeIndex
           
protected  Vector triggers
           
protected  Object userObject
           
protected  boolean usingDoublePixels
           
 
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 com.klg.jclass.util.RenderProperties
ANTI_ALIASING_DEFAULT, ANTI_ALIASING_OFF, ANTI_ALIASING_ON
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JCChart()
          Default constructor, required by Java Beans.
JCChart(int tp)
          Constructor that creates a JCChart of a particular type.
JCChart(int type, Locale locale)
          Constructor that creates a JCChart for a specified type and locale.
JCChart(Locale locale)
          Constructor that creates a JCChart for a specified locale and of type PLOT.
 
Method Summary
 void addChartListener(com.klg.jclass.chart.JCChartListener l)
          Adds listener to changes in chart.
 com.klg.jclass.chart.ChartDataView addDataView(int index)
          Creates a new ChartDataView and adds it to the chart at the specified index, replacing the existing ChartDataView object at that specified index.
 void addNotify()
          Overrides javax.swing.JComponent addNotify().
 void addPickListener(com.klg.jclass.chart.JCPickListener l)
          Adds listener to chart pick events.
 com.klg.jclass.chart.EventTrigger addTrigger()
          Adds a new event trigger to the Triggers property.
 com.klg.jclass.chart.EventTrigger addTrigger(int mod, int act)
          Adds a new event trigger to the Triggers property.
 void ancestorAdded(AncestorEvent e)
          Ancestor Listener method.
 void ancestorMoved(AncestorEvent e)
          Ancestor Listener method.
 void ancestorRemoved(AncestorEvent e)
          Ancestor Listener method.
 void cancel()
          Performs a cancel on the chart.
protected  void createChartArea()
          Creates and adds legend to chart.
protected  void createFooter()
          Creates and adds footer to chart.
protected  void createHeader()
          Creates and adds header to chart.
protected  void createLegend()
          Creates and adds legend to chart.
protected  Image createLocalImage(int width, int height)
          Creates image for use in drawing rotated text and other components.
 void createQueryGraphics()
          Create a copy of the current graphics object that will be used for querying only.
 JToolTip createToolTip()
          Override this method to add a dwell label to the tool tip.
 void disableChartEvents(long eventsToDisable)
          Disables the events defined by the specified event mask parameter.
 void disposeQueryGraphics()
          Dispose of the current query graphics object, which is a copy of the current graphics object that is used for querying only.
 void doLayout()
          JCChart layout method.
 void enableChartEvents(long eventsToEnable)
          Enables the events defined by the specified event mask parameter.
protected  com.klg.jclass.chart.ChartDataView findData(com.klg.jclass.chart.JCAxis ax)
          Internal convenience method that finds the first visible ChartDataView object that references a particular axis.
 com.klg.jclass.chart.ChartDataView findDataView(String name)
          Method used to find a data view, given its name.
 int findDataViewIndex(com.klg.jclass.chart.ChartDataView dv)
          Find the index within the data view collection of the specified ChartDataView.
 com.klg.jclass.chart.EventTrigger findMatchingTrigger(int mods)
          Searches through the list of event triggers looking for the one that has been attached to the specified modifier.
 void firePaint()
          Fires a paint event to interested listeners.
 String getAbout()
          Gets the value of the About property.
 boolean getAllowUserChanges()
          Gets the value of the AllowUserChanges property, which determines whether the user viewing the chart can modify chart values.
 int getAntiAliasing()
          Gets the antiAliasing value.
 int getCancelKey()
          Gets the value of the CancelKey property.
 boolean getChanged()
          Gets the value of the Changed property, which determines whether the chart requires a recalculation.
 boolean getChanged(int mask)
          Checks the value of the ChangedFlag property for the specified mask (see Changeable for a list of valid masks).
 com.klg.jclass.chart.JCChartArea getChartArea()
          Gets the value of the ChartArea property.
 com.klg.jclass.chart.JCChartLabelManager getChartLabelManager()
          Gets the JCChartLabelManager interface for managing chart labels.
 JComponent getComponentArea()
          Used to implement the LegendComponentLayoutUser interface.
 Component getComponentAt(int x, int y)
          Overrides the Container class's method to return only components that are actually showing.
 String getCustomizerName()
          Gets the value of the CustomizerName property.
 List getDataView()
          Gets the value of the DataView property, which is an indexed property that contains all the data to be displayed in the chart.
 com.klg.jclass.chart.ChartDataView getDataView(int index)
          Gets the value of the specified index within the Data property.
 Rectangle getDrawingArea()
          Gets the drawing area represented by this chart.
 void getDrawingArea(Rectangle rect)
          Gets the drawing area represented by this chart and places it in the provided rectangle.
 int getDrawingAreaHeight()
          Gets the height of the drawing area represented by this chart.
 int getDrawingAreaWidth()
          Gets the width of the drawing area represented by this chart.
 int getFillColorIndex()
          Gets the initial fill color index.
 JComponent getFooter()
          Sets the Footer property.
 com.klg.jclass.util.ImageMapInfo getFooterImageMapInfo()
          Retrieve the image map information for the footer.
 Graphics getGraphics()
          Overrides parent getGraphics().
 JComponent getHeader()
          Gets the Header property.
 com.klg.jclass.util.ImageMapInfo getHeaderImageMapInfo()
          Retrieve the image map information for the header.
 com.klg.jclass.util.ImageMapInfo getImageMapInfo()
          Retrieve the image map information for this JCChart.
 Rectangle getLayoutHints(JComponent child)
          Gets layout hints for the specified chart child.
 com.klg.jclass.util.legend.JCLegend getLegend()
          Gets the Legend property.
 String getLicense()
           
 int getLineColorIndex()
          Gets the initial line color index.
 Locale getLocale()
          Returns the chart locale.
 int getNumData()
          Gets the value of the NumData property, which indicates how many ChartDataView objects are stored in JClass Chart.
 int getNumTriggers()
          Gets the NumTriggers property, which indicates how many event triggers have been specified.
protected  List getOriginalDataView()
          Gets the actual data view collection.
 Graphics getQueryGraphics()
          Return the current query graphics object, if one exists.
 int getResetKey()
          Gets the value of the ResetKey property.
 Object getSource()
          Returns this chart as an object.
 int getSymbolColorIndex()
          Gets the initial symbol color index.
 int getSymbolShapeIndex()
          Gets the initial symbol shape index.
 Point getToolTipLocation(MouseEvent event)
          Override this method to return the location of the dwell label being brought up.
 String getToolTipText(MouseEvent event)
          Override this method to provide blank tool tip text when you want to bring up a dwell label.
 com.klg.jclass.chart.EventTrigger getTrigger(int index)
          Gets a single trigger from the Triggers property of JClass Chart.
 com.klg.jclass.chart.JCChartUI getUI()
          Returns the UI for JCChart.
 String getUIClassID()
          Returns the UIClass ID for JCChart.
 Object getUserObject()
          Get the user-specified object being stored on this instance of JClass Chart.
 boolean hasChartLabelManager()
          Returns true if a chart label manager instance has been created.
protected  void init()
          Initializes assorted chart member variables.
 boolean isBatched()
          Gets the value of the Batched property.
 boolean isChanged()
          Gets the value of the Changed property, which determines whether the chart requires a recalculation.
 boolean isChanged(int mask)
          Checks the value of the ChangedFlag property for the specified mask (see Changeable for a list of valid masks).
 boolean isFocusTraversable()
          Overrides the superclass's isFocusTraversable method to always return true, which is required to get keyPress events.
 boolean isUsingDoublePixels()
          Internal use only.
 boolean isWarningDialog()
          Gets the value of the WarningDialog property.
 void keyPressed(KeyEvent event)
          Processes keyPressed events for the chart: reset chart or cancel action as specified.
 void keyReleased(KeyEvent event)
          Processes keyReleased events for the chart: do nothing.
 void keyTyped(KeyEvent event)
          Processes keyTyped events for the chart: do nothing.
protected  void launchPropertyPage(Point p)
          Launches customizer.
static void main(String[] args)
          Main method for running chart as an application.
static com.klg.jclass.chart.JCChart makeChart(String fileName)
          Static function to allow creation of a chart from a serialized file.
protected  void moreAddNotify()
          Continues the add notify process.
 void mouseClicked(MouseEvent event)
          Processes mouseClicked events for the chart: do nothing.
 void mouseDragged(MouseEvent event)
          Processes mouseDragged events for the chart: perform associated actions.
 void mouseEntered(MouseEvent event)
          Processes mouseEntered events for the chart: do nothing.
 void mouseExited(MouseEvent event)
          Processes mouseExited events for the chart: do nothing.
 void mouseMoved(MouseEvent event)
          Processes mouseMoved events for the chart: do nothing.
 void mousePressed(MouseEvent event)
          Processes mousePressed events for the chart: request focus and perform associated actions.
 void mouseReleased(MouseEvent event)
          Processes mouseReleased events for the chart: finish associated actions.
 void paint(Graphics gc)
          Overrides the superclass's paint() method so that the chart is fully painted and flushed before the listeners are called.
protected  void paintChildren(Graphics gc)
          Overrides the superclass's method to draw chart label connectors in addition to chart children.
 void paintComponent(Graphics gc)
          The top-level paint routine in JCChart.
 com.klg.jclass.chart.JCDataIndex pick(Point p, com.klg.jclass.chart.ChartDataView data)
          Given a screen position in pixels, returns a JCDataIndex object that represents the closest point in a data series in the specified ChartDataView instance.
 void printAll(Graphics g)
          Prints this component and all of its subcomponents.
protected  void processKeyEvent(KeyEvent e)
          Processes key events on the chart.
protected  void processMouseEvent(MouseEvent e)
          Processes mouse click events on the chart.
protected  void processMouseMotionEvent(MouseEvent e)
          Processes mouse motion events on the chart.
 void recalc()
          Recalculates the entire chart if it has been marked for recalculation.
 void registerUI()
          Tells the UIManager class which class to use for JCChart.
 void removeChartListener(com.klg.jclass.chart.JCChartListener l)
          Removes listener to changes in chart from list of listeners.
 void removeDataView(int index)
          Removes a ChartDataView from the index specified.
 void removePickListener(com.klg.jclass.chart.JCPickListener l)
          Removes listener to chart pick events from list of listeners.
 void removeTrigger(int index)
          Removes the event trigger at the specified index.
protected  void reorderDataViews()
          Sets the order attribute of each attached ChartDataView object to its index in the data array.
 void requestFocus()
          Requests the input focus.
 void reset()
          Performs a reset on the chart.
 void resetDefaults()
          Resets the line, symbol, and fill color and pattern to the default index values.
 void rotate()
          A call to rotate a graph to the specified locations.
 void rotateEnd()
          A call to signify the end of a rotate event.
 void rotateStart()
          A call to signify the beginning of a rotate event.
 void scale(double sc, com.klg.jclass.chart.JCAxis axis, boolean update)
          Performs a scale operation.
protected  void sendEvent(com.klg.jclass.chart.JCAxis axis)
          Send an event to each of the chart listeners.
 void sendPickEvent(com.klg.jclass.chart.JCDataIndex di)
          Sends pick event to all objects listening for it.
 void serverPaint(Graphics igc)
          Internal use only.
 Image serverSnapshot()
          Internal use only.
 void setAbout(String s)
          Sets the value of the About property.
 void setAllowUserChanges(boolean change)
          Sets the value of the AllowUserChanges property, which determines whether the user viewing the chart can modify chart values.
 void setAntiAliasing(int antiAliasing)
          Sets the antiAliasing value.
 void setBackground(Color c)
          Overrides the superclass's method so that changes will generate redraws.
 void setBatched(boolean bt)
          Sets the value of the Batched property, which controls whether chart updates are accumulated.
 void setCancelKey(int k)
          Sets the value of the CancelKey property.
 void setChanged(boolean n, int cf)
          Sets the value of the Changed property, which determines whether the chart requires recalculation.
 void setChanged(boolean n, int cf, boolean updateParent)
          Sets the value of the Changed property, which determines whether the chart requires recalculation.
 void setChartArea(com.klg.jclass.chart.JCChartArea ca)
          Sets the value of the ChartArea property.
 void setChartLabelManager(com.klg.jclass.chart.JCChartLabelManager clm)
          Sets the ChartLabelManager property, a class that implements the JCChartLabelManager interface.
 void setCustomizerName(String s)
          Sets the value of the CustomizerName property.
 void setDataView(int index, com.klg.jclass.chart.ChartDataView ndv)
          Takes the specified ChartDataView and adds it to the chart at the index indicated.
 void setDataView(List views)
          Sets the value of the DataView property, which is an indexed property that contains all the data to be displayed in the chart.
 void setFillColorIndex(int colorIndex)
          Sets the initial fill color index.
 void setFont(Font f)
          Overrides the superclass's method so that changes will generate redraws.
 void setFooter(JComponent foot)
          Sets the Footer property.
 void setFooterImageMapInfo(com.klg.jclass.util.ImageMapInfo footerImageMapInfo)
          Set the image map information for the footer.
 void setForeground(Color c)
          Overrides the superclass's method so that changes will generate redraws.
 void setGraphics(Graphics g)
          Provides a way for the chart to draw to a custom Graphics object.
 void setHeader(JComponent head)
          Sets the Header property.
 void setHeaderImageMapInfo(com.klg.jclass.util.ImageMapInfo headerImageMapInfo)
          Set the image map information for the header.
 void setImageMapInfo(com.klg.jclass.util.ImageMapInfo imageMapInfo)
          Set the image map information for this JChart.
 void setLayoutHints(JComponent child, Rectangle layoutHints)
          Sets layout hints for chart children.
 void setLegend(com.klg.jclass.util.legend.JCLegend jl)
          Sets the Legend property.
 void setLicense(String s)
           
 void setLineColorIndex(int colorIndex)
          Sets the initial line color index.
 void setLocale(Locale locale)
          Sets the locale for chart.
 void setOpaque(boolean op)
          Overrides the superclass's method so that changes will generate redraws.
 void setResetKey(int k)
          Sets the value of the ResetKey property.
 void setSymbolColorIndex(int colorIndex)
          Sets the initial symbol color index.
 void setSymbolShapeIndex(int shapeIndex)
          Sets the initial symbol shape index.
 void setTrigger(int index, com.klg.jclass.chart.EventTrigger trig)
          Sets the value of the Trigger property at a specified index.
 void setUI(ComponentUI newUI)
          Sets the UI for JCChart.
 void setUserObject(Object userObject)
          Store an object on this instance of JClass Chart.
 void setUsingDoublePixels(boolean usingDoubles)
          Internal use only.
 void setWarningDialog(boolean on)
          Sets the value of the WarningDialog property, which controls whether a dialog will appear when the chart has warning messages.
 Image snapshot()
          Takes a snapshot of the current chart.
 void snapshot(Image img)
           
 Image snapshot(int imagetype)
          Takes a snapshot of the current chart and places it in an image of the specified type.
 void translate(double delta, com.klg.jclass.chart.JCAxis axis, boolean update)
          A call to translate a specified amount along the specified axis.
 void translateStart(com.klg.jclass.chart.JCAxis axis)
          A call to signify the start of a translate event.
 Point unpick(com.klg.jclass.chart.ChartDataView dv, int pt, int series)
          Returns the position in screen pixels of a particular point in a particular data series.
 Point unpick(int pt, com.klg.jclass.chart.ChartDataViewSeries series)
          Returns the position in screen pixels of a particular point in a particular data series.
 void update()
          Forces the chart to re-layout and recalculate.
 void updateUI()
          Updates the UI for JCChart.
 void zoom(double start, double end, com.klg.jclass.chart.JCAxis axis, boolean update)
          Performs a zoom operation along the specified axis.
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, 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, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paintBorder, paintImmediately, paintImmediately, paramString, print, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, 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, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, 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
 
Methods inherited from interface com.klg.jclass.util.legend.LegendComponentLayoutUser
getPreferredSize
 
Methods inherited from interface com.klg.jclass.util.JCName
getName, setName
 

Field Detail

chartArea

protected com.klg.jclass.chart.JCChartArea chartArea

legend

protected com.klg.jclass.util.legend.JCLegend legend

legendManager

protected com.klg.jclass.chart.JCChartLegendManager legendManager

footer

protected JComponent footer

header

protected JComponent header

data

protected Vector data

triggers

protected Vector triggers

listeners

protected com.klg.jclass.util.JCListenerList listeners

pickListeners

protected com.klg.jclass.util.JCListenerList pickListeners

chartLabelManager

protected com.klg.jclass.chart.JCChartLabelManager chartLabelManager

chartApplet

protected Applet chartApplet

userObject

protected Object userObject

imageMapInfo

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


footerImageMapInfo

protected com.klg.jclass.util.ImageMapInfo footerImageMapInfo
The image map information for the footer.


headerImageMapInfo

protected com.klg.jclass.util.ImageMapInfo headerImageMapInfo
The image map information for the header.


NONE

public static final int NONE
Chart Types.

See Also:
Constant Field Values

PLOT

public static final int PLOT
See Also:
Constant Field Values

SCATTER_PLOT

public static final int SCATTER_PLOT
See Also:
Constant Field Values

POLAR

public static final int POLAR
See Also:
Constant Field Values

RADAR

public static final int RADAR
See Also:
Constant Field Values

AREA_RADAR

public static final int AREA_RADAR
See Also:
Constant Field Values

HILO

public static final int HILO
See Also:
Constant Field Values

HILO_OPEN_CLOSE

public static final int HILO_OPEN_CLOSE
See Also:
Constant Field Values

CANDLE

public static final int CANDLE
See Also:
Constant Field Values

AREA

public static final int AREA
See Also:
Constant Field Values

BAR

public static final int BAR
See Also:
Constant Field Values

STACKING_BAR

public static final int STACKING_BAR
See Also:
Constant Field Values

PIE

public static final int PIE
See Also:
Constant Field Values

STACKING_AREA

public static final int STACKING_AREA
See Also:
Constant Field Values

LAST_PREDEFINED_CHART_TYPE

public static final int LAST_PREDEFINED_CHART_TYPE
See Also:
Constant Field Values

antiAliasing

protected int antiAliasing

ERRMSG_INVALID_TRIGGER_INDEX

public static final String ERRMSG_INVALID_TRIGGER_INDEX
Error message for invalid trigger index.

See Also:
Constant Field Values

customizerName

protected String customizerName

lineColorIndex

protected int lineColorIndex

symbolColorIndex

protected int symbolColorIndex

fillColorIndex

protected int fillColorIndex

symbolShapeIndex

protected int symbolShapeIndex

chartAreaLayoutHints

protected Rectangle chartAreaLayoutHints

legendLayoutHints

protected Rectangle legendLayoutHints

headerLayoutHints

protected Rectangle headerLayoutHints

footerLayoutHints

protected Rectangle footerLayoutHints

resetKey

protected int resetKey

cancelKey

protected int cancelKey

prevSetGraphics

protected transient Graphics prevSetGraphics
Temporary Graphics object used to draw without showing to screen.


queryGraphics

protected Graphics queryGraphics
Temporary Graphics object created from current graphics object. Used for querying only (for font metrics, for example). Created and disposed (with methods createQueryGraphics() and disposeQueryGraphics()) with each recalc/draw cycle.


locale

protected Locale locale

usingDoublePixels

protected boolean usingDoublePixels

layoutDone

protected boolean layoutDone

customizer

public transient com.klg.jclass.chart.JCCustomizerPage customizer
Constructor Detail

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(Locale locale)
Constructor that creates a JCChart for a specified locale and of type PLOT.

Parameters:
locale - the Locale object

JCChart

public JCChart(int type,
               Locale locale)
Constructor that creates a JCChart for a specified type and locale.

Parameters:
type - the chart type
locale - the Locale object
Method Detail

init

protected void init()
Initializes assorted chart member variables. Used as a convenience when writing a new JCChart constructor.


createHeader

protected void createHeader()
Creates and adds header to chart.


createFooter

protected void createFooter()
Creates and adds footer to chart.


createLegend

protected void createLegend()
Creates and adds legend to chart.


createChartArea

protected void createChartArea()
Creates and adds legend to chart.


enableChartEvents

public void enableChartEvents(long eventsToEnable)
Enables the events defined by the specified event mask parameter.

Parameters:
eventsToEnable -

disableChartEvents

public void disableChartEvents(long eventsToDisable)
Disables the events defined by the specified event mask parameter.

Parameters:
eventsToDisable -

processMouseEvent

protected void processMouseEvent(MouseEvent e)
Processes mouse click events on the chart.

Overrides:
processMouseEvent in class Component
Parameters:
e - the mouse event to process

processMouseMotionEvent

protected void processMouseMotionEvent(MouseEvent e)
Processes mouse motion events on the chart.

Overrides:
processMouseMotionEvent in class JComponent
Parameters:
e - the mouse motion event to process

processKeyEvent

protected void processKeyEvent(KeyEvent e)
Processes key events on the chart.

Overrides:
processKeyEvent in class JComponent
Parameters:
e - the key events to process

mousePressed

public void mousePressed(MouseEvent event)
Processes mousePressed events for the chart: request focus and perform associated actions.

Specified by:
mousePressed in interface MouseListener
Parameters:
event - the MouseEvent instance that represents this mouse click

mouseClicked

public void mouseClicked(MouseEvent event)
Processes mouseClicked events for the chart: do nothing.

Specified by:
mouseClicked in interface MouseListener
Parameters:
event - the MouseEvent instance that represents this mouse event

mouseReleased

public void mouseReleased(MouseEvent event)
Processes mouseReleased events for the chart: finish associated actions.

Specified by:
mouseReleased in interface MouseListener
Parameters:
event - the MouseEvent instance that represents this mouse event

mouseEntered

public void mouseEntered(MouseEvent event)
Processes mouseEntered events for the chart: do nothing.

Specified by:
mouseEntered in interface MouseListener
Parameters:
event - the MouseEvent instance that represents this mouse event

mouseExited

public void mouseExited(MouseEvent event)
Processes mouseExited events for the chart: do nothing.

Specified by:
mouseExited in interface MouseListener
Parameters:
event - the MouseEvent instance that represents this mouse event

mouseDragged

public void mouseDragged(MouseEvent event)
Processes mouseDragged events for the chart: perform associated actions.

Specified by:
mouseDragged in interface MouseMotionListener
Parameters:
event - the MouseEvent instance that represents this mouse event

mouseMoved

public void mouseMoved(MouseEvent event)
Processes mouseMoved events for the chart: do nothing.

Specified by:
mouseMoved in interface MouseMotionListener
Parameters:
event - the MouseEvent instance that represents this mouse event

keyTyped

public void keyTyped(KeyEvent event)
Processes keyTyped events for the chart: do nothing.

Specified by:
keyTyped in interface KeyListener
Parameters:
event - the KeyEvent instance that represents this keyboard event

keyPressed

public void keyPressed(KeyEvent event)
Processes keyPressed events for the chart: reset chart or cancel action as specified.

Specified by:
keyPressed in interface KeyListener
Parameters:
event - the KeyEvent instance that represents this keyboard event

keyReleased

public void keyReleased(KeyEvent event)
Processes keyReleased events for the chart: do nothing.

Specified by:
keyReleased in interface KeyListener
Parameters:
event - the KeyEvent instance that represents this keyboard event

ancestorAdded

public void ancestorAdded(AncestorEvent e)
Ancestor Listener method. Do nothing in this case.

Specified by:
ancestorAdded in interface AncestorListener
Parameters:
e - the ancestor event

ancestorMoved

public void ancestorMoved(AncestorEvent e)
Ancestor Listener method. Do nothing in this case.

Specified by:
ancestorMoved in interface AncestorListener
Parameters:
e - the ancestor event

ancestorRemoved

public void ancestorRemoved(AncestorEvent e)
Ancestor Listener method. Removes ancestor listener and repaints chart to get rid of attach lines on dwell labels.

Specified by:
ancestorRemoved in interface AncestorListener
Parameters:
e - the ancestor event

launchPropertyPage

protected void launchPropertyPage(Point p)
Launches customizer.

Parameters:
p - the point at which to launch the customizer

makeChart

public static com.klg.jclass.chart.JCChart makeChart(String fileName)
Static function to allow creation of a chart from a serialized file. The serialized file can be created by using the JClass Chart Customizer's Save As option. JDK 1.1 only.

Parameters:
fileName - the name of the serialization file
Returns:
The newly created chart.

isChanged

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

Specified by:
isChanged in interface Changeable
Returns:
The current value of the changed flag.

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 that the chart needs to take regarding the current change.

Specified by:
isChanged in interface Changeable
Parameters:
mask - the mask
Returns:
The current value of the changed flag based on the mask.

getChanged

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

Specified by:
getChanged in interface Changeable
Returns:
The current value of the changed flag.

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 regarding the current change.

Specified by:
getChanged in interface Changeable
Parameters:
mask - the mask
Returns:
The current value of the changed flag based on the mask.

recalc

public void recalc()
Recalculates the entire chart if it has been marked for recalculation.


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.

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

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.

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

paint

public void paint(Graphics gc)
Overrides the superclass's paint() method so that the chart is fully painted and flushed before the listeners are called.

Overrides:
paint in class JComponent
Parameters:
gc - the graphics context

firePaint

public void firePaint()
Fires a paint event to interested listeners.


getDrawingArea

public Rectangle getDrawingArea()
Gets the drawing area represented by this chart.

Returns:
Rectangle object containing the drawing area.

getDrawingArea

public void getDrawingArea(Rectangle rect)
Gets the drawing area represented by this chart and places it in the provided rectangle.

Parameters:
rect - Rectangle object to fill with drawing area coordinates

getDrawingAreaHeight

public int getDrawingAreaHeight()
Gets the height of the drawing area represented by this chart.

Specified by:
getDrawingAreaHeight in interface LegendComponentLayoutUser
Returns:
The current drawing area height.

getDrawingAreaWidth

public int getDrawingAreaWidth()
Gets the width of the drawing area represented by this chart.

Specified by:
getDrawingAreaWidth in interface LegendComponentLayoutUser
Returns:
The current drawing area width.

paintComponent

public void paintComponent(Graphics gc)
The top-level paint routine in JCChart.

Overrides:
paintComponent in class JComponent
Parameters:
gc - the graphics context

paintChildren

protected void paintChildren(Graphics gc)
Overrides the superclass's method to draw chart label connectors in addition to chart children.

Overrides:
paintChildren in class JComponent
Parameters:
gc - the graphics context

printAll

public void printAll(Graphics g)
Prints this component and all of its subcomponents. Overridden from java.awt.Component, but should be used in the same way.

Overrides:
printAll in class JComponent
Parameters:
g - the graphics context

doLayout

public void doLayout()
JCChart layout method. It lays out the header, footer, legend, and chart area.

Overrides:
doLayout in class Container

setLayoutHints

public void setLayoutHints(JComponent child,
                           Rectangle layoutHints)
Sets layout hints for chart children. Hints are rectangle objects. A value of Integer.MAX_VALUE in the rectangle's members indicates to calculate default values during layout. Other values indicate to the layout to use that value. For example, a rectangle with members x=5, y=10, width=MAX_VALUE, and height=200, would indicate to the layout mechanism that the chart child should be placed at (5,10), have a height of 200, and use the default width.

Layout hints are only used by the DefaultChartLayout layout manager.

Parameters:
child - chart child -- either the chartArea, legend, header, or footer
layoutHints - Rectangle object containing the desired layout hints

getLayoutHints

public Rectangle getLayoutHints(JComponent child)
Gets layout hints for the specified chart child.

Specified by:
getLayoutHints in interface LegendComponentLayoutUser
Parameters:
child - chart child -- either the chartArea, legend, header, or footer
Returns:
Rectangle object containing the desired layout hints. Null is not one of the valid children of chart.

setBatched

public void setBatched(boolean bt)
Sets the value of the Batched 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

isBatched

public boolean isBatched()
Gets the value of the Batched property.

Specified by:
isBatched in interface Changeable
Returns:
true if updates are being accumulated; false if updates are not accumulated.

setUserObject

public void setUserObject(Object userObject)
Store an object on this instance of JClass Chart. This feature can be used to store info related to a chart for later access.

Parameters:
userObject - user-specified object to store on this instance of JClass Chart.

getUserObject

public Object getUserObject()
Get the user-specified object being stored on this instance of JClass Chart.

Returns:
user-specified object being stored on this instance of JClass Chart.

update

public void update()
Forces the chart to re-layout and recalculate.


addNotify

public void addNotify()
Overrides javax.swing.JComponent addNotify().

Overrides:
addNotify in class JComponent

moreAddNotify

protected void moreAddNotify()
Continues the add notify process.


setBackground

public void setBackground(Color c)
Overrides the superclass's method so that changes will generate redraws.

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

setForeground

public void setForeground(Color c)
Overrides the superclass's method so that changes will generate redraws.

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

setFont

public void setFont(Font f)
Overrides the superclass's method so that changes will generate redraws.

Overrides:
setFont in class JComponent
Parameters:
f - the new font

setOpaque

public void setOpaque(boolean op)
Overrides the superclass's method so that changes will generate redraws.

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

setAllowUserChanges

public void setAllowUserChanges(boolean change)
Sets the value of the AllowUserChanges property, which determines whether the user viewing the chart can modify chart values. Used to allow edits to values and changes to parameters via the customizer.

Parameters:
change - true means the user is allowed to modify graph values; false means 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 chart can modify chart values. Used to allow edits to values and changes to parameters via the customizer.

Returns:
true if the user is allowed to modify the graph values, false otherwise

setWarningDialog

public void setWarningDialog(boolean on)
Sets the value of the WarningDialog property, which controls whether a dialog will appear when the chart has warning messages.

Parameters:
on - if true (default), the warning dialog will appear; if false, chart will not warn the user of anything

isWarningDialog

public boolean isWarningDialog()
Gets the value of the WarningDialog property.

Returns:
true (default) if the warning dialog is to appear; false if chart is not to warn the user of anything

getHeader

public JComponent getHeader()
Gets the Header property.

The Header property controls the object that controls the display of the header.

Specified by:
getHeader in interface LegendComponentLayoutUser
Returns:
The JComponent object associated with the header. By default, it is an instance of JLabel.

setHeader

public void setHeader(JComponent head)
Sets the Header property.

The Header property controls the object that controls the display of the header.

Parameters:
head - the JComponent object associated with the header

getFooter

public JComponent getFooter()
Sets the Footer property.

The Footer property controls the object that controls the display of the footer.

Specified by:
getFooter in interface LegendComponentLayoutUser
Returns:
The JComponent object associated with the footer. By default it is an instance of JLabel.

setFooter

public void setFooter(JComponent foot)
Sets the Footer property.

The Footer property controls the object that controls the display of the footer.

Parameters:
foot - the JComponent object associated with the footer

getLegend

public com.klg.jclass.util.legend.JCLegend getLegend()
Gets the Legend property. The Legend property controls the object that controls the display of the legend.

Specified by:
getLegend in interface LegendComponentLayoutUser
Returns:
The JCLegend object associated with the legend.

setLegend

public void setLegend(com.klg.jclass.util.legend.JCLegend jl)
Sets the Legend property.

The Legend property controls the object that controls the display of the legend. If the legend has no populator or renderer set, they will be set with JClass Chart's default legend populator and renderer.

Parameters:
jl - the JCLegend object associated with the legend

getChartArea

public com.klg.jclass.chart.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.

getComponentArea

public JComponent getComponentArea()
Used to implement the LegendComponentLayoutUser interface.

Returns the component used to draw the actual chart.

Specified by:
getComponentArea in interface LegendComponentLayoutUser
Returns:
The subcomponent used to draw the actual chart.

setChartArea

public void setChartArea(com.klg.jclass.chart.JCChartArea ca)
Sets the value of the ChartArea property. Use of this method is an unsupported feature. The ChartArea property controls the object that controls the display of the graph.

Parameters:
ca - the new JCChartArea object

getDataView

public com.klg.jclass.chart.ChartDataView getDataView(int index)
Gets the value of the specified index within 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 com.klg.jclass.chart.ChartDataView addDataView(int index)
Creates a new ChartDataView and adds it to the chart at the specified index, replacing the existing ChartDataView object at that specified index. If the index is one past the final occupied index, the ChartDataView will be added to the end of the list. Also see setDataView.

Parameters:
index - the index at which to set the new ChartDataView
Returns:
The newly created ChartDataView.

setDataView

public void setDataView(int index,
                        com.klg.jclass.chart.ChartDataView ndv)
Takes the specified ChartDataView and adds it to the chart at the index indicated. The act of adding this new ChartDataView will cause all existing ChartDataView objects to re-order themselves. Also see addDataView.

Parameters:
index - position at which to add the new object
ndv - new data view object
Throws:
IllegalArgumentException - If the index does not address a valid ChartDataView.

setDataView

public void setDataView(List views)
Sets the value of the DataView property, which is an indexed property that contains all the data to be displayed in the chart.

Parameters:
views - array of data views to be included in the DataView property

findDataView

public com.klg.jclass.chart.ChartDataView findDataView(String name)
Method used to find a data view, given its name.

Parameters:
name - the name by which to find the data view
Returns:
The ChartDataView which matches the name (null if none found).

getDataView

public List getDataView()
Gets the value of the DataView property, which is an indexed property that contains all the data to be displayed in the chart.

Returns:
An array of data views that are included in the DataView property.

getOriginalDataView

protected List getOriginalDataView()
Gets the actual data view collection. Used within the chart instead of using getDataView() in order to avoid copying.

Returns:
The current list of data views.

findDataViewIndex

public int findDataViewIndex(com.klg.jclass.chart.ChartDataView dv)
Find the index within the data view collection of the specified ChartDataView.

Parameters:
dv - The ChartDataView whose index is required.
Returns:
The index of the dataView. Returns -1 if not found.

removeDataView

public void removeDataView(int index)
Removes a ChartDataView from the index specified. The act of removing a ChartDataView to the chart 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, which indicates how many ChartDataView objects are stored in JClass Chart. It is a read-only property.

Returns:
The number of ChartDataView objects inside this JCChart instance.

getTrigger

public com.klg.jclass.chart.EventTrigger getTrigger(int index)
Gets a single trigger from the Triggers property of JClass Chart. The Triggers property is an indexed property that contains a series of mappings, from AWT events to JClass Chart 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:
The number of EventTrigger instances in the Triggers property.

addTrigger

public com.klg.jclass.chart.EventTrigger addTrigger()
Adds a new event trigger to the Triggers property.

Returns:
EventTrigger instance, to be manipulated by the developer.

addTrigger

public com.klg.jclass.chart.EventTrigger addTrigger(int mod,
                                                    int act)
Adds a new event trigger to the Triggers property.

Parameters:
mod - bitfield of modifiers from Event. Can include Event.SHIFT_MASK, Event.CTRL_MASK, Event.META_MASK, and Event.ALT_MASK. If not including META_MASK (which is the same as the third mouse button 3 mask), the bitfield is assumed to be intended to be applied to the button 1 (the left mouse button).
act - action enum, one of ROTATE, ZOOM, TRANSLATE, EDIT, PICK, DEPTH, or CUSTOMIZE.
Returns:
EventTrigger instance, or null if error occurred.

setTrigger

public void setTrigger(int index,
                       com.klg.jclass.chart.EventTrigger trig)
Sets the value of the Trigger property at a specified index. The Trigger property is an indexed property and it contains all the information necessary to map user events into JClass Chart actions. The Trigger property comprises 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

findMatchingTrigger

public com.klg.jclass.chart.EventTrigger findMatchingTrigger(int mods)
Searches through the list of event triggers looking for the one that has been attached to the specified modifier.

Parameters:
mods - the modifier being searched for
Returns:
The EventTrigger object found or null if none matches.

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.
Note: Not currently implemented.


rotate

public void rotate()
A call to rotate a graph to the specified locations.
Note: Not currently implemented.


rotateEnd

public void rotateEnd()
A call to signify the end of a rotate event.
Note: Not currently implemented.


zoom

public void zoom(double start,
                 double end,
                 com.klg.jclass.chart.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,
                  com.klg.jclass.chart.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
axis - the axis on which to perform the scale operation
update - whether or not to set the changed flag on the chart area

translateStart

public void translateStart(com.klg.jclass.chart.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,
                      com.klg.jclass.chart.JCAxis axis,
                      boolean update)
A call to translate 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.


reorderDataViews

protected void reorderDataViews()
Sets the order attribute of each attached ChartDataView object to its index in the data array.


getAbout

public String getAbout()
Gets the value of the About property. The About property displays contact information for Quest Software in the BeanBox.

Returns:
The about String.

setAbout

public void setAbout(String s)
Sets the value of the About property. The About property displays contact information for Quest Software in the BeanBox.

Parameters:
s - The new about String (ignored)

getLicense

public String getLicense()

setLicense

public void setLicense(String s)

findData

protected com.klg.jclass.chart.ChartDataView findData(com.klg.jclass.chart.JCAxis ax)
Internal convenience method that finds the first visible ChartDataView object that references a particular axis.

Parameters:
ax - axis for which the corresponding data object is to be found
Returns:
The ChartDataView that was found (null if none found).

pick

public com.klg.jclass.chart.JCDataIndex pick(Point p,
                                             com.klg.jclass.chart.ChartDataView data)
Given a screen position in pixels, returns a JCDataIndex object that 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. If the data in a data view is being updated when pick() is called, the result may be incorrect.

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 Point unpick(com.klg.jclass.chart.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,
                    com.klg.jclass.chart.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(com.klg.jclass.chart.JCChartListener l)
Adds listener to changes in chart. Called after zoom, translate, and scale (when used either through method calls or interactive triggers), as well as following rotate, depth change, or edit (interactive only).

Parameters:
l - the chart listener to be added

removeChartListener

public void removeChartListener(com.klg.jclass.chart.JCChartListener l)
Removes listener to changes in chart from list of listeners.

Parameters:
l - the chart listener to be removed

sendEvent

protected void sendEvent(com.klg.jclass.chart.JCAxis axis)
Send an event to each of the chart listeners.

Parameters:
axis - the axis to which the event pertains

addPickListener

public void addPickListener(com.klg.jclass.chart.JCPickListener l)
Adds listener to chart pick events.

Parameters:
l - the pick listener to add

removePickListener

public void removePickListener(com.klg.jclass.chart.JCPickListener l)
Removes listener to chart pick events from list of listeners.

Parameters:
l - the pick listener to remove

sendPickEvent

public void sendPickEvent(com.klg.jclass.chart.JCDataIndex di)
Sends pick event to all objects listening for it.

Parameters:
di - the data index to which the event pertains

requestFocus

public void requestFocus()
Requests the input focus. A FocusEvent will be generated to indicate that the focus has been gained.

Overrides:
requestFocus in class JComponent
See Also:
FocusEvent

isFocusTraversable

public boolean isFocusTraversable()
Overrides the superclass's isFocusTraversable method to always return true, which is required to get keyPress events.

Overrides:
isFocusTraversable in class Component
Returns:
Always returns true

resetDefaults

public void resetDefaults()
Resets 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)
Sets the initial line color index.

Parameters:
colorIndex - the new color index

setFillColorIndex

public void setFillColorIndex(int colorIndex)
Sets the initial fill color index.

Parameters:
colorIndex - the new fill color index

setSymbolColorIndex

public void setSymbolColorIndex(int colorIndex)
Sets the initial symbol color index.

Parameters:
colorIndex - the new symbol color index

setSymbolShapeIndex

public void setSymbolShapeIndex(int shapeIndex)
Sets the initial symbol shape index.

Parameters:
shapeIndex - the new symbol shape index

getLineColorIndex

public int getLineColorIndex()
Gets the initial line color index.

Returns:
The current initial line color index.

getFillColorIndex

public int getFillColorIndex()
Gets the initial fill color index.

Returns:
The current initial fill color index.

getSymbolColorIndex

public int getSymbolColorIndex()
Gets the initial symbol color index.

Returns:
The current initial symbol color index.

getSymbolShapeIndex

public int getSymbolShapeIndex()
Gets the initial symbol shape index.

Returns:
The current initial symbol shape index.

getToolTipText

public String getToolTipText(MouseEvent event)
Override this method to provide blank tool tip text when you want to bring up a dwell label. Text tells the tool tip manager to bring up the tool tip, to which the dwell label is later added.

Overrides:
getToolTipText in class JComponent
Parameters:
event - the mouse event for the tool tip
Returns:
The tool tip text.

getToolTipLocation

public Point getToolTipLocation(MouseEvent event)
Override this method to return the location of the dwell label being brought up.

Overrides:
getToolTipLocation in class JComponent
Parameters:
event - the mouse event for the tool tip
Returns:
The tool tip location.

createToolTip

public JToolTip createToolTip()
Override this method to add a dwell label to the tool tip.

Overrides:
createToolTip in class JComponent
Returns:
The newly created tool tip.

getChartLabelManager

public com.klg.jclass.chart.JCChartLabelManager getChartLabelManager()
Gets the JCChartLabelManager interface for managing chart labels. If no manager has been set and the default manager has not yet been created, calling this function will create an instance of the default manager.

Returns:
The chart label manager class.

setChartLabelManager

public void setChartLabelManager(com.klg.jclass.chart.JCChartLabelManager clm)
Sets the ChartLabelManager property, a class that implements the JCChartLabelManager interface. This method is not often used; usually the user would use the default manager provided with JClass Chart.

Parameters:
clm - a class the implements the JCChartLabelManager interface

hasChartLabelManager

public boolean hasChartLabelManager()
Returns true if a chart label manager instance has been created.

Returns:
Does this JCChart component have a chart label manager?

getCustomizerName

public String getCustomizerName()
Gets the value of the CustomizerName property. The CustomzierName property controls the name of the customizer used by JClass Chart. It must be a full class name. The default value is com.klg.jclass.chart.customizer.ChartCustomizer.

Returns:
The current customizer name.

setCustomizerName

public void setCustomizerName(String s)
Sets the value of the CustomizerName property. The CustomzierName property controls the name of the customizer used by JClass Chart. It must be a full class name. The default value is com.klg.jclass.chart.customizer.ChartCustomizer.

Parameters:
s - the new customizer name

getUI

public com.klg.jclass.chart.JCChartUI getUI()
Returns the UI for JCChart.

Returns:
The current JCChartUI objet.

setUI

public void setUI(ComponentUI newUI)
Sets the UI for JCChart.

Overrides:
setUI in class JComponent
Parameters:
newUI - the new UI object

updateUI

public void updateUI()
Updates the UI for JCChart.

Overrides:
updateUI in class JComponent

getUIClassID

public String getUIClassID()
Returns the UIClass ID for JCChart.

Overrides:
getUIClassID in class JComponent
Returns:
The current UIClassID for this component.

registerUI

public void registerUI()
Tells the UIManager class which class to use for JCChart.


getSource

public Object getSource()
Returns this chart as an object.

Returns:
This chart as an object.

getComponentAt

public Component getComponentAt(int x,
                                int y)
Overrides the Container class's method to return only components that are actually showing.

Overrides:
getComponentAt in class Container
Parameters:
x - the x position of the component
y - the y position of the component
Returns:
The component at (x,y).

snapshot

public Image snapshot()
Takes a snapshot of the current chart.

Returns:
Image object containing snapshot of chart.

snapshot

public Image snapshot(int imagetype)
Takes a snapshot of the current chart and places it in an image of the specified type. The image types are as specified in the BufferedImage class. BufferedImage.TYPE_INT_ARGB is a good default for representing many possible colors. If using less than 256 colors, BufferedImage.TYPE_BYTE_INDEXED may prove to generate faster and smaller images.

Parameters:
imagetype - the type of image to write to, as defined in the java.awt.image.BufferedImage class
Returns:
Image object containing snapshot of chart.

snapshot

public void snapshot(Image img)

createLocalImage

protected Image createLocalImage(int width,
                                 int height)
Creates image for use in drawing rotated text and other components.

Parameters:
width - the width of the new image
height - the height of the new image
Returns:
The newly created image.

getGraphics

public Graphics getGraphics()
Overrides parent getGraphics(). If another Graphics object has been set to be the current one, a copy of that will be returned. Otherwise, call the superclass' getGraphics() method.

Specified by:
getGraphics in interface com.klg.jclass.util.ServerRenderable
Overrides:
getGraphics in class JComponent
Returns:
The Graphics object to use to draw this chart.

setGraphics

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

Specified by:
setGraphics in interface com.klg.jclass.util.ServerRenderable
Parameters:
g - Graphics object to use for drawing

createQueryGraphics

public void createQueryGraphics()
Create a copy of the current graphics object that will be used for querying only. It should not be disposed directly, but only by calling disposeQueryGraphics(). This technique is used to cache a Graphics object for such things as querying FontMetrics over the course of a chart recalc/draw cycle, preventing unnecessary object creation.


disposeQueryGraphics

public void disposeQueryGraphics()
Dispose of the current query graphics object, which is a copy of the current graphics object that is used for querying only. It should not be disposed of directly, but only by calling this method. This technique is used to cache a Graphics object for such things as querying FontMetrics over the course of a chart recalc/draw cycle, preventing unnecessary object creation.


getQueryGraphics

public Graphics getQueryGraphics()
Return the current query graphics object, if one exists. Otherwise, one will be created. The query graphics object is a copy of the current graphics object that will be used for querying only. It should not be disposed directly, but only by calling disposeQueryGraphics(). This technique is used to cache a Graphics object for such things as querying FontMetrics over the course of a chart recalc/draw cycle, preventing unnecessary object creation.


serverSnapshot

public Image serverSnapshot()
Internal use only. Don't use.

Specified by:
serverSnapshot in interface com.klg.jclass.util.ServerRenderable

serverPaint

public void serverPaint(Graphics igc)
Internal use only. Don't use.

Specified by:
serverPaint in interface com.klg.jclass.util.ServerRenderable

setUsingDoublePixels

public void setUsingDoublePixels(boolean usingDoubles)
Internal use only. Don't use.

Specified by:
setUsingDoublePixels in interface RenderProperties
Parameters:
usingDoubles - The new value of usingDoubles.

isUsingDoublePixels

public boolean isUsingDoublePixels()
Internal use only. Don't use.

Specified by:
isUsingDoublePixels in interface RenderProperties
Returns:
true, if the component computes its pixel values using doubles.

getAntiAliasing

public int getAntiAliasing()
Gets the antiAliasing value. This value determines whether antiAliasing is on when painting the chart and all its subcomponents. If set to ANTI_ALIASING_ON or ANTI_ALIASING_OFF, the anti aliasing rendering hint will be explicity turned on or off on the graphics object used by the chart to paint its children. If set to ANTI_ALIASING_DEFAULT, the graphics object will be untouched with respect to anti aliasing when the chart is painted.

Specified by:
getAntiAliasing in interface RenderProperties
Returns:
The current antiAliasing value.

setAntiAliasing

public void setAntiAliasing(int antiAliasing)
Sets the antiAliasing value. This value determines whether antiAliasing is on when painting the chart and all its subcomponents. If set to ANTI_ALIASING_ON or ANTI_ALIASING_OFF, the anti aliasing rendering hint will be explicity turned on or off on the graphics object used by the chart to paint its children. If set to ANTI_ALIASING_DEFAULT, the graphics object will be untouched with respect to anti aliasing when the chart is painted.

Specified by:
setAntiAliasing in interface RenderProperties
Parameters:
antiAliasing - The new antiAliasing value.

getImageMapInfo

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

Returns:
The current image map information.

setImageMapInfo

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

Parameters:
imageMapInfo - The new image map information.

getFooterImageMapInfo

public com.klg.jclass.util.ImageMapInfo getFooterImageMapInfo()
Retrieve the image map information for the footer.

Returns:
The current footer image map information.

setFooterImageMapInfo

public void setFooterImageMapInfo(com.klg.jclass.util.ImageMapInfo footerImageMapInfo)
Set the image map information for the footer.

Parameters:
footerImageMapInfo - The new footer image map information.

getHeaderImageMapInfo

public com.klg.jclass.util.ImageMapInfo getHeaderImageMapInfo()
Retrieve the image map information for the header.

Returns:
The current header image map information.

setHeaderImageMapInfo

public void setHeaderImageMapInfo(com.klg.jclass.util.ImageMapInfo headerImageMapInfo)
Set the image map information for the header.

Parameters:
headerImageMapInfo - The new header image map information.

setLocale

public void setLocale(Locale locale)
Sets the locale for chart. This will also set the locale for all children of the chart (chart area, legend, header, footer, chart labels) and pertinent formatting classes, but default names generated under the old locale (such as the names of data views and axes) will not be changed. Also, auto label chart labels will not regenerate their text.

Overrides:
setLocale in class Component
Parameters:
locale - the Locale object
See Also:
Locale

getLocale

public Locale getLocale()
Returns the chart locale.

Overrides:
getLocale in class Component
Returns:
Locale The chart locale

main

public static void main(String[] args)
Main method for running chart as an application.

Parameters:
args - the command line arguments

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