public class IlvChartZoomAction extends IlvChartAction
IlvChartZoomAction
is created, it registers an
internal, private event listener with the chart axis so that the action
can automatically enable and disable itself appropriately. If, at a later
time, you want to remove the action from the user interface and have it
garbage-collected, you will need to explicitly call its IlvChartAction.setChart(ilog.views.chart.IlvChart)
method with a null
argument to detach the action from the chart, hence
removing itself from the listener list.changeSupport, enabled
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
Constructor and Description |
---|
IlvChartZoomAction(String name)
Creates a new
IlvChartZoomAction with the specified name
and a zoom factor of 2. |
IlvChartZoomAction(String name,
double zoomFactor)
Creates a new
IlvChartZoomAction with the specified name
and zoom factor. |
IlvChartZoomAction(String name,
Icon icon)
Creates a new
IlvChartZoomAction with the specified name
and icon and a zoom factor of 2. |
IlvChartZoomAction(String name,
Icon icon,
double zoomFactor)
Creates a new
IlvChartZoomAction with the specified name,
icon and zoom factor. |
IlvChartZoomAction(String name,
Icon icon,
KeyStroke accelerator,
String shortDescription,
String longDescription,
double zoomFactor)
Creates a new
IlvChartZoomAction . |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent event)
Called when an action occurred.
|
protected void |
attach()
Called when the action has been attached to a new chart.
|
protected void |
computeEnabled()
Called when a change occurs on the axis to refresh the enabled property.
|
protected void |
detach()
Called when the action is about to be detached from its associated chart.
|
double |
getZoomFactor()
Returns the zoom factor.
|
boolean |
isXZoomAllowed()
Returns whether zooming along the x-axis is allowed.
|
boolean |
isYZoomAllowed()
Returns whether zooming along the y-axis is allowed.
|
boolean |
isZoomIn()
Returns whether the zoom action is a zoom in or zoom out.
|
void |
setXZoomAllowed(boolean canZoom)
Sets whether zooming along the x-axis is allowed.
|
void |
setYZoomAllowed(boolean canZoom)
Sets whether zooming along the y-axis is allowed.
|
void |
setZoomFactor(double zoomFactor)
Sets the zoom factor.
|
getAccelerator, getAcceleratorText, getChart, getCoordinateSystem, getIcon, getLongDescription, getShortDescription, getXAxis, getYAxis, getYAxisIndex, setAccelerator, setChart, setIcon, setIcon, setLongDescription, setShortDescription, setYAxisIndex
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
public IlvChartZoomAction(String name)
IlvChartZoomAction
with the specified name
and a zoom factor of 2.public IlvChartZoomAction(String name, Icon icon)
IlvChartZoomAction
with the specified name
and icon and a zoom factor of 2.public IlvChartZoomAction(String name, double zoomFactor)
IlvChartZoomAction
with the specified name
and zoom factor.public IlvChartZoomAction(String name, Icon icon, double zoomFactor)
IlvChartZoomAction
with the specified name,
icon and zoom factor.public IlvChartZoomAction(String name, Icon icon, KeyStroke accelerator, String shortDescription, String longDescription, double zoomFactor)
IlvChartZoomAction
.name
- The name of the action. If the action is added to a JMenu
,
the name will be used as the menu item text. If the action is added to a
JToolBar
, the name will be used as the button text.icon
- The action optional icon.accelerator
- The action optional keyboard accelerator.shortDescription
- The action optional short description.
If not null
, this text will be typically used for tooltips.longDescription
- The action optional long description.
If not null
, this text will be typically used for display in a status bar.zoomFactor
- The zoom factor to apply on the chart.public double getZoomFactor()
public void setZoomFactor(double zoomFactor)
public final boolean isXZoomAllowed()
public void setXZoomAllowed(boolean canZoom)
public final boolean isYZoomAllowed()
public void setYZoomAllowed(boolean canZoom)
public final boolean isZoomIn()
protected void detach()
detach
in class IlvChartAction
protected void attach()
attach
in class IlvChartAction
protected void computeEnabled()
computeEnabled
in class IlvChartAction
IlvChartAction.setChart(ilog.views.chart.IlvChart)
public void actionPerformed(ActionEvent event)
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.