com.ijchart.xychart.client
Class ChartPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.ijchart.xychart.client.ChartPanel
All Implemented Interfaces:
IChartChangeListener, IChartProgressListener, IChartShapeChangeListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

public class ChartPanel
extends javax.swing.JPanel
implements IChartChangeListener, IChartShapeChangeListener, IChartProgressListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.io.Serializable

Title: IJChart

Description: a chart library for the Java(tm) platform.

A Swing GUI component for displaying a IJChart object. The panel registers with the chart to receive notification of changes to any component of the chart.The chart is redrawn automatically whenever this notification is received.

Copyright: Copyright (c) 2013

Company:

Version:
1.0
Author:
zhang feng min,shanghai china. Contract me by email.
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static boolean DEFAULT_FILL_ZOOM_RECTANGLE
           The default flag controls if the zoom rectangle is drawn as a border or filled.
static int DEFAULT_HEIGHT
           The default panel heigh.
static boolean DEFAULT_HORIZONTAL_AXIS_TRACE
           A default flag that controls whether or not horizontal tracing is enabled.
static int DEFAULT_MAXIMUM_DRAW_HEIGHT
           The default limit below which chart scaling kicks in.
static int DEFAULT_MAXIMUM_DRAW_WIDTH
           The default limit below which chart scaling kicks in.
static int DEFAULT_MINIMUM_DRAW_HEIGHT
           The default limit below which chart scaling kicks in.
static int DEFAULT_MINIMUM_DRAW_WIDTH
           The default limit below which chart scaling kicks in.
static boolean DEFAULT_VERTICAL_AXIS_TRACE
           A default flag that controls whether or not vertical tracing is enabled.
static int DEFAULT_WIDTH
           The default panel width..
static java.awt.Paint DEFAULT_ZOOM_BORDER_PAINT
           The default paint used to draw the zoom rectangle outline.
static java.awt.Paint DEFAULT_ZOOM_FILL_PAINT
           The default paint used to fill the zoom rectangle.
static double DEFAULT_ZOOM_IN_FACTOR
           The default factor used to zoom in on an axis range.
static double DEFAULT_ZOOM_OUT_FACTOR
           The default factor used to zoom out on an axis range.
static int DEFAULT_ZOOM_TRIGGER_DISTANCE
           The minimum size required to perform a zoom on a rectangle.
static boolean DEFAULT_ZOOMABLE
           Default zoomable.
 
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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ChartPanel(IJChart chart)
           Constructor.
ChartPanel(IJChart chart, boolean showTooltips)
           Constructor.
ChartPanel(IJChart chart, int width, int height, int minimumDrawWidth, int minimumDrawHeight, boolean showTooltips)
           Constructor.
 
