public class IlvZoomInAction extends IlvAction
IlvZoomInAction
class implements an action that will
zoom in on a specified IlvTimeScrollable
.
Typically, this will be an IlvHierarchyChart
.
When an IlvZoomInAction
is created, it registers an
internal, private event listener with the IlvTimeScrollable
so that the action can automatically enable and disable itself
appropriately. If, at a later time, you want to remove the
IlvZoomInAction
from the user interface and have it
garbage-collected, you will need to explicitly call the
removeFromTimeScrollable()
method.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 |
---|
IlvZoomInAction(IlvTimeScrollable timeScrollable,
String name,
Icon icon,
KeyStroke accelerator,
String shortDescription,
String longDescription)
Creates an
IlvZoomInAction for the specified
IlvTimeScrollable object. |
IlvZoomInAction(IlvTimeScrollable timeScrollable,
String name,
KeyStroke accelerator,
String shortDescription,
String longDescription)
Creates an
IlvZoomInAction for the specified
IlvTimeScrollable object with a default icon. |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent event)
Performs the zoom in action on the
IlvTimeScrollable object. |
IlvDuration |
getMinDuration()
Returns the minimum duration that will be zoomed in to.
|
double |
getZoomFactor()
Returns the zoom factor.
|
void |
perform()
Performs the zoom in action on the
IlvTimeScrollable object. |
void |
removeFromTimeScrollable()
Removes this action as a registered observer of its
IlvTimeScrollable object. |
void |
setMinDuration(IlvDuration duration)
Sets the minimum duration that will be zoomed in to.
|
void |
setZoomFactor(double zoomFactor)
Sets the zoom factor.
|
getAccelerator, getAcceleratorText, getIcon, getLongDescription, getMnemonic, getName, getShortDescription, setAccelerator, setIcon, setIcon, setLongDescription, setMnemonic, setName, setShortDescription
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
public IlvZoomInAction(IlvTimeScrollable timeScrollable, String name, KeyStroke accelerator, String shortDescription, String longDescription)
IlvZoomInAction
for the specified
IlvTimeScrollable
object with a default icon. Typically, the
scrollable will be an IlvHierarchyChart
.
When an IlvZoomInAction
is created, it registers an
internal, private event listener with the
IlvTimeScrollable
so that the action can automatically
enable and disable itself appropriately. If, at a later time, you want
to remove the IlvZoomInAction
from the user interface
and have it garbage-collected, you will need to explicitly call the
removeFromTimeScrollable()
method.timeScrollable
- The time scrollable object that will be zoomed
by the action.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.accelerator
- The action's optional keyboard accelerator.shortDescription
- The action's optional short description. This
text, if not null
, will be typically used for
tooltips.longDescription
- The action's optional long description. This
text, if not null
, will be typically used for
display in a status bar.public IlvZoomInAction(IlvTimeScrollable timeScrollable, String name, Icon icon, KeyStroke accelerator, String shortDescription, String longDescription)
IlvZoomInAction
for the specified
IlvTimeScrollable
object. Typically, this is will be an
IlvHierarchyChart
. When an
IlvZoomInAction
is created, it registers an internal,
private event listener with the IlvTimeScrollable
so
that the action can automatically enable and disable itself
appropriately. If, at a later time, you want to remove the
IlvZoomInAction
from the user interface and have it
garbage-collected, you will need to explicitly call the
removeFromTimeScrollable()
method.timeScrollable
- The time scrollable object that will be zoomed
by the action.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's icon or null
to use the
default icon.accelerator
- The action's optional keyboard accelerator.shortDescription
- The action's optional short description. This
text, if not null
, will be typically used for
tooltips.longDescription
- The action's optional long description. This
text, if not null
, will be typically used for
display in a status bar.public double getZoomFactor()
public void setZoomFactor(double zoomFactor)
zoomFactor
- A double
representing the zoom
factor.public IlvDuration getMinDuration()
setMinDuration(IlvDuration)
method and the
minimum duration of the time scrollable. The default value is the
minimum duration of the time scrollable.IlvDuration
that will be zoomed into.setMinDuration(IlvDuration)
public void setMinDuration(IlvDuration duration)
Note: because IlvTimeScrollable
objects have
their own minimum duration, the minimum duration that this action will
allow is the greater of the values set by this method
and the minimum duration of the time scrollable.
duration
- The IlvDuration
to set.getMinDuration()
public void actionPerformed(ActionEvent event)
IlvTimeScrollable
object. This method
invokes perform()
.event
- The ActionEvent
.public void perform()
IlvTimeScrollable
object.actionPerformed(ActionEvent)
public void removeFromTimeScrollable()
IlvTimeScrollable
object.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.