org.jfree.chart
Class ChartPanel

A Swing GUI component for displaying a JFreeChart 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.

SinceNot specified.
VersionNot specified.
AuthorNot specified.
Wiki javadoc Use textile entry format.
Add your comments here.
Field Summary
static boolean DEFAULT_BUFFER_USED
Default setting for buffer usage.
static int DEFAULT_HEIGHT
The default panel height.
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 int DEFAULT_WIDTH
The default panel width.
static int DEFAULT_ZOOM_TRIGGER_DISTANCE
The minimum size required to perform a zoom on a rectangle
protected static ResourceBundle localizationResources
The resourceBundle for the localization.
static String PRINT_COMMAND
Print action command.
static String PROPERTIES_COMMAND
Properties action command.
static String SAVE_COMMAND
Save action command.
static String ZOOM_IN_BOTH_COMMAND
Zoom in (both axes) action command.
static String ZOOM_IN_DOMAIN_COMMAND
Zoom in (domain axis only) action command.
static String ZOOM_IN_RANGE_COMMAND
Zoom in (range axis only) action command.
static String ZOOM_OUT_BOTH_COMMAND
Zoom out (both axes) action command.
static String ZOOM_OUT_DOMAIN_COMMAND
Zoom out (domain axis only) action command.
static String ZOOM_OUT_RANGE_COMMAND
Zoom out (range axis only) action command.
static String ZOOM_RESET_BOTH_COMMAND
Zoom reset (both axes) action command.
static String ZOOM_RESET_DOMAIN_COMMAND
Zoom reset (domain axis only) action command.
static String ZOOM_RESET_RANGE_COMMAND
Zoom reset (range axis only) action command.
Constructor Summary
ChartPanel( JFreeChart chart )
Constructs a panel that displays the specified chart.
ChartPanel( JFreeChart chart, boolean useBuffer )
Constructs a panel containing a chart.
ChartPanel( JFreeChart chart, boolean properties, boolean save, boolean print, boolean zoom, boolean tooltips )
Constructs a JFreeChart panel.
ChartPanel( JFreeChart chart, int width, int height, int minimumDrawWidth, int minimumDrawHeight, int maximumDrawWidth, int maximumDrawHeight, boolean useBuffer, boolean properties, boolean save, boolean print, boolean zoom, boolean tooltips )
Constructs a JFreeChart panel.
Method Summary
void actionPerformed( ActionEvent event )
Handles action events generated by the popup menu.
void addChartMouseListener( ChartMouseListener listener )
Adds a listener to the list of objects listening for chart mouse events.
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 createChartPrintJob()
Creates a print job for the chart.
protected JPopupMenu createPopupMenu( boolean properties, boolean save, boolean print, boolean zoom )
Creates a popup menu for the panel.
protected void displayPopupMenu( int x, int y )
The idea is to modify the zooming options depending on the type of chart being displayed by the panel.
void doSaveAs()
Opens a file chooser and gives the user an opportunity to save the chart in PNG format.
Point2D getAnchor()
Returns the anchor point.
JFreeChart getChart()
Returns the chart contained in the panel.
ChartRenderingInfo getChartRenderingInfo()
Returns the chart rendering info from the most recent chart redraw.
int getDismissDelay()
Returns the dismissal tooltip delay value used inside this chart panel.
ChartEntity getEntityForPoint( int viewX, int viewY )
Returns the chart entity at a given point.
boolean getFillZoomRectangle()
Returns the flag that controls whether or not the zoom rectangle is filled when drawn.
boolean getHorizontalAxisTrace()
Returns the flag that controls whether or not a horizontal axis trace line is drawn over the plot area at the current mouse location.
protected Line2D getHorizontalTraceLine()
Returns the horizontal trace line.
int getInitialDelay()
Returns the initial tooltip delay value used inside this chart panel.
EventListener[] getListeners( Class listenerType )
Returns an array of the listeners of the given type registered with the panel.
int getMaximumDrawHeight()
Returns the maximum drawing height for charts.
int getMaximumDrawWidth()
Returns the maximum drawing width for charts.
int getMinimumDrawHeight()
Returns the minimum drawing height for charts.
int getMinimumDrawWidth()
Returns the minimum drawing width for charts.
JPopupMenu getPopupMenu()
Returns the popup menu.
boolean getRefreshBuffer()
Returns the flag that controls whether or not the offscreen buffer needs to be refreshed.
int getReshowDelay()
Returns the reshow tooltip delay value used inside this chart panel.
double getScaleX()
Returns the X scale factor for the chart.
double getScaleY()
Returns the Y scale factory for the chart.
Rectangle2D getScreenDataArea()
Returns the data area for the chart (the area inside the axes) with the current scaling applied (that is, the area as it appears on screen).
Rectangle2D getScreenDataArea( int x, int y )
Returns the data area (the area inside the axes) for the plot or subplot, with the current scaling applied.
String getToolTipText( MouseEvent e )
Returns a string for the tooltip.
boolean getVerticalAxisTrace()
Returns the flag that controls whether or not a vertical axis trace line is drawn over the plot area at the current mouse location.
protected Line2D getVerticalTraceLine()
Returns the vertical trace line.
double getZoomInFactor()
Returns the zoom in factor.
double getZoomOutFactor()
Returns the zoom out factor.
int getZoomTriggerDistance()
Returns the zoom trigger distance.
boolean isDomainZoomable()
Returns the flag that determines whether or not zooming is enabled for the domain axis.
boolean isEnforceFileExtensions()
Returns true if file extensions should be enforced, and false otherwise.
boolean isRangeZoomable()
Returns the flag that determines whether or not zooming is enabled for the range axis.
void mouseClicked( MouseEvent event )
Receives notification of mouse clicks on the panel.
void mouseDragged( MouseEvent e )
Handles a 'mouse dragged' event.
void mouseEntered( MouseEvent e )
Handles a 'mouse entered' event.
void mouseExited( MouseEvent e )
Handles a 'mouse exited' event.
void mouseMoved( MouseEvent e )
Implementation of the MouseMotionListener's method.
void mousePressed( MouseEvent e )
Handles a 'mouse pressed' event.
void mouseReleased( MouseEvent e )
Handles a 'mouse released' event.
void paintComponent( Graphics g )
Paints the component by drawing the chart to fill the entire component, but allowing for the insets (which will be non-zero if a border has been set for this component).
int print( Graphics g, PageFormat pf, int pageIndex )
Prints the chart on a single page.
void removeChartMouseListener( ChartMouseListener listener )
Removes a listener from the list of objects listening for chart mouse events.
void restoreAutoBounds()
Restores the auto-range calculation on both axes.
void restoreAutoDomainBounds()
Restores the auto-range calculation on the domain axis.
void restoreAutoRangeBounds()
Restores the auto-range calculation on the range axis.
Rectangle2D scale( Rectangle2D rect )
Applies any scaling that is in effect for the chart drawing to the given rectangle.
protected void setAnchor( Point2D anchor )
Sets the anchor point.
void setChart( JFreeChart chart )
Sets the chart that is displayed in the panel.
void setDismissDelay( int delay )
Specifies the dismissal delay value for this chart panel.
void setDisplayToolTips( boolean flag )
Switches the display of tooltips for the panel on or off.
void setDomainZoomable( boolean flag )
Sets the flag that controls whether or not zooming is enable for the domain axis.
void setEnforceFileExtensions( boolean enforce )
Sets a flag that controls whether or not file extensions are enforced.
void setFillZoomRectangle( boolean flag )
A flag that controls how the zoom rectangle is drawn.
void setHorizontalAxisTrace( boolean flag )
A flag that controls trace lines on the horizontal axis.
protected void setHorizontalTraceLine( Line2D line )
Sets the horizontal trace line.
void setInitialDelay( int delay )
Specifies the initial delay value for this chart panel.
void setMaximumDrawHeight( int height )
Sets the maximum drawing height for the chart on this panel.
void setMaximumDrawWidth( int width )
Sets the maximum drawing width for the chart on this panel.
void setMinimumDrawHeight( int height )
Sets the minimum drawing height for the chart on this panel.
void setMinimumDrawWidth( int width )
Sets the minimum drawing width for the chart on this panel.
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 setPopupMenu( JPopupMenu popup )
Sets the popup menu for the panel.
void setRangeZoomable( boolean flag )
A flag that controls mouse-based zooming on the vertical axis.
void setRefreshBuffer( boolean flag )
Sets the refresh buffer flag.
void setReshowDelay( int delay )
Specifies the amount of time before the user has to wait initialDelay milliseconds before a tooltip will be shown.
void setVerticalAxisTrace( boolean flag )
A flag that controls trace lines on the vertical axis.
protected void setVerticalTraceLine( Line2D line )
Sets the vertical trace line.
void setZoomInFactor( double factor )
Sets the zoom in factor.
void setZoomOutFactor( double factor )
Sets the zoom out factor.
void setZoomTriggerDistance( int distance )
Sets the zoom trigger distance.
Point translateJava2DToScreen( Point2D java2DPoint )
Translates a Java2D point on the chart to a screen location.
Point2D translateScreenToJava2D( Point screenPoint )
Translates a screen location to a Java2D point.
void zoom( Rectangle2D selection )
Zooms in on a selected region.
void zoomInBoth( double x, double y )
Zooms in on an anchor point (specified in screen coordinate space).
void zoomInDomain( double x, double y )
Decreases the length of the domain axis, centered about the given coordinate on the screen.
void zoomInRange( double x, double y )
Decreases the length of the range axis, centered about the given coordinate on the screen.
void zoomOutBoth( double x, double y )
Zooms out on an anchor point (specified in screen coordinate space).
void zoomOutDomain( double x, double y )
Increases the length of the domain axis, centered about the given coordinate on the screen.
void zoomOutRange( double x, double y )
Increases the length the range axis, centered about the given coordinate on the screen.
Methods inherited from javax.accessibilityAccessible
Methods inherited from java.awtComponent
Methods inherited from java.awtContainer
Methods inherited from java.awt.imageImageObserver
Methods inherited from javax.swingJComponent
DEFAULT_BUFFER_USED
public static boolean DEFAULT_BUFFER_USED
Default setting for buffer usage.
Wiki javadoc Use textile entry format.
Add your comments here.
DEFAULT_HEIGHT
public static int DEFAULT_HEIGHT
The default panel height.
Wiki javadoc Use textile entry format.
Add your comments here.
DEFAULT_MAXIMUM_DRAW_HEIGHT
public static int DEFAULT_MAXIMUM_DRAW_HEIGHT
The default limit below which chart scaling kicks in.
Wiki javadoc Use textile entry format.
Add your comments here.
DEFAULT_MAXIMUM_DRAW_WIDTH
public static int DEFAULT_MAXIMUM_DRAW_WIDTH
The default limit below which chart scaling kicks in.
Wiki javadoc Use textile entry format.
Add your comments here.
DEFAULT_MINIMUM_DRAW_HEIGHT
public static int DEFAULT_MINIMUM_DRAW_HEIGHT
The default limit below which chart scaling kicks in.
Wiki javadoc Use textile entry format.
Add your comments here.
DEFAULT_MINIMUM_DRAW_WIDTH
public static int DEFAULT_MINIMUM_DRAW_WIDTH
The default limit below which chart scaling kicks in.
Wiki javadoc Use textile entry format.
Add your comments here.
DEFAULT_WIDTH
public static int DEFAULT_WIDTH
The default panel width.
Wiki javadoc Use textile entry format.
Add your comments here.
DEFAULT_ZOOM_TRIGGER_DISTANCE
public static int DEFAULT_ZOOM_TRIGGER_DISTANCE
The minimum size required to perform a zoom on a rectangle
Wiki javadoc Use textile entry format.
Add your comments here.
localizationResources
protected static ResourceBundle localizationResources
The resourceBundle for the localization.
Wiki javadoc Use textile entry format.
Add your comments here.
PRINT_COMMAND
public static String PRINT_COMMAND
Print action command.
Wiki javadoc Use textile entry format.
Add your comments here.
PROPERTIES_COMMAND
public static String PROPERTIES_COMMAND
Properties action command.
Wiki javadoc Use textile entry format.
Add your comments here.
SAVE_COMMAND
public static String SAVE_COMMAND
Save action command.
Wiki javadoc Use textile entry format.
Add your comments here.
ZOOM_IN_BOTH_COMMAND
public static String ZOOM_IN_BOTH_COMMAND
Zoom in (both axes) action command.
Wiki javadoc Use textile entry format.
Add your comments here.
ZOOM_IN_DOMAIN_COMMAND
public static String ZOOM_IN_DOMAIN_COMMAND
Zoom in (domain axis only) action command.
Wiki javadoc Use textile entry format.
Add your comments here.
ZOOM_IN_RANGE_COMMAND
public static String ZOOM_IN_RANGE_COMMAND
Zoom in (range axis only) action command.
Wiki javadoc Use textile entry format.
Add your comments here.
ZOOM_OUT_BOTH_COMMAND
public static String ZOOM_OUT_BOTH_COMMAND
Zoom out (both axes) action command.
Wiki javadoc Use textile entry format.
Add your comments here.
ZOOM_OUT_DOMAIN_COMMAND
public static String ZOOM_OUT_DOMAIN_COMMAND
Zoom out (domain axis only) action command.
Wiki javadoc Use textile entry format.
Add your comments here.
ZOOM_OUT_RANGE_COMMAND
public static String ZOOM_OUT_RANGE_COMMAND
Zoom out (range axis only) action command.
Wiki javadoc Use textile entry format.
Add your comments here.
ZOOM_RESET_BOTH_COMMAND
public static String ZOOM_RESET_BOTH_COMMAND
Zoom reset (both axes) action command.
Wiki javadoc Use textile entry format.
Add your comments here.
ZOOM_RESET_DOMAIN_COMMAND
public static String ZOOM_RESET_DOMAIN_COMMAND
Zoom reset (domain axis only) action command.
Wiki javadoc Use textile entry format.
Add your comments here.
ZOOM_RESET_RANGE_COMMAND
public static String ZOOM_RESET_RANGE_COMMAND
Zoom reset (range axis only) action command.
Wiki javadoc Use textile entry format.
Add your comments here.
ChartPanel
public ChartPanel ( JFreeChart chart )
Constructs a panel that displays the specified chart.
Parameters
TypeNameDescription
JFreeChart chart the chart.
Wiki javadoc Use textile entry format.
Add your comments here.
ChartPanel
public ChartPanel ( JFreeChart chart, boolean useBuffer )
Constructs a panel containing a chart.
Parameters
TypeNameDescription
JFreeChart chart the chart.
boolean useBuffer a flag controlling whether or not an off-screen buffer is used.
Wiki javadoc Use textile entry format.
Add your comments here.
ChartPanel
public ChartPanel ( JFreeChart chart, boolean properties, boolean save, boolean print, boolean zoom, boolean tooltips )
Constructs a JFreeChart panel.
Parameters
TypeNameDescription
JFreeChart chart the chart.
boolean properties a flag indicating whether or not the chart property editor should be available via the popup menu.
boolean save a flag indicating whether or not save options should be available via the popup menu.
boolean print a flag indicating whether or not the print option should be available via the popup menu.
boolean zoom a flag indicating whether or not zoom options should be added to the popup menu.
boolean tooltips a flag indicating whether or not tooltips should be enabled for the chart.
Wiki javadoc Use textile entry format.
Add your comments here.
ChartPanel
public ChartPanel ( JFreeChart chart, int width, int height, int minimumDrawWidth, int minimumDrawHeight, int maximumDrawWidth, int maximumDrawHeight, boolean useBuffer, boolean properties, boolean save, boolean print, boolean zoom, boolean tooltips )
Constructs a JFreeChart panel.
Parameters
TypeNameDescription
JFreeChart chart the chart.
int width the preferred width of the panel.
int height the preferred height of the panel.
int minimumDrawWidth the minimum drawing width.
int minimumDrawHeight the minimum drawing height.
int maximumDrawWidth the maximum drawing width.
int maximumDrawHeight the maximum drawing height.
boolean useBuffer a flag that indicates whether to use the off-screen buffer to improve performance (at the expense of memory).
boolean properties a flag indicating whether or not the chart property editor should be available via the popup menu.
boolean save a flag indicating whether or not save options should be available via the popup menu.
boolean print a flag indicating whether or not the print option should be available via the popup menu.
boolean zoom a flag indicating whether or not zoom options should be added to the popup menu.
boolean tooltips a flag indicating whether or not tooltips should be enabled for the chart.
Wiki javadoc Use textile entry format.
Add your comments here.
actionPerformed
public void actionPerformed ( ActionEvent event )
Handles action events generated by the popup menu.
Implements method in ActionListener
Parameters
TypeNameDescription
ActionEvent event the event.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
addChartMouseListener
public void addChartMouseListener ( ChartMouseListener listener )
Adds a listener to the list of objects listening for chart mouse events.
Parameters
TypeNameDescription
ChartMouseListener listener the listener (null not permitted).
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
chartChanged
public void chartChanged ( ChartChangeEvent event )
Receives notification of changes to the chart, and redraws the chart.
Implements method in ChartChangeListener
Parameters
TypeNameDescription
ChartChangeEvent event details of the chart change event.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
chartProgress
public void chartProgress ( ChartProgressEvent event )
Receives notification of a chart progress event.
Implements method in ChartProgressListener
Parameters
TypeNameDescription
ChartProgressEvent event the event.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
createChartPrintJob
public void createChartPrintJob ( )
Creates a print job for the chart.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
createPopupMenu
protected JPopupMenu createPopupMenu ( boolean properties, boolean save, boolean print, boolean zoom )
Creates a popup menu for the panel.
Parameters
TypeNameDescription
boolean properties include a menu item for the chart property editor.
boolean save include a menu item for saving the chart.
boolean print include a menu item for printing the chart.
boolean zoom include menu items for zooming.
Wiki javadoc Use textile entry format.
Add your comments here.
displayPopupMenu
protected void displayPopupMenu ( int x, int y )
The idea is to modify the zooming options depending on the type of chart being displayed by the panel.
Parameters
TypeNameDescription
int x horizontal position of the popup.
int y vertical position of the popup.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
doSaveAs
public void doSaveAs ( )
throws
Opens a file chooser and gives the user an opportunity to save the chart in PNG format.
Returns void No description provided.
Exceptions
IOException if there is an I/O error.
Wiki javadoc Use textile entry format.
Add your comments here.
getAnchor
public Point2D getAnchor ( )
Returns the anchor point.
Wiki javadoc Use textile entry format.
Add your comments here.
getChart
public JFreeChart getChart ( )
Returns the chart contained in the panel.
Wiki javadoc Use textile entry format.
Add your comments here.
getChartRenderingInfo
public ChartRenderingInfo getChartRenderingInfo ( )
Returns the chart rendering info from the most recent chart redraw.
Wiki javadoc Use textile entry format.
Add your comments here.
getDismissDelay
public int getDismissDelay ( )
Returns the dismissal tooltip delay value used inside this chart panel.
Wiki javadoc Use textile entry format.
Add your comments here.
getEntityForPoint
public ChartEntity getEntityForPoint ( int viewX, int viewY )
Returns the chart entity at a given point.