Method Summary
 void addChartMouseListener(IChartMouseListener listener)
           Adds a listener.
 void addShowTooltipShapeType(ChartShapeDrawType drawType)
           Add a shape type to display tooltip.
 void chartChanged(ChartChangeEvent event)
           Receives notification of changes to the chart, and redraws the chart.
 void chartProgress(ChartProgressEvent event)
           Receives notification of a chart progress event.
 void chartShapeChanged(ChartShapeChangeEvent event)
           Receives notification of an IChartShape change event.
 void clearShowTooltipShapeType()
           Clear all shape types to display tooltip.
 boolean getAntiAlias()
           Returns a flag that indicates whether or not anti-aliasing is used when the chart is drawn.
 IJChart getChart()
           Returns the chart contained in the panel.
 int getDismissDelay()
           Returns the dismiss tooltip delay to be used in this chart panel.
 boolean getHorizontalAxisTrace()
           Returns the flag that controls whether or not horizontal tracing is enabled.
 java.awt.geom.Line2D getHorizontalTraceLine()
           Returns the horizontal trace line.
 int getInitialDelay()
           Returns the initial tooltip delay to be used in this chart panel.
 java.util.EventListener[] getListeners(java.lang.Class listenerType)
           Returns an array of the listeners of the given type registered with the panel.
 double getMinimumDrawHeight()
           Returns the minimum height for drawing a chart.
 double getMinimumDrawWidth()
           Returns the minimum width for drawing a chart.
 java.awt.Point getMouseClickPoint()
           Returns the mouse click point (null permitted).
 java.awt.RenderingHints getRenderingHints()
           Returns the collection of rendering hints for the chart.
 int getReshowDelay()
           Returns the reshow tooltip delay to be used in this chart panel.
 double getScaleX()
           Returns the X scale factor for the chart.
 double getScaleY()
           Returns the Y scale factor for the chart.
 java.awt.geom.Rectangle2D getScreenDataArea()
           Returns the data area for the chart with the current scaling applied.
 java.awt.geom.Rectangle2D getScreenDataArea(int x, int y)
           Returns the data area for the chart with the current scaling applied.
 IChartShape getShapeForPoint(java.awt.geom.Point2D point)
           Returns the shape which contains the specified point.
 IChartShape getShapeForPoint(java.awt.geom.Point2D point, ChartShapeDrawType drawType)
           Returns the shape which contains the specified point.
 java.util.List getShowTooltipShapeTypeList()
           Returns all shape types to display tooltip.
 java.lang.Object getTextAntiAlias()
           Returns the current value stored in the rendering hints table for RenderingHints.KEY_TEXT_ANTIALIASING.
 java.lang.String getToolTipText(java.awt.event.MouseEvent event)
           Returns the tooltip text.
