public class IlvTimeScrollAction extends IlvAction implements SwingConstants
IlvTimeScrollAction
class implements an action that
will scroll an IlvTimeScrollable
right or left.
Typically, the scrollable will be an
IlvHierarchyChart
. When an
IlvTimeScrollAction
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
IlvTimeScrollAction
from the user interface and have it
garbage-collected, you will need to explicitly call the
removeFromTimeScrollable()
method.changeSupport, enabled
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
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 |
---|
IlvTimeScrollAction(IlvTimeScrollable timeScrollable,
int direction,
String name,
Icon icon,
KeyStroke accelerator,
String shortDescription,
String longDescription)
Creates an
IlvTimeScrollAction for the specified
IlvTimeScrollable object. |
IlvTimeScrollAction(IlvTimeScrollable timeScrollable,
int direction,
String name,
KeyStroke accelerator,
String shortDescription,
String longDescription)
Creates an
IlvTimeScrollAction for the specified
IlvTimeScrollable object with a default icon. |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent event)
Performs the time scroll action on the
IlvTimeScrollable
object. |
int |
getDirection()
Returns the action's scroll direction.
|
double |
getScrollFactor()
Returns the scroll factor as a fraction of the time scrollable's
visible duration . |
void |
removeFromTimeScrollable()
Removes this action as a registered observer of its
IlvTimeScrollable object. |
void |
setScrollFactor(double scrollFactor)
Sets the scroll factor as a fraction of the time scrollable's
visible duration . |
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 IlvTimeScrollAction(IlvTimeScrollable timeScrollable, int direction, String name, KeyStroke accelerator, String shortDescription, String longDescription)
IlvTimeScrollAction
for the specified
IlvTimeScrollable
object with a default icon. Typically, the
scrollable will be an IlvHierarchyChart
.
When an IlvTimeScrollAction
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 IlvTimeScrollAction
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 scrolled
by the action.direction
- The scroll direction, which must be one of the
constants: LEFT
to scroll backwards in time or
RIGHT
to scroll forwards, as defined in
SwingConstants
.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 IlvTimeScrollAction(IlvTimeScrollable timeScrollable, int direction, String name, Icon icon, KeyStroke accelerator, String shortDescription, String longDescription)
IlvTimeScrollAction
for the specified
IlvTimeScrollable
object. Typically, this is will be an
IlvHierarchyChart
. When an
IlvTimeScrollAction
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 IlvTimeScrollAction
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 scrolled
by the action.direction
- The scroll direction, which must be one of the
constants: LEFT
to scroll backwards in time or
RIGHT
to scroll forwards, as defined in
SwingConstants
.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 int getDirection()
LEFT
if the action scrolls backwards in time
or RIGHT
if the action scrolls forward in time, defined
in SwingConstants
.public double getScrollFactor()
visible duration
. The
default value is 0.25.setScrollFactor(double)
public void setScrollFactor(double scrollFactor)
visible duration
.scrollFactor
- The scroll factor.getScrollFactor()
public void actionPerformed(ActionEvent event)
IlvTimeScrollable
object.actionPerformed
in interface ActionListener
event
- The ActionEvent
.public void removeFromTimeScrollable()
IlvTimeScrollable
object.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.