This method will return null if there is (a) no entity at the given point, or (b) no entity collection has been generated.

Parameters
TypeNameDescription
int viewX the x-coordinate.
int viewY the y-coordinate.
Wiki javadoc Use textile entry format.
Add your comments here.
getFillZoomRectangle
public boolean getFillZoomRectangle ( )
Returns the flag that controls whether or not the zoom rectangle is filled when drawn.
Wiki javadoc Use textile entry format.
Add your comments here.
getHorizontalAxisTrace
public boolean getHorizontalAxisTrace ( )
Returns the flag that controls whether or not a horizontal axis trace line is drawn over the plot area at the current mouse location.
Wiki javadoc Use textile entry format.
Add your comments here.
getHorizontalTraceLine
protected Line2D getHorizontalTraceLine ( )
Returns the horizontal trace line.
Wiki javadoc Use textile entry format.
Add your comments here.
getInitialDelay
public int getInitialDelay ( )
Returns the initial tooltip delay value used inside this chart panel.
Wiki javadoc Use textile entry format.
Add your comments here.
getListeners
public EventListener[] getListeners ( Class listenerType )
Returns an array of the listeners of the given type registered with the panel.
Overrides method in JComponent
Parameters
TypeNameDescription
Class listenerType the listener type.
Wiki javadoc Use textile entry format.
Add your comments here.
getMaximumDrawHeight
public int getMaximumDrawHeight ( )
Returns the maximum drawing height for charts.