protected  java.awt.geom.Line2D getVerticalTraceLine()
           Returns the vertical trace line.
 java.awt.Paint getZoomBorderPaint()
           Returns the paint used to draw the zoom rectangle border.
 java.awt.Paint getZoomFillPaint()
           Returns the paint used to fill the zoom rectangle.
 double getZoomInFactor()
           Returns the zoom in factor.
 double getZoomOutFactor()
           Returns the zoom out factor.
 double getZoomTriggerDistance()
           Returns the minimum distance required to drag the mouse to trigger a zoom.
 boolean isDomainZoomable()
           Returns the flag that controls whether or not domain axis zooming is enabled.
 boolean isFillZoomRectangle()
           Returns whether or not the zoom rectangle is filled.
 boolean isRefreshBuffer()
           Returns the flag that indicates that the buffer should be refreshed.
 boolean isValueZoomable()
           Returns the flag that controls whether or not value axis zooming is enabled.
 boolean isVerticalAxisTrace()
           Returns the flag that controls whether or not vertical tracing is enabled.
 boolean isZoomable()
           Returns controls whether or not zoomable.
 void mouseClicked(java.awt.event.MouseEvent event)
           Invoked when the mouse button has been clicked (pressed and released) on a component.
 void mouseDragged(java.awt.event.MouseEvent event)
           Invoked when a mouse button is pressed on a component and then dragged.
 void mouseEntered(java.awt.event.MouseEvent event)
           Invoked when the mouse enters a component.
 void mouseExited(java.awt.event.MouseEvent event)
           Invoked when the mouse exits a component.
 void mouseMoved(java.awt.event.MouseEvent event)
           Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed.
 void mousePressed(java.awt.event.MouseEvent event)
           Invoked when a mouse button has been pressed on a component.
 void mouseReleased(java.awt.event.MouseEvent event)
           Invoked when a mouse button has been released on a component.
 void paintComponent(java.awt.Graphics g)
           Drawing the chart.
 void removeChartMouseListener(IChartMouseListener listener)
           Removes a listener.
 void removeShowTooltipShapeType(ChartShapeDrawType drawType)
           Remove a shape type to display tooltip.
 void restoreAutoBounds()
           Restores the auto-range calculation on both axes.
 void restoreAutoDomainBounds()
           Restores the auto-range calculation on the category axis.
 void restoreAutoValueBounds()
           Restores the auto-range calculation on the value axis.
 java.awt.geom.Rectangle2D scale(java.awt.geom.Rectangle2D rect)
           Applies any scaling that is in effect for the chart drawing to the given rectangle.
 void setAntiAlias(boolean flag)
           Sets a flag that indicates whether or not anti-aliasing is used when the chart is drawn.
 void setChart(IJChart chart)
           Sets the chart that is displayed in the panel.
 void setDismissDelay(int delay)
           Sets the dismiss tooltip delay to be used in this chart panel.
 void setDisplayToolTips(boolean flag)
           Sets whether or not show tooltips.
 void setDomainZoomable(boolean flag)
           Sets the flag that controls whether or not domain axis zooming is enabled.
 void setFillZoomRectangle(boolean flag)
           Sets the flag that controls whether or not the zoom rectangle is filled.
 void setHorizontalAxisTrace(boolean flag)
           Sets the flag that controls whether or not horizontal tracing is enabled.
 void setHorizontalTraceLine(java.awt.geom.Line2D line)
           Sets the horizontal trace line.
 void setInitialDelay(int delay)
           Sets the initial tooltip delay to be used in this chart panel.
 void setMinimumDrawHeight(double height)
           Sets the minimum height for drawing a chart.
 void setMinimumDrawWidth(double width)
           Sets the minimum width for drawing a chart.
 void setMouseZoomable(boolean flag)
           A convenience method that switches on mouse-based zooming.
 void setMouseZoomable(boolean flag, boolean fillRectangle)
           A convenience method that switches on mouse-based zooming.
 void setRefreshBuffer(boolean flag)
           Sets the flag that indicates that the buffer should be refreshed.
 void setRenderingHints(java.awt.RenderingHints renderingHints)
           Sets the rendering hints for the chart,and sends a ChartChangeEvent to all registered listeners.
 void setReshowDelay(int delay)
           Sets the reshow tooltip delay to be used in this chart panel.
 void setTextAntiAlias(boolean flag)
           Sets the value in the rendering hints table for RenderingHints.KEY_TEXT_ANTIALIASING to either RenderingHints.VALUE_TEXT_ANTIALIAS_ON or RenderingHints.VALUE_TEXT_ANTIALIAS_OFF, then sends a ChartChangeEvent to all registered listeners.
 void setTextAntiAlias(java.lang.Object val)
           Sets the value in the rendering hints table for RenderingHints.KEY_TEXT_ANTIALIASING to either RenderingHints.VALUE_TEXT_ANTIALIAS_ON or RenderingHints.VALUE_TEXT_ANTIALIAS_OFF, then sends a ChartChangeEvent to all registered listeners.
 void setValueZoomable(boolean flag)
           Sets the flag that controls whether or not value axis zooming is enabled.
 void setVerticalAxisTrace(boolean flag)
           Sets the flag that controls whether or not vertical tracing is enabled.
protected  void setVerticalTraceLine(java.awt.geom.Line2D line)
           Sets the vertical trace line.
 void setZoomable(boolean flag)
           Sets controls whether or not zoomable and sends a RenderChangeEvent to all registered listeners.
 void setZoomBorderPaint(java.awt.Paint paint)
           Sets the paint used to draw the zoom rectangle border.
 void setZoomFillPaint(java.awt.Paint paint)
           Sets the paint used to fill the zoom rectangle border.
 void setZoomInFactor(double factor)
           Returns the zoom in factor.
 void setZoomOutFactor(double factor)
           Sets the zoom out factor.
 void setZoomTriggerDistance(double distance)
           Sets the minimum distance required to drag the mouse to trigger a zoom.
 java.awt.geom.Point2D translateJava2DToScreen(java.awt.geom.Point2D java2DPoint)
           Translates a Java2D point on the chart to a screen location..
 java.awt.geom.Point2D translateScreenToJava2D(java.awt.geom.Point2D screenPoint)
           Translates a panel (component) location to a Java2D point.
 void zoom(java.awt.geom.Rectangle2D selection)
           Zooms in on a selected region.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, 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

DEFAULT_WIDTH

public static final int DEFAULT_WIDTH
The default panel width..

See Also:
Constant Field Values

DEFAULT_HEIGHT

