public class IlvVerticalScrollAction extends IlvAction implements SwingConstants
IlvVerticalScrollAction
class implements an action
that will scroll an IlvVerticalScrollable
up or
down. Typically, the scrollable will be an
IlvHierarchyChart
. When an
IlvVerticalScrollAction
is created, it registers an
internal, private event listener with the
IlvVerticalScrollable
so that the action can
automatically enable and disable itself appropriately. If, at a later
time, you want to remove the IlvVerticalScrollAction
from
the user interface and have it garbage-collected, you will need to
explicitly call the removeFromVerticalScrollable()
method.Modifier and Type | Field and Description |
---|---|
static int |
PIXEL_SCROLL
The scrolling mode that indicates that vertical scrolling
will occur by the
scrollFactor amount. |
static int |
ROW_SCROLL
The scrolling mode that indicates that vertical scrolling
will occur by rows.
|
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 |
---|
IlvVerticalScrollAction(IlvVerticalScrollable verticalScrollable,
int direction,
String name,
Icon icon,
KeyStroke accelerator,
String shortDescription,
String longDescription)
Creates an
IlvVerticalScrollAction for the specified
IlvVerticalScrollable object. |
IlvVerticalScrollAction(IlvVerticalScrollable verticalScrollable,
int direction,
String name,
KeyStroke accelerator,
String shortDescription,
String longDescription)
Creates an
IlvVerticalScrollAction for the specified
IlvVerticalScrollable object with a default icon. |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent event)
Performs the vertical scroll action on the
IlvVerticalScrollable object. |
int |
getDirection()
Returns the action's scroll direction.
|
double |
getScrollFactor()
Returns the scroll factor used in
PIXEL_SCROLL scrolling mode, expressed as a fraction of the scrollable's
vertical extent . |
int |
getScrollMode()
Returns the vertical scrolling mode.
|
void |
removeFromVerticalScrollable()
Removes this action as a registered observer of its
IlvVerticalScrollable object. |
void |
setScrollFactor(double scrollFactor)
Sets the scroll factor used in
PIXEL_SCROLL scrolling mode, expressed as a fraction of the scrollable's
vertical extent . |
void |
setScrollMode(int mode)
Sets the vertical scrolling mode.
|
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 static final int PIXEL_SCROLL
scrollFactor
amount. This is the default
scrolling mode for IlvVerticalScrollable
objects other than an
IlvHierarchyChart
.getScrollMode()
,
ROW_SCROLL
,
Constant Field Valuespublic static final int ROW_SCROLL
IlvHierarchyChart
objects. This mode is not valid for other types of
IlvVerticalScrollable
objects.getScrollMode()
,
PIXEL_SCROLL
,
Constant Field Valuespublic IlvVerticalScrollAction(IlvVerticalScrollable verticalScrollable, int direction, String name, KeyStroke accelerator, String shortDescription, String longDescription)
IlvVerticalScrollAction
for the specified
IlvVerticalScrollable
object with a default icon. Typically,
the scrollable will be an IlvHierarchyChart
.
When an IlvVerticalScrollAction
is created, it
registers an internal, private event listener with the
IlvVerticalScrollable
so that the action can
automatically enable and disable itself appropriately. If, at a later
time, you want to remove the IlvVerticalScrollAction
from the user interface and have it garbage-collected, you will need
to explicitly call the removeFromVerticalScrollable()
method.verticalScrollable
- The object that will be scrolled by the
action.direction
- The scroll direction, which must be one of the
constants: TOP
to scroll up or
BOTTOM
to scroll down, 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 IlvVerticalScrollAction(IlvVerticalScrollable verticalScrollable, int direction, String name, Icon icon, KeyStroke accelerator, String shortDescription, String longDescription)
IlvVerticalScrollAction
for the specified
IlvVerticalScrollable
object. Typically, this is will be an
IlvHierarchyChart
. When an
IlvVerticalScrollAction
is created, it registers an
internal, private event listener with the
IlvVerticalScrollable
so that the action can
automatically enable and disable itself appropriately. If, at a later
time, you want to remove the IlvVerticalScrollAction
from the user interface and have it garbage-collected, you will need
to explicitly call the removeFromVerticalScrollable()
method.verticalScrollable
- The object that will be scrolled by the
action.direction
- The scroll direction, which must be one of the
constants: TOP
to scroll up or
BOTTOM
to scroll down, 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()
TOP
if the action scrolls up or
BOTTOM
if the action scrolls down, as defined in
SwingConstants
.public int getScrollMode()
ROW_SCROLL
is the default
for IlvHierarchyChart
objects. It indicates that vertical scrolling will
occur by rows. The value PIXEL_SCROLL
is the default for other types of
IlvVerticalScrollable
objects, which indicates that vertical scrolling
will occur by the scrollFactor
amount.setScrollMode(int)
public void setScrollMode(int mode)
PIXEL_SCROLL
indicates that
vertical scrolling will occur by the scrollFactor
amount.
The value ROW_SCROLL
is only supported for IlvHierarchyChart
objects
and indicates that vertical scrolling will occur by rows.mode
- The scrolling mode that must be either PIXEL_SCROLL
or
ROW_SCROLL
.getScrollMode()
public double getScrollFactor()
PIXEL_SCROLL
scrolling mode, expressed as a fraction of the scrollable's
vertical extent
. The
default value is 0.2.setScrollFactor(double)
public void setScrollFactor(double scrollFactor)
PIXEL_SCROLL
scrolling mode, expressed as a fraction of the scrollable's
vertical extent
.scrollFactor
- The scroll factor.getScrollFactor()
public void actionPerformed(ActionEvent event)
IlvVerticalScrollable
object.actionPerformed
in interface ActionListener
event
- The event.public void removeFromVerticalScrollable()
IlvVerticalScrollable
object.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.