If the height available on the panel is greater than this, then the chart is drawn at the maximum height then scaled up to fit.

Wiki javadoc Use textile entry format.
Add your comments here.
getMaximumDrawWidth
public int getMaximumDrawWidth ( )
Returns the maximum drawing width for charts.

If the width available on the panel is greater than this, then the chart is drawn at the maximum width then scaled up to fit.

Wiki javadoc Use textile entry format.
Add your comments here.
getMinimumDrawHeight
public int getMinimumDrawHeight ( )
Returns the minimum drawing height for charts.

If the height available on the panel is less than this, then the chart is drawn at the minimum height then scaled down to fit.

Wiki javadoc Use textile entry format.
Add your comments here.
getMinimumDrawWidth
public int getMinimumDrawWidth ( )
Returns the minimum drawing width for charts.

If the width available on the panel is less than this, then the chart is drawn at the minimum width then scaled down to fit.

Wiki javadoc Use textile entry format.
Add your comments here.
getPopupMenu
public JPopupMenu getPopupMenu ( )
Returns the popup menu.
Wiki javadoc Use textile entry format.
Add your comments here.
getRefreshBuffer
public boolean getRefreshBuffer ( )
Returns the flag that controls whether or not the offscreen buffer needs to be refreshed.
Wiki javadoc Use textile entry format.
Add your comments here.
getReshowDelay
public int getReshowDelay ( )
Returns the reshow tooltip delay value used inside this chart panel.
See also
Wiki javadoc Use textile entry format.
Add your comments here.
getScaleX
public double getScaleX ( )
Returns the X scale factor for the chart. This will be 1.0 if no scaling has been used.
Wiki javadoc Use textile entry format.
Add your comments here.
getScaleY
public double getScaleY ( )
Returns the Y scale factory for the chart. This will be 1.0 if no scaling has been used.
Wiki javadoc Use textile entry format.
Add your comments here.
getScreenDataArea
public Rectangle2D getScreenDataArea ( )
Returns the data area for the chart (the area inside the axes) with the current scaling applied (that is, the area as it appears on screen).
Wiki javadoc Use textile entry format.
Add your comments here.
getScreenDataArea
public Rectangle2D getScreenDataArea ( int x, int y )
Returns the data area (the area inside the axes) for the plot or subplot, with the current scaling applied.
Parameters
TypeNameDescription
int x the x-coordinate (for subplot selection).
int y the y-coordinate (for subplot selection).
Wiki javadoc Use textile entry format.
Add your comments here.
getToolTipText
public String getToolTipText ( MouseEvent e )
Returns a string for the tooltip.
Overrides method in JComponent
Parameters
TypeNameDescription
MouseEvent e the mouse event.
Wiki javadoc Use textile entry format.
Add your comments here.
getVerticalAxisTrace
public boolean getVerticalAxisTrace ( )
Returns the flag that controls whether or not a vertical axis trace line is drawn over the plot area at the current mouse location.
Wiki javadoc Use textile entry format.
Add your comments here.
getVerticalTraceLine
protected Line2D getVerticalTraceLine ( )
Returns the vertical trace line.
Wiki javadoc Use textile entry format.
Add your comments here.
getZoomInFactor
public double getZoomInFactor ( )
Returns the zoom in factor.
Wiki javadoc Use textile entry format.
Add your comments here.
getZoomOutFactor
public double getZoomOutFactor ( )
Returns the zoom out factor.
Wiki javadoc Use textile entry format.
Add your comments here.
getZoomTriggerDistance
public int getZoomTriggerDistance ( )
Returns the zoom trigger distance. This controls how far the mouse must move before a zoom action is triggered.
Wiki javadoc Use textile entry format.
Add your comments here.
isDomainZoomable
public boolean isDomainZoomable ( )
Returns the flag that determines whether or not zooming is enabled for the domain axis.
Wiki javadoc Use textile entry format.
Add your comments here.
isEnforceFileExtensions
public boolean isEnforceFileExtensions ( )
Returns true if file extensions should be enforced, and false otherwise.
Wiki javadoc Use textile entry format.
Add your comments here.
isRangeZoomable
public boolean isRangeZoomable ( )
Returns the flag that determines whether or not zooming is enabled for the range axis.
Wiki javadoc Use textile entry format.
Add your comments here.
mouseClicked
public void mouseClicked ( MouseEvent event )
Receives notification of mouse clicks on the panel. These are translated and passed on to any registered chart mouse click listeners.
Implements method in MouseListener
Parameters
TypeNameDescription
MouseEvent event Information about the mouse event.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
mouseDragged
public void mouseDragged ( MouseEvent e )
Handles a 'mouse dragged' event.
Implements method in MouseMotionListener
Parameters
TypeNameDescription
MouseEvent e the mouse event.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
mouseEntered
public void mouseEntered ( MouseEvent e )
Handles a 'mouse entered' event. This method changes the tooltip delays of ToolTipManager.sharedInstance() to the possibly different values set for this chart panel.
Implements method in MouseListener
Parameters
TypeNameDescription
MouseEvent e the mouse event.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
mouseExited
public void mouseExited ( MouseEvent e )
Handles a 'mouse exited' event. This method resets the tooltip delays of ToolTipManager.sharedInstance() to their original values in effect before mouseEntered()
Implements method in MouseListener
Parameters
TypeNameDescription
MouseEvent e the mouse event.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
mouseMoved
public void mouseMoved ( MouseEvent e )
Implementation of the MouseMotionListener's method.
Implements method in MouseMotionListener
Parameters
TypeNameDescription
MouseEvent e the event.
Returns void No description provided.
Wiki javadoc Use textile entry format.