public static final int DEFAULT_HEIGHT
The default panel heigh.

See Also:
Constant Field Values

DEFAULT_MINIMUM_DRAW_WIDTH

public static final int DEFAULT_MINIMUM_DRAW_WIDTH
The default limit below which chart scaling kicks in.

See Also:
Constant Field Values

DEFAULT_MINIMUM_DRAW_HEIGHT

public static final int DEFAULT_MINIMUM_DRAW_HEIGHT
The default limit below which chart scaling kicks in.

See Also:
Constant Field Values

DEFAULT_MAXIMUM_DRAW_WIDTH

public static final int DEFAULT_MAXIMUM_DRAW_WIDTH
The default limit below which chart scaling kicks in.

See Also:
Constant Field Values

DEFAULT_MAXIMUM_DRAW_HEIGHT

public static final int DEFAULT_MAXIMUM_DRAW_HEIGHT
The default limit below which chart scaling kicks in.

See Also:
Constant Field Values

DEFAULT_ZOOM_TRIGGER_DISTANCE

public static final int DEFAULT_ZOOM_TRIGGER_DISTANCE
The minimum size required to perform a zoom on a rectangle.

See Also:
Constant Field Values

DEFAULT_ZOOM_IN_FACTOR

public static final double DEFAULT_ZOOM_IN_FACTOR
The default factor used to zoom in on an axis range.

See Also:
Constant Field Values

DEFAULT_ZOOM_OUT_FACTOR

public static final double DEFAULT_ZOOM_OUT_FACTOR
The default factor used to zoom out on an axis range.

See Also:
Constant Field Values

DEFAULT_VERTICAL_AXIS_TRACE

public static final boolean DEFAULT_VERTICAL_AXIS_TRACE
A default flag that controls whether or not vertical tracing is enabled.

See Also:
Constant Field Values

DEFAULT_HORIZONTAL_AXIS_TRACE

public static final boolean DEFAULT_HORIZONTAL_AXIS_TRACE
A default flag that controls whether or not horizontal tracing is enabled.

See Also:
Constant Field Values

DEFAULT_FILL_ZOOM_RECTANGLE

public static final boolean DEFAULT_FILL_ZOOM_RECTANGLE
The default flag controls if the zoom rectangle is drawn as a border or filled.

See Also:
Constant Field Values

DEFAULT_ZOOM_BORDER_PAINT

public static final java.awt.Paint DEFAULT_ZOOM_BORDER_PAINT
The default paint used to draw the zoom rectangle outline.


DEFAULT_ZOOM_FILL_PAINT

public static final java.awt.Paint DEFAULT_ZOOM_FILL_PAINT
The default paint used to fill the zoom rectangle.


DEFAULT_ZOOMABLE

public static final boolean DEFAULT_ZOOMABLE
Default zoomable.

See Also:
Constant Field Values
Constructor Detail

ChartPanel

public ChartPanel(IJChart chart)
Constructor.

Parameters:
chart - IJChart The IJChart object.

ChartPanel

public ChartPanel(IJChart chart,
                  boolean showTooltips)
Constructor.

Parameters:
chart - IJChart The IJChart object.
showTooltips - boolean Whether or not show tooltips.

ChartPanel

public ChartPanel(IJChart chart,
                  int width,
                  int height,
                  int minimumDrawWidth,
                  int minimumDrawHeight,
                  boolean showTooltips)
Constructor.

Parameters:
chart - IJChart The IJChart object.
width - int The width.
height - int The height.
minimumDrawWidth - int The minimum drawing width.
minimumDrawHeight - int The minimum drawing height.
showTooltips - boolean Whether or not show tooltips.
Method Detail

getChart

public IJChart getChart()
Returns the chart contained in the panel.

Returns:
The chart (maybe null).

setChart

public void setChart(IJChart chart)
Sets the chart that is displayed in the panel.

Parameters:
chart - IJChart The chart (null permitted).

getMinimumDrawWidth

public double getMinimumDrawWidth()
Returns the minimum width for drawing a chart.

