com.levigo.jadice.swing.commands
Class ScrollCommand

java.lang.Object
  extended by com.levigo.util.swing.action.injection.InjectedCommand
      extended by com.levigo.util.swing.action.AbstractContextCommand
          extended by com.levigo.jadice.swing.commands.AbstractPageViewCommand
              extended by com.levigo.jadice.swing.commands.AbstractDocumentCommand
                  extended by 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


Nested Class Summary
static class ScrollCommand.Direction
           
 
Nested classes/interfaces inherited from class com.levigo.jadice.swing.commands.AbstractDocumentCommand
AbstractDocumentCommand.Scope
 
Field Summary
protected  int SCROLL_UNIT
           
 
Fields inherited from class com.levigo.jadice.swing.commands.AbstractDocumentCommand
document
 
Constructor Summary
ScrollCommand()
           
 
Method Summary
protected  void execute()
          This method is called in order to execute the command.
 ScrollCommand.Direction getDirection()
           
 boolean isFast()
           
 void setDirection(ScrollCommand.Direction direction)
           
 void setFast(boolean fast)
           
protected  void translate(int dx, int dy)
          Translates the pan point of the viewer contained in given context objects.
 
Methods inherited from class com.levigo.jadice.swing.commands.AbstractDocumentCommand
canExecute, getRenderControls, getScope, setScope
 
Methods inherited from class com.levigo.jadice.swing.commands.AbstractPageViewCommand
getPageView, setPageView
 
Methods inherited from class com.levigo.util.swing.action.AbstractContextCommand
getContext, propagateContextChange, setContext
 
Methods inherited from class com.levigo.util.swing.action.injection.InjectedCommand
canExecute, execute, getKey, isAvailable, isSelected, isSelected, setKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCROLL_UNIT

protected final int SCROLL_UNIT
See Also:
Constant Field Values
Constructor Detail

ScrollCommand

public ScrollCommand()
Method Detail

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 axis
dy - 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.