q3r4

mousePressed
public void mousePressed ( MouseEvent e )
Handles a 'mouse pressed' event.

This event is the popup trigger on Unix/Linux. For Windows, the popup trigger is the 'mouse released' event.

Implements method in MouseListener
Parameters
TypeNameDescription
MouseEvent e The mouse event.
Returns void No description provided.
Wiki javadoc Use textile entry format.

aaaaaaaaaaaaaaaaaaaaaaaaa

mouseReleased
public void mouseReleased ( MouseEvent e )
Handles a 'mouse released' event. On Windows, we need to check if this is a popup trigger, but only if we haven't already been tracking a zoom rectangle.
Implements method in MouseListener
Parameters
TypeNameDescription
MouseEvent e information about the event.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
paintComponent
public void paintComponent ( Graphics g )
Paints the component by drawing the chart to fill the entire component, but allowing for the insets (which will be non-zero if a border has been set for this component). To increase performance (at the expense of memory), an off-screen buffer image can be used.
Overrides method in JComponent
Parameters
TypeNameDescription
Graphics g the graphics device for drawing on.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
print
public int print ( Graphics g, PageFormat pf, int pageIndex )
Prints the chart on a single page.
Implements method in Printable
Parameters
TypeNameDescription
Graphics g the graphics context.
PageFormat pf the page format to use.
int pageIndex the index of the page. If not 0, nothing gets print.
Wiki javadoc Use textile entry format.
Add your comments here.
removeChartMouseListener
public void removeChartMouseListener ( ChartMouseListener listener )
Removes a listener from the list of objects listening for chart mouse events.
Parameters
TypeNameDescription
ChartMouseListener listener the listener.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
restoreAutoBounds
public void restoreAutoBounds ( )
Restores the auto-range calculation on both axes.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
restoreAutoDomainBounds
public void restoreAutoDomainBounds ( )
Restores the auto-range calculation on the domain axis.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
restoreAutoRangeBounds
public void restoreAutoRangeBounds ( )
Restores the auto-range calculation on the range axis.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
scale
public Rectangle2D scale ( Rectangle2D rect )
Applies any scaling that is in effect for the chart drawing to the given rectangle.
Parameters
TypeNameDescription
Rectangle2D rect the rectangle.
Wiki javadoc Use textile entry format.
Add your comments here.
setAnchor
protected void setAnchor ( Point2D anchor )
Sets the anchor point. This method is provided for the use of subclasses, not end users.
Parameters
TypeNameDescription
Point2D anchor the anchor point (null permitted).
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setChart
public void setChart ( JFreeChart chart )
Sets the chart that is displayed in the panel.
Parameters
TypeNameDescription
JFreeChart chart the chart (null permitted).
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setDismissDelay
public void setDismissDelay ( int delay )
Specifies the dismissal delay value for this chart panel.
Parameters
TypeNameDescription
int delay the number of milliseconds to delay before taking away the tooltip
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setDisplayToolTips
public void setDisplayToolTips ( boolean flag )
Switches the display of tooltips for the panel on or off. Note that tooltips can only be displayed if the chart has been configured to generate tooltip items.
Parameters
TypeNameDescription
boolean flag true to enable tooltips, false to disable tooltips.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setDomainZoomable
public void setDomainZoomable ( boolean flag )
Sets the flag that controls whether or not zooming is enable for the domain axis. A check is made to ensure that the current plot supports zooming for the domain values.
Parameters
TypeNameDescription
boolean flag true enables zooming if possible.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setEnforceFileExtensions
public void setEnforceFileExtensions ( boolean enforce )
Sets a flag that controls whether or not file extensions are enforced.
Parameters
TypeNameDescription
boolean enforce the new flag value.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setFillZoomRectangle
public void setFillZoomRectangle ( boolean flag )
A flag that controls how the zoom rectangle is drawn.
Parameters
TypeNameDescription
boolean flag true instructs to fill the rectangle on zoom, otherwise it will be outlined.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setHorizontalAxisTrace
public void setHorizontalAxisTrace ( boolean flag )
A flag that controls trace lines on the horizontal axis.
Parameters
TypeNameDescription
boolean flag true enables trace lines for the mouse pointer on the horizontal axis.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setHorizontalTraceLine
protected void setHorizontalTraceLine ( Line2D line )
Sets the horizontal trace line.
Parameters
TypeNameDescription
Line2D line the line (null permitted).
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setInitialDelay
public void setInitialDelay ( int delay )
Specifies the initial delay value for this chart panel.
Parameters
TypeNameDescription
int delay the number of milliseconds to delay (after the cursor has paused) before displaying.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setMaximumDrawHeight
public void setMaximumDrawHeight ( int height )
Sets the maximum drawing height for the chart on this panel.