Returns:
double The minimum drawing width.

setMinimumDrawWidth

public void setMinimumDrawWidth(double width)
Sets the minimum width for drawing a chart.

Parameters:
width - double The width.

getMinimumDrawHeight

public double getMinimumDrawHeight()
Returns the minimum height for drawing a chart.

Returns:
double The minimum drawing height.

setMinimumDrawHeight

public void setMinimumDrawHeight(double height)
Sets the minimum height for drawing a chart.

Parameters:
height - double The height.

getScaleX

public double getScaleX()
Returns the X scale factor for the chart. This will be 1.0 if no scaling has been used.

Returns:
double The scale factor.

getScaleY

public double getScaleY()
Returns the Y scale factor for the chart. This will be 1.0 if no scaling has been used.

Returns:
double The scale factor.

setMouseZoomable

public void setMouseZoomable(boolean flag)
A convenience method that switches on mouse-based zooming.

Parameters:
flag - boolean A boolean.

setMouseZoomable

public void setMouseZoomable(boolean flag,
                             boolean fillRectangle)
A convenience method that switches on mouse-based zooming.

Parameters:
flag - boolean A boolean.
fillRectangle - boolean true if zoom rectangle is filled,false if rectangle is shown as outline only.

isDomainZoomable

public boolean isDomainZoomable()
Returns the flag that controls whether or not domain axis zooming is enabled.

Returns:
boolean A boolean.

setDomainZoomable

public void setDomainZoomable(boolean flag)
Sets the flag that controls whether or not domain axis zooming is enabled.

Parameters:
flag - boolean A boolean.

isValueZoomable

public boolean isValueZoomable()
Returns the flag that controls whether or not value axis zooming is enabled.

Returns:
boolean A boolean.

setValueZoomable

public void setValueZoomable(boolean flag)
Sets the flag that controls whether or not value axis zooming is enabled.

Parameters:
flag - boolean A boolean.

getZoomBorderPaint

public java.awt.Paint getZoomBorderPaint()
Returns the paint used to draw the zoom rectangle border.

Returns:
Paint The paint (never null).

setZoomBorderPaint

public void setZoomBorderPaint(java.awt.Paint paint)
Sets the paint used to draw the zoom rectangle border.

Parameters:
paint - Paint The paint (null not permitted).

getZoomFillPaint

public java.awt.Paint getZoomFillPaint()
Returns the paint used to fill the zoom rectangle.

Returns:
Paint The paint (never null).

setZoomFillPaint

public void setZoomFillPaint(java.awt.Paint paint)
Sets the paint used to fill the zoom rectangle border.

Parameters:
paint - Paint The paint (null not permitted).

isFillZoomRectangle

public boolean isFillZoomRectangle()
Returns whether or not the zoom rectangle is filled.

Returns:
boolean A boolean.

setFillZoomRectangle

public void setFillZoomRectangle(boolean flag)
Sets the flag that controls whether or not the zoom rectangle is filled.

Parameters:
flag - boolean A boolean.

getZoomTriggerDistance

public double getZoomTriggerDistance()
Returns the minimum distance required to drag the mouse to trigger a zoom.

Returns:
double The distance.

setZoomTriggerDistance

public void setZoomTriggerDistance(double distance)
Sets the minimum distance required to drag the mouse to trigger a zoom.

Parameters:
distance - double The distance.

getHorizontalAxisTrace

public boolean getHorizontalAxisTrace()
Returns the flag that controls whether or not horizontal tracing is enabled.

Returns:
boolean A boolean.

setHorizontalAxisTrace

public void setHorizontalAxisTrace(boolean flag)
Sets the flag that controls whether or not horizontal tracing is enabled.

Parameters:
flag - boolean A boolean.

getHorizontalTraceLine

public java.awt.geom.Line2D getHorizontalTraceLine()
Returns the horizontal trace line.

Returns:
Line2D The line (maybe null).

setHorizontalTraceLine

public void setHorizontalTraceLine(java.awt.geom.Line2D line)
Sets the horizontal trace line.

