Class ViewportDragCommand
java.lang.Object
org.eclipse.nebula.widgets.nattable.viewport.command.ViewportDragCommand
- All Implemented Interfaces:
ILayerCommand
Command that is used to trigger a scrolling operation. Typically fired by
other drag operations.
-
Constructor Summary
ConstructorsConstructorDescriptionViewportDragCommand(int x, int y) Create a ViewportDragCommand that transports the coordinates of the mouse cursor.ViewportDragCommand(SelectionLayer.MoveDirectionEnum horizontal, SelectionLayer.MoveDirectionEnum vertical) Create a ViewportDragCommand that transports the scroll directions. -
Method Summary
Modifier and TypeMethodDescriptionSame semantics asObject.clone()Used to make a copies of the command if has to passed to different layer stacks.booleanconvertToTargetLayer(ILayer targetLayer) Convert the row/column coordinates the command might be carrying from the source layer to the destination (target) layer.intgetX()intgetY()boolean
-
Constructor Details
-
ViewportDragCommand
public ViewportDragCommand(int x, int y) Create a ViewportDragCommand that transports the coordinates of the mouse cursor. This command typically triggers a background thread that performs a scroll operation for the current mouse cursor position.- Parameters:
x- The x coordinatey- The y coordinate- See Also:
-
ViewportDragCommand
public ViewportDragCommand(SelectionLayer.MoveDirectionEnum horizontal, SelectionLayer.MoveDirectionEnum vertical) Create a ViewportDragCommand that transports the scroll directions. This command typically triggers an immediate scrolling operation by one cell position in the given direction.- Parameters:
horizontal- The horizontal movement for the scroll operationMoveDirectionEnum.LEFT,MoveDirectionEnum.RIGHT,MoveDirectionEnum.NONEvertical- The vertical movement for the scroll operationMoveDirectionEnum.UP,MoveDirectionEnum.DOWN,MoveDirectionEnum.NONE- Since:
- 1.3
- See Also:
-
-
Method Details
-
getX
public int getX() -
getY
public int getY() -
getHorizontal
- Returns:
- The horizontal movement for the scroll operation
MoveDirectionEnum.LEFT,MoveDirectionEnum.RIGHT,MoveDirectionEnum.NONE - Since:
- 1.3
-
getVertical
- Returns:
- The vertical movement for the scroll operation
MoveDirectionEnum.UP,MoveDirectionEnum.DOWN,MoveDirectionEnum.NONE - Since:
- 1.3
-
isConfiguredForMoveDirection
public boolean isConfiguredForMoveDirection()- Returns:
- whether the command was created for MoveDirectionEnum values or with screen coordinates
- Since:
- 1.3
-
convertToTargetLayer
Description copied from interface:ILayerCommandConvert the row/column coordinates the command might be carrying from the source layer to the destination (target) layer. If it is not possible to convert the command to the target layer, then this method will return false and the state of this command object will remain unchanged. Note: Commands should not be processed if they fail conversion.- Specified by:
convertToTargetLayerin interfaceILayerCommand- Parameters:
targetLayer- the target layer- Returns:
- true if the command is valid after conversion, false if the command is no longer valid.
-
cloneCommand
Description copied from interface:ILayerCommandSame semantics asObject.clone()Used to make a copies of the command if has to passed to different layer stacks.- Specified by:
cloneCommandin interfaceILayerCommand- Returns:
- a cloned instance of the command
- See Also:
-