At the time the chart is drawn on the panel, if the available height is greater than this amount, the chart will be drawn using the maximum height then scaled up to fit the available space.

Parameters
TypeNameDescription
int height The height.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setMaximumDrawWidth
public void setMaximumDrawWidth ( int width )
Sets the maximum drawing width for the chart on this panel.

At the time the chart is drawn on the panel, if the available width is greater than this amount, the chart will be drawn using the maximum width then scaled up to fit the available space.

Parameters
TypeNameDescription
int width The width.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setMinimumDrawHeight
public void setMinimumDrawHeight ( int height )
Sets the minimum drawing height for the chart on this panel.

At the time the chart is drawn on the panel, if the available height is less than this amount, the chart will be drawn using the minimum height then scaled down to fit the available space.

Parameters
TypeNameDescription
int height The height.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setMinimumDrawWidth
public void setMinimumDrawWidth ( int width )
Sets the minimum drawing width for the chart on this panel.

At the time the chart is drawn on the panel, if the available width is less than this amount, the chart will be drawn using the minimum width then scaled down to fit the available space.

Parameters
TypeNameDescription
int width The width.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setMouseZoomable
public void setMouseZoomable ( boolean flag )
A convenience method that switches on mouse-based zooming.
Parameters
TypeNameDescription
boolean flag true enables zooming and rectangle fill on zoom.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setMouseZoomable
public void setMouseZoomable ( boolean flag, boolean fillRectangle )
A convenience method that switches on mouse-based zooming.
Parameters
TypeNameDescription
boolean flag true if zooming enabled
boolean fillRectangle true if zoom rectangle is filled, false if rectangle is shown as outline only.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setPopupMenu
public void setPopupMenu ( JPopupMenu popup )
Sets the popup menu for the panel.
Parameters
TypeNameDescription
JPopupMenu popup the popup menu (null permitted).
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setRangeZoomable
public void setRangeZoomable ( boolean flag )
A flag that controls mouse-based zooming on the vertical axis.
Parameters
TypeNameDescription
boolean flag true enables zooming.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setRefreshBuffer
public void setRefreshBuffer ( boolean flag )
Sets the refresh buffer flag. This flag is used to avoid unnecessary redrawing of the chart when the offscreen image buffer is used.
Parameters
TypeNameDescription
boolean flag true indicate, that the buffer should be refreshed.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setReshowDelay
public void setReshowDelay ( int delay )
Specifies the amount of time before the user has to wait initialDelay milliseconds before a tooltip will be shown.
Parameters
TypeNameDescription
int delay time in milliseconds
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setVerticalAxisTrace
public void setVerticalAxisTrace ( boolean flag )
A flag that controls trace lines on the vertical axis.
Parameters
TypeNameDescription
boolean flag true enables trace lines for the mouse pointer on the vertical axis.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setVerticalTraceLine
protected void setVerticalTraceLine ( Line2D line )
Sets the vertical trace line.
Parameters
TypeNameDescription
Line2D line the line (null permitted).
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setZoomInFactor
public void setZoomInFactor ( double factor )
Sets the zoom in factor.
Parameters
TypeNameDescription
double factor the factor.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setZoomOutFactor
public void setZoomOutFactor ( double factor )
Sets the zoom out factor.
Parameters
TypeNameDescription
double factor the factor.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setZoomTriggerDistance
public void setZoomTriggerDistance ( int distance )
Sets the zoom trigger distance. This controls how far the mouse must move before a zoom action is triggered.
Parameters
TypeNameDescription
int distance the distance (in Java2D units).
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
translateJava2DToScreen
public Point translateJava2DToScreen ( Point2D java2DPoint )
Translates a Java2D point on the chart to a screen location.
Parameters
TypeNameDescription
Point2D java2DPoint the Java2D point.
Wiki javadoc Use textile entry format.
Add your comments here.
translateScreenToJava2D
public Point2D translateScreenToJava2D ( Point screenPoint )
Translates a screen location to a Java2D point.
Parameters
TypeNameDescription
Point screenPoint the screen location.
Wiki javadoc Use textile entry format.
Add your comments here.
zoom
public void zoom ( Rectangle2D selection )
Zooms in on a selected region.
Parameters
TypeNameDescription
Rectangle2D selection the selected region.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
zoomInBoth
public void zoomInBoth ( double x, double y )
Zooms in on an anchor point (specified in screen coordinate space).
Parameters
TypeNameDescription
double x the x value (in screen coordinates).
double y the y value (in screen coordinates).
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
zoomInDomain
public void zoomInDomain ( double x, double y )
Decreases the length of the domain axis, centered about the given coordinate on the screen. The length of the domain axis is reduced by the value of getZoomInFactor() .
Parameters
TypeNameDescription
double x the x coordinate (in screen coordinates).
double y the y-coordinate (in screen coordinates).
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
zoomInRange
public void zoomInRange ( double x, double y )
Decreases the length of the range axis, centered about the given coordinate on the screen. The length of the range axis is reduced by the value of getZoomInFactor() .
Parameters
TypeNameDescription
double x the x-coordinate (in screen coordinates).
double y the y coordinate (in screen coordinates).
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
zoomOutBoth
public void zoomOutBoth ( double x, double y )
Zooms out on an anchor point (specified in screen coordinate space).
Parameters
TypeNameDescription
double x the x value (in screen coordinates).
double y the y value (in screen coordinates).
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
zoomOutDomain
public void zoomOutDomain ( double x, double y )
Increases the length of the domain axis, centered about the given coordinate on the screen. The length of the domain axis is increased by the value of getZoomOutFactor() .
Parameters
TypeNameDescription
double x the x coordinate (in screen coordinates).
double y the y-coordinate (in screen coordinates).
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
zoomOutRange
public void zoomOutRange ( double x, double y )
Increases the length the range axis, centered about the given coordinate on the screen. The length of the range axis is increased by the value of getZoomOutFactor() .
Parameters
TypeNameDescription
double x the x coordinate (in screen coordinates).
double y the y-coordinate (in screen coordinates).
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.