Parameters:
line - Line2D The line (null permitted).

isVerticalAxisTrace

public boolean isVerticalAxisTrace()
Returns the flag that controls whether or not vertical tracing is enabled.

Returns:
boolean A boolean.

setVerticalAxisTrace

public void setVerticalAxisTrace(boolean flag)
Sets the flag that controls whether or not vertical tracing is enabled.

Parameters:
flag - boolean A boolean.

getVerticalTraceLine

protected java.awt.geom.Line2D getVerticalTraceLine()
Returns the vertical trace line.

Returns:
Line2D The line (maybe null).

setVerticalTraceLine

protected void setVerticalTraceLine(java.awt.geom.Line2D line)
Sets the vertical trace line.

Parameters:
line - Line2D The line (null permitted).

setDisplayToolTips

public void setDisplayToolTips(boolean flag)
Sets whether or not show tooltips.

Parameters:
flag - boolean A boolean.

getToolTipText

public java.lang.String getToolTipText(java.awt.event.MouseEvent event)
Returns the tooltip text.

Overrides:
getToolTipText in class javax.swing.JComponent
Parameters:
event - MouseEvent The mouse event (null not permitted).
Returns:
String A tool tip or null if no tooltip is available (maybe null).

translateJava2DToScreen

public java.awt.geom.Point2D translateJava2DToScreen(java.awt.geom.Point2D java2DPoint)
Translates a Java2D point on the chart to a screen location..

Parameters:
java2DPoint - Point2D The Java2D point (null not permitted).
Returns:
Point2D The screen location (never null).

translateScreenToJava2D

public java.awt.geom.Point2D translateScreenToJava2D(java.awt.geom.Point2D screenPoint)
Translates a panel (component) location to a Java2D point.

Parameters:
screenPoint - Point2D The screen location (null not permitted).
Returns:
The Java2D coordinates (never null).

scale

public java.awt.geom.Rectangle2D scale(java.awt.geom.Rectangle2D rect)
Applies any scaling that is in effect for the chart drawing to the given rectangle.

Parameters:
rect - Rectangle2D The rectangle (null not permitted).
Returns:
Rectangle2D A new scaled rectangle (never null).

getShapeForPoint

public IChartShape getShapeForPoint(java.awt.geom.Point2D point)
Returns the shape which contains the specified point.

Parameters:
point - Point2D The point (null not permitted).
Returns:
IChartShape The shape (never null).

getShapeForPoint

public IChartShape getShapeForPoint(java.awt.geom.Point2D point,
                                    ChartShapeDrawType drawType)
Returns the shape which contains the specified point.

Parameters:
point - Point2D The point (null not permitted).
drawType - ChartShapeDrawType The shape draw shape (null permitted).
Returns:
IChartShape The shape (never null).

isRefreshBuffer

public boolean isRefreshBuffer()
Returns the flag that indicates that the buffer should be refreshed.

Returns:
boolean A boolean.

setRefreshBuffer

public void setRefreshBuffer(boolean flag)
Sets the flag that indicates that the buffer should be refreshed.

Parameters:
flag - boolean A boolean.

addShowTooltipShapeType

public void addShowTooltipShapeType(ChartShapeDrawType drawType)
Add a shape type to display tooltip.

Parameters:
drawType - ChartShapeDrawType The shape type (null not permitted).

removeShowTooltipShapeType

public void removeShowTooltipShapeType(ChartShapeDrawType drawType)
Remove a shape type to display tooltip.

Parameters:
drawType - ChartShapeDrawType The shape type (null not permitted).

clearShowTooltipShapeType

public void clearShowTooltipShapeType()
Clear all shape types to display tooltip.


getShowTooltipShapeTypeList

public java.util.List getShowTooltipShapeTypeList()
Returns all shape types to display tooltip.

Returns:
List The shape type collection and unmodifable (never null).

isZoomable

public boolean isZoomable()
Returns controls whether or not zoomable.

Returns:
boolean Controls whether or not zoomable.

