Class ViewportDragCommand
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.viewport.command.ViewportDragCommand
-
- All Implemented Interfaces:
ILayerCommand
public class ViewportDragCommand extends Object implements ILayerCommand
Command that is used to trigger a scrolling operation. Typically fired by other drag operations.
-
-
Constructor Summary
Constructors Constructor Description ViewportDragCommand(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ILayerCommand
cloneCommand()
Same semantics asObject.clone()
Used to make a copies of the command if has to passed to different layer stacks.boolean
convertToTargetLayer(ILayer targetLayer)
Convert the row/column coordinates the command might be carrying from the source layer to the destination (target) layer.SelectionLayer.MoveDirectionEnum
getHorizontal()
SelectionLayer.MoveDirectionEnum
getVertical()
int
getX()
int
getY()
boolean
isConfiguredForMoveDirection()
-
-
-
Constructor Detail
-
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:
ViewportLayer.drag(int, int)
-
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.NONE
vertical
- The vertical movement for the scroll operationMoveDirectionEnum.UP
,MoveDirectionEnum.DOWN
,MoveDirectionEnum.NONE
- Since:
- 1.3
- See Also:
ViewportLayer.drag(MoveDirectionEnum, MoveDirectionEnum)
-
-
Method Detail
-
getX
public int getX()
-
getY
public int getY()
-
getHorizontal
public SelectionLayer.MoveDirectionEnum getHorizontal()
- Returns:
- The horizontal movement for the scroll operation
MoveDirectionEnum.LEFT
,MoveDirectionEnum.RIGHT
,MoveDirectionEnum.NONE
- Since:
- 1.3
-
getVertical
public SelectionLayer.MoveDirectionEnum 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
public boolean convertToTargetLayer(ILayer targetLayer)
Description copied from interface:ILayerCommand
Convert 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:
convertToTargetLayer
in interfaceILayerCommand
- Parameters:
targetLayer
- the target layer- Returns:
- true if the command is valid after conversion, false if the command is no longer valid.
-
cloneCommand
public ILayerCommand cloneCommand()
Description copied from interface:ILayerCommand
Same semantics asObject.clone()
Used to make a copies of the command if has to passed to different layer stacks.- Specified by:
cloneCommand
in interfaceILayerCommand
- Returns:
- a cloned instance of the command
- See Also:
GridLayer.doCommand(ILayerCommand)
-
-