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.
| Field Summary | |
|---|---|
| static boolean |
Default setting for buffer usage. |
| static int |
The default panel height. |
| static int |
The default limit below which chart scaling kicks in. |
| static int |
The default limit below which chart scaling kicks in. |
| static int |
The default limit below which chart scaling kicks in. |
| static int |
The default limit below which chart scaling kicks in. |
| static int |
The default panel width. |
| static int |
The minimum size required to perform a zoom on a rectangle |
| protected static ResourceBundle |
The resourceBundle for the localization. |
| static String |
Print action command. |
| static String |
Properties action command. |
| static String |
Save action command. |
| static String |
Zoom in (both axes) action command. |
| static String |
Zoom in (domain axis only) action command. |
| static String |
Zoom in (range axis only) action command. |
| static String |
Zoom out (both axes) action command. |
| static String |
Zoom out (domain axis only) action command. |
| static String |
Zoom out (range axis only) action command. |
| static String |
Zoom reset (both axes) action command. |
| static String |
Zoom reset (domain axis only) action command. |
| static String |
Zoom reset (range axis only) action command. |
| Fields inherited from java.awtComponent |
|---|
| Fields inherited from javax.swingJComponent |
|---|
| Constructor Summary |
|---|
|
Constructs a panel that displays the specified chart. |
|
Constructs a panel containing a chart. |
|
Constructs a JFreeChart panel. |
|
Constructs a JFreeChart panel. |
| Method Summary | |
|---|---|
| void |
Handles action events generated by the popup menu. |
| void |
Adds a listener to the list of objects listening for chart mouse events. |
| void |
Receives notification of changes to the chart, and redraws the chart. |
| void |
Receives notification of a chart progress event. |
| void |
Creates a print job for the chart. |
| protected JPopupMenu |
Creates a popup menu for the panel. |
| protected void |
The idea is to modify the zooming options depending on the type of chart being displayed by the panel. |
| void |
Opens a file chooser and gives the user an opportunity to save the chart in PNG format. |
| Point2D |
Returns the anchor point. |
| JFreeChart |
Returns the chart contained in the panel. |
| ChartRenderingInfo |
Returns the chart rendering info from the most recent chart redraw. |
| int |
Returns the dismissal tooltip delay value used inside this chart panel. |
| ChartEntity |
Returns the chart entity at a given point. |
| boolean |
Returns the flag that controls whether or not the zoom rectangle is filled when drawn. |
| boolean |
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 |
Returns the horizontal trace line. |
| int |
Returns the initial tooltip delay value used inside this chart panel. |
| EventListener[] |
Returns an array of the listeners of the given type registered with the panel. |
| int |
Returns the maximum drawing height for charts. |
| int |
Returns the maximum drawing width for charts. |
| int |
Returns the minimum drawing height for charts. |
| int |
Returns the minimum drawing width for charts. |
| JPopupMenu |
Returns the popup menu. |
| boolean |
Returns the flag that controls whether or not the offscreen buffer needs to be refreshed. |
| int |
Returns the reshow tooltip delay value used inside this chart panel. |
| double |
Returns the X scale factor for the chart. |
| double |
Returns the Y scale factory for the chart. |
| Rectangle2D |
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 |
Returns the data area (the area inside the axes) for the plot or subplot, with the current scaling applied. |
| String |
Returns a string for the tooltip. |
| boolean |
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 |
Returns the vertical trace line. |
| double |
Returns the zoom in factor. |
| double |
Returns the zoom out factor. |
| int |
Returns the zoom trigger distance. |
| boolean |
Returns the flag that determines whether or not zooming is enabled for the domain axis. |
| boolean |
Returns true if file extensions should be enforced, and
false otherwise.
|
| boolean |
Returns the flag that determines whether or not zooming is enabled for the range axis. |
| void |
Receives notification of mouse clicks on the panel. |
| void |
Handles a 'mouse dragged' event. |
| void |
Handles a 'mouse entered' event. |
| void |
Handles a 'mouse exited' event. |
| void |
Implementation of the MouseMotionListener's method. |
| void |
Handles a 'mouse pressed' event. |
| void |
Handles a 'mouse released' event. |
| void |
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 |
Prints the chart on a single page. |
| void |
Removes a listener from the list of objects listening for chart mouse events. |
| void |
Restores the auto-range calculation on both axes. |
| void |
Restores the auto-range calculation on the domain axis. |
| void |
Restores the auto-range calculation on the range axis. |
| Rectangle2D |
Applies any scaling that is in effect for the chart drawing to the given rectangle. |
| protected void |
Sets the anchor point. |
| void |
Sets the chart that is displayed in the panel. |
| void |
Specifies the dismissal delay value for this chart panel. |
| void |
Switches the display of tooltips for the panel on or off. |
| void |
Sets the flag that controls whether or not zooming is enable for the domain axis. |
| void |
Sets a flag that controls whether or not file extensions are enforced. |
| void |
A flag that controls how the zoom rectangle is drawn. |
| void |
A flag that controls trace lines on the horizontal axis. |
| protected void |
Sets the horizontal trace line. |
| void |
Specifies the initial delay value for this chart panel. |
| void |
Sets the maximum drawing height for the chart on this panel. |
| void |
Sets the maximum drawing width for the chart on this panel. |
| void |
Sets the minimum drawing height for the chart on this panel. |
| void |
Sets the minimum drawing width for the chart on this panel. |
| void |
A convenience method that switches on mouse-based zooming. |
| void |
A convenience method that switches on mouse-based zooming. |
| void |
Sets the popup menu for the panel. |
| void |
A flag that controls mouse-based zooming on the vertical axis. |
| void |
Sets the refresh buffer flag. |
| void |
Specifies the amount of time before the user has to wait initialDelay milliseconds before a tooltip will be shown. |
| void |
A flag that controls trace lines on the vertical axis. |
| protected void |
Sets the vertical trace line. |
| void |
Sets the zoom in factor. |
| void |
Sets the zoom out factor. |
| void |
Sets the zoom trigger distance. |
| Point |
Translates a Java2D point on the chart to a screen location. |
| Point2D |
Translates a screen location to a Java2D point. |
| void |
Zooms in on a selected region. |
| void |
Zooms in on an anchor point (specified in screen coordinate space). |
| void |
Decreases the length of the domain axis, centered about the given coordinate on the screen. |
| void |
Decreases the length of the range axis, centered about the given coordinate on the screen. |
| void |
Zooms out on an anchor point (specified in screen coordinate space). |
| void |
Increases the length of the domain axis, centered about the given coordinate on the screen. |
| void |
Increases the length the range axis, centered about the given coordinate on the screen. |
| Methods inherited from javax.accessibilityAccessible |
|---|
| Methods inherited from java.awt.imageImageObserver |
|---|
| Methods inherited from javax.swingJPanel |
|---|
| Methods inherited from java.awtMenuContainer |
|---|
| Methods inherited from java.langObject |
|---|
public static
int
DEFAULT_MAXIMUM_DRAW_HEIGHT
public static
int
DEFAULT_MAXIMUM_DRAW_WIDTH
public static
int
DEFAULT_MINIMUM_DRAW_HEIGHT
public static
int
DEFAULT_MINIMUM_DRAW_WIDTH
public static
int
DEFAULT_ZOOM_TRIGGER_DISTANCE
public ChartPanel
(
JFreeChart
chart,
boolean
properties,
boolean
save,
boolean
print,
boolean
zoom,
boolean
tooltips
)
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
)
protected
JPopupMenu
createPopupMenu
(
boolean
properties,
boolean
save,
boolean
print,
boolean
zoom
)
protected
void
displayPopupMenu
(
int
x,
int
y
)
public
int
getDismissDelay
(
)
This method will return null if there is (a) no entity at the given point, or (b) no entity collection has been generated.
public
boolean
getFillZoomRectangle
(
)
public
boolean
getHorizontalAxisTrace
(
)
public
int
getInitialDelay
(
)
public
int
getMaximumDrawHeight
(
)
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.
public
int
getMaximumDrawWidth
(
)
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.
public
int
getMinimumDrawHeight
(
)
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.
public
int
getMinimumDrawWidth
(
)
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.
public
boolean
getRefreshBuffer
(
)
public
int
getReshowDelay
(
)
public
double
getScaleX
(
)
public
double
getScaleY
(
)
public
boolean
getVerticalAxisTrace
(
)
public
int
getZoomTriggerDistance
(
)
public
boolean
isDomainZoomable
(
)
public
boolean
isEnforceFileExtensions
(
)
true if file extensions should be enforced, and
false otherwise.
public
boolean
isRangeZoomable
(
)
q3r4
This event is the popup trigger on Unix/Linux. For Windows, the popup trigger is the 'mouse released' event.
aaaaaaaaaaaaaaaaaaaaaaaaa
public
void
restoreAutoBounds
(
)
public
void
restoreAutoDomainBounds
(
)
public
void
restoreAutoRangeBounds
(
)
public
void
setDismissDelay
(
int
delay
)
public
void
setDisplayToolTips
(
boolean
flag
)
public
void
setDomainZoomable
(
boolean
flag
)
public
void
setEnforceFileExtensions
(
boolean
enforce
)
public
void
setFillZoomRectangle
(
boolean
flag
)
public
void
setHorizontalAxisTrace
(
boolean
flag
)
public
void
setInitialDelay
(
int
delay
)
public
void
setMaximumDrawHeight
(
int
height
)
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.
public
void
setMaximumDrawWidth
(
int
width
)
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.
public
void
setMinimumDrawHeight
(
int
height
)
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.
public
void
setMinimumDrawWidth
(
int
width
)
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.
public
void
setMouseZoomable
(
boolean
flag
)
public
void
setMouseZoomable
(
boolean
flag,
boolean
fillRectangle
)
public
void
setRangeZoomable
(
boolean
flag
)
public
void
setRefreshBuffer
(
boolean
flag
)
public
void
setReshowDelay
(
int
delay
)
public
void
setVerticalAxisTrace
(
boolean
flag
)
public
void
setZoomTriggerDistance
(
int
distance
)
public
void
zoomInBoth
(
double
x,
double
y
)
public
void
zoomInDomain
(
double
x,
double
y
)
public
void
zoomInRange
(
double
x,
double
y
)
public
void
zoomOutBoth
(
double
x,
double
y
)
public
void
zoomOutDomain
(
double
x,
double
y
)
public
void
zoomOutRange
(
double
x,
double
y
)