setZoomable

public void setZoomable(boolean flag)
Sets controls whether or not zoomable and sends a RenderChangeEvent to all registered listeners.

Parameters:
flag - boolean A boolean.

paintComponent

public void paintComponent(java.awt.Graphics g)
Drawing the chart.

Overrides:
paintComponent in class javax.swing.JComponent
Parameters:
g - Graphics The graphics device.

chartChanged

public void chartChanged(ChartChangeEvent event)
Receives notification of changes to the chart, and redraws the chart.

Specified by:
chartChanged in interface IChartChangeListener
Parameters:
event - ChartChangeEvent The event (null permitted).

chartShapeChanged

public void chartShapeChanged(ChartShapeChangeEvent event)
Receives notification of an IChartShape change event.

Specified by:
chartShapeChanged in interface IChartShapeChangeListener
Parameters:
event - ChartShapeChangeEvent Information about the event.

chartProgress

public void chartProgress(ChartProgressEvent event)
Receives notification of a chart progress event.

Specified by:
chartProgress in interface IChartProgressListener
Parameters:
event - ChartProgressEvent The event.

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent event)
Invoked when the mouse enters a component.

Specified by:
mouseEntered in interface java.awt.event.MouseListener
Parameters:
event - MouseEvent The mouse event.

mouseExited

public void mouseExited(java.awt.event.MouseEvent event)
Invoked when the mouse exits a component.

Specified by:
mouseExited in interface java.awt.event.MouseListener
Parameters:
event - MouseEvent The mouse event.

mousePressed

public void mousePressed(java.awt.event.MouseEvent event)
Invoked when a mouse button has been pressed on a component.

Specified by:
mousePressed in interface java.awt.event.MouseListener
Parameters:
event - MouseEvent The mouse event.

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent event)
Invoked when a mouse button is pressed on a component and then dragged.

Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener
Parameters:
event - MouseEvent The mouse event.

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent event)
Invoked when a mouse button has been released on a component.

Specified by:
mouseReleased in interface java.awt.event.MouseListener
Parameters:
event - MouseEvent The mouse event.

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent event)
Invoked when the mouse button has been clicked (pressed and released) on a component.

Specified by:
mouseClicked in interface java.awt.event.MouseListener
Parameters:
event - MouseEvent The mouse event.

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent event)
Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed.

Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener
Parameters:
event - MouseEvent The mouse event.

zoom

public void zoom(java.awt.geom.Rectangle2D selection)
Zooms in on a selected region.

Parameters:
selection - Rectangle2D The selected region.

restoreAutoBounds

public void restoreAutoBounds()
Restores the auto-range calculation on both axes.


restoreAutoDomainBounds

public void restoreAutoDomainBounds()
Restores the auto-range calculation on the category axis.


restoreAutoValueBounds

public void restoreAutoValueBounds()
Restores the auto-range calculation on the value axis.


getScreenDataArea

public java.awt.geom.Rectangle2D getScreenDataArea()
Returns the data area for the chart with the current scaling applied.

Returns:
Rectangle2D The scaled data area (maybe null).

getScreenDataArea

public java.awt.geom.Rectangle2D getScreenDataArea(int x,
                                                   int y)
Returns the data area for the chart with the current scaling applied.

Parameters:
x - int The x-coordinate.
y - int The y-coordinate.
Returns:
Rectangle2D The scaled data area (maybe null).

getInitialDelay

public int getInitialDelay()
Returns the initial tooltip delay to be used in this chart panel.

Returns:
int An integer representing the initial delay value,in milliseconds

setInitialDelay

public void setInitialDelay(int delay)
Sets the initial tooltip delay to be used in this chart panel.

Parameters:
delay - int An integer representing the initial delay value,in milliseconds

getReshowDelay

public int getReshowDelay()
Returns the reshow tooltip delay to be used in this chart panel.

Returns:
int An integer representing the reshow delay value,in milliseconds.

setReshowDelay

public void setReshowDelay(int delay)
Sets the reshow tooltip delay to be used in this chart panel.

