com.levigo.jadice.swing.commands
Class ScrollCommand
java.lang.Object
com.levigo.util.swing.action.injection.InjectedCommand
com.levigo.util.swing.action.AbstractContextCommand
com.levigo.jadice.swing.commands.AbstractPageViewCommand
com.levigo.jadice.swing.commands.AbstractDocumentCommand
com.levigo.jadice.swing.commands.ScrollCommand
- All Implemented Interfaces:
- Command
public class ScrollCommand
- extends AbstractDocumentCommand
This command could be used to provide scroll actions on the page view scrollbars. The viewer
which should be controlled by this command have to be provided as context object of the used
context. The way how the scrollers should behave is defined via command properties file.
Hint:
To work properly this command needs a PageView
instance in the
Context
object.
Furthermore a valid scrolling behavior have to be defined in the commands properties as command
parameters. Provided scrolling behaviors are:
Command parameters
Description |
Command Parameter Name |
Possible Parameter Values |
scroll performance |
fast |
true, false (default: false) |
scroll direction |
direction |
TOP, LEFT, RIGHT, DOWN, see ScrollCommand.Direction |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SCROLL_UNIT
protected final int SCROLL_UNIT
- See Also:
- Constant Field Values
ScrollCommand
public ScrollCommand()
execute
protected void execute()
- Description copied from class:
InjectedCommand
- This method is called in order to execute the command. It is only called, after the arguments
have been validated and injected and only if
InjectedCommand.canExecute()
has returned
true
.
- Specified by:
execute
in class InjectedCommand
translate
protected void translate(int dx,
int dy)
- Translates the pan point of the viewer contained in given context objects. Is the pan point at
location ( x , y ), it will be translated by
dx
along the x
axis and dy
along the y axis so that it now represents the point (
x
+
dx
, y
+
dy
).
- Parameters:
dx
- the distance to move this point along the x axisdy
- the distance to move this point along the y axis
setDirection
public void setDirection(ScrollCommand.Direction direction)
getDirection
public ScrollCommand.Direction getDirection()
setFast
public void setFast(boolean fast)
isFast
public boolean isFast()
Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.