Parameters:
delay - int An integer representing the reshow delay value,in milliseconds.

getDismissDelay

public int getDismissDelay()
Returns the dismiss tooltip delay to be used in this chart panel.

Returns:
int An integer representing the dismiss delay value,in milliseconds.

setDismissDelay

public void setDismissDelay(int delay)
Sets the dismiss tooltip delay to be used in this chart panel.

Parameters:
delay - int An integer representing the dismiss delay value,in milliseconds.

getZoomInFactor

public double getZoomInFactor()
Returns the zoom in factor.

Returns:
double The zoom in factor.

setZoomInFactor

public void setZoomInFactor(double factor)
Returns the zoom in factor.

Parameters:
factor - double The zoom in factor.

getZoomOutFactor

public double getZoomOutFactor()
Returns the zoom out factor.

Returns:
double The zoom out factor.

setZoomOutFactor

public void setZoomOutFactor(double factor)
Sets the zoom out factor.

Parameters:
factor - double The zoom out factor.

getMouseClickPoint

public java.awt.Point getMouseClickPoint()
Returns the mouse click point (null permitted).

Returns:
Point The mouse click point (maybe null).

getRenderingHints

public java.awt.RenderingHints getRenderingHints()
Returns the collection of rendering hints for the chart.

Returns:
RenderingHints The rendering hints for the chart (never null).

setRenderingHints

public void setRenderingHints(java.awt.RenderingHints renderingHints)
Sets the rendering hints for the chart,and sends a ChartChangeEvent to all registered listeners.

Parameters:
renderingHints - RenderingHints The rendering hints (null not permitted).

getAntiAlias

public boolean getAntiAlias()
Returns a flag that indicates whether or not anti-aliasing is used when the chart is drawn.

Returns:
boolean The flag.

setAntiAlias

public void setAntiAlias(boolean flag)
Sets a flag that indicates whether or not anti-aliasing is used when the chart is drawn.

Anti-aliasing usually improves the appearance of charts, but is slower.

Parameters:
flag - The new value of the flag.

getTextAntiAlias

public java.lang.Object getTextAntiAlias()
Returns the current value stored in the rendering hints table for RenderingHints.KEY_TEXT_ANTIALIASING.

Returns:
Object The hint value (possibly null).

setTextAntiAlias

public void setTextAntiAlias(boolean flag)
Sets the value in the rendering hints table for RenderingHints.KEY_TEXT_ANTIALIASING to either RenderingHints.VALUE_TEXT_ANTIALIAS_ON or RenderingHints.VALUE_TEXT_ANTIALIAS_OFF, then sends a ChartChangeEvent to all registered listeners.

Parameters:
flag - boolean The new value of the flag.

setTextAntiAlias

public void setTextAntiAlias(java.lang.Object val)
Sets the value in the rendering hints table for RenderingHints.KEY_TEXT_ANTIALIASING to either RenderingHints.VALUE_TEXT_ANTIALIAS_ON or RenderingHints.VALUE_TEXT_ANTIALIAS_OFF, then sends a ChartChangeEvent to all registered listeners.

Parameters:
val - Object The new value (null permitted),the value maybe RenderingHints.KEY_TEXT_ANTIALIASING or RenderingHints.VALUE_TEXT_ANTIALIAS_ON or RenderingHints.VALUE_TEXT_ANTIALIAS_OFF (null not permitted).

addChartMouseListener

public void addChartMouseListener(IChartMouseListener listener)
Adds a listener.

Parameters:
listener - ChartMouseListener The listener.

removeChartMouseListener

public void removeChartMouseListener(IChartMouseListener listener)
Removes a listener.

Parameters:
listener - ChartMouseListener The listener.

getListeners

public java.util.EventListener[] getListeners(java.lang.Class listenerType)
Returns an array of the listeners of the given type registered with the panel.

Overrides:
getListeners in class javax.swing.JComponent
Parameters:
listenerType - Class The listener class.
Returns:
EventListener[] An array of listeners.