Class PanTool
java.lang.Object
com.levigo.jadice.web.client.tool.Tool
com.levigo.jadice.web.client.tools.PanTool
- All Implemented Interfaces:
MenuContributor
-
Nested Class Summary
Nested classes/interfaces inherited from class com.levigo.jadice.web.client.tool.Tool
Tool.ActivationRequest -
Field Summary
Fields inherited from class com.levigo.jadice.web.client.tool.Tool
DEFAULT_PRIORITY, MAX_PRIORITY, MIN_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Tool.ActivationRequestProvide feedback for the user about what would happen, if the mouse were pressed at the current location.protected Tool.ActivationRequestReturn the auto-activation request for this this tool in response to the given mouse press.protected intReturn the dispatch priority for this tool.intReturns the current mask.protected voidhandleEditEvent(boolean isActive, EditEvent e) Handle the givenEditEvent.protected voidhandleMouseDragged(MouseEditEvent e, boolean isActive) Invoked when a mouse button is pressed on a component and then dragged.protected voidhandleMousePressed(MouseEditEvent e, boolean isActive) Invoked when a mouse button has been pressed on a component.protected voidhandleMouseReleased(MouseEditEvent e, boolean isActive) Invoked when a mouse button has been released on a component.booleanvoidsetModifierAndButtonMask(int modifierAndButtonMask) Set the mask of modifier keys (Shift, Control, Alt etc.) and mouse buttons (left, right etc.)voidsetUseIdlePanModeCursor(boolean useIdlePanModeCursor) Set whether to use the pan mode cursor when idle, i.e. while the button is not pressed, but a buttom press would initiate the pan mode.Methods inherited from class com.levigo.jadice.web.client.tool.Tool
contribute, ensureDebugId, getActivationFeedback, getActivationRequest, getActivationRequestForKeyPressed, getActivationRequestForMouseDragged, getActivationRequestForTouchMove, getActivationRequestForTouchStart, getManager, getRenderPriority, handleGestureChange, handleGestureEnd, handleGestureStart, handleKeyPressed, handleKeyReleased, handleKeyTyped, handleMouseClicked, handleMouseEntered, handleMouseExited, handleMouseMoved, handleMouseWheelMoved, handlePointerDown, handlePointerMove, handlePointerUp, handleTouchEnd, handleTouchMove, handleTouchStart, propagatePropertyChange, render, setActive, setCursor, setCursor, setEnabled, setManager, setStatusFeedback
-
Constructor Details
-
PanTool
public PanTool()
-
-
Method Details
-
getDispatchPriority
protected int getDispatchPriority()Description copied from class:ToolReturn the dispatch priority for this tool. Tools with higher dispatch priorities receive events earlier than tools with lower priorities. The priority should be in the rangeTool.MIN_PRIORITY...Tool.MAX_PRIORITY. The default priority is equal toTool.MAX_PRIORITYminus the render priority.- Overrides:
getDispatchPriorityin classTool- Returns:
- the dispatch priority
-
handleEditEvent
Description copied from class:ToolHandle the givenEditEvent. This method dispatches the edit event to the individualhandleXYZ()-Methods. However, implementors may want and are allowed to override this method in order to perform standard handling tasks common to all types of events.- Overrides:
handleEditEventin classTool- Parameters:
isActive- whether this tool is currently activee- the event
-
handleMousePressed
Description copied from class:ToolInvoked when a mouse button has been pressed on a component.- Overrides:
handleMousePressedin classTool- Parameters:
e- the eventisActive- whether this tool is currently active
-
getActivationFeedback
Description copied from class:ToolProvide feedback for the user about what would happen, if the mouse were pressed at the current location. This method is called while handlingMouseMoveEvents. If this method returnsnullno feedback is provided at all. The activation request returned from this method is the same object that is used duringTool.getActivationRequestForKeyPressed(KeyEditEvent)to signal the auto-activation candidacy. This method should only return an activation request if it will actually candidate for auto-activation later on usingTool.getActivationRequestForMousePressed(MouseEditEvent)orTool.getActivationRequestForMouseDragged(MouseEditEvent).- Overrides:
getActivationFeedbackin classTool- Parameters:
e- theMouseEditEvent- Returns:
- the
Tool.ActivationRequest
-
getActivationRequestForMousePressed
Description copied from class:ToolReturn the auto-activation request for this this tool in response to the given mouse press. If the tool returns anTool.ActivationRequest, it becomes eligible for auto-activation. However, the final decision about which tool will actually be activated is up to theToolActivationPolicyused be the tool manager.- Overrides:
getActivationRequestForMousePressedin classTool- Parameters:
e- theKeyEditEvent- Returns:
- an
Tool.ActivationRequestornullif the tool does not seek to be auto-activated at this time.
-
handleMouseDragged
Description copied from class:ToolInvoked when a mouse button is pressed on a component and then dragged.MOUSE_DRAGGEDevents will continue to be delivered to the component where the drag originated until the mouse button is released (regardless of whether the mouse position is within the bounds of the component).Due to platform-dependent DragDrop implementations,
MouseDragEventevents may not be delivered during a native Drag&Drop operation.- Overrides:
handleMouseDraggedin classTool- Parameters:
e- the eventisActive- whether this tool is currently active
-
handleMouseReleased
Description copied from class:ToolInvoked when a mouse button has been released on a component.- Overrides:
handleMouseReleasedin classTool- Parameters:
e- the eventisActive- whether this tool is currently active
-
setModifierAndButtonMask
public void setModifierAndButtonMask(int modifierAndButtonMask) Set the mask of modifier keys (Shift, Control, Alt etc.) and mouse buttons (left, right etc.) to be used to initiate panning. The modifier mask must use theInputEventconstants containing_DOWN_in their name. The default is to use just the left mouse button.- Parameters:
modifierAndButtonMask- The mask to use.- See Also:
-
getModifierAndButtonMask
public int getModifierAndButtonMask()Returns the current mask.- Returns:
- The current mask.
-
setUseIdlePanModeCursor
public void setUseIdlePanModeCursor(boolean useIdlePanModeCursor) Set whether to use the pan mode cursor when idle, i.e. while the button is not pressed, but a buttom press would initiate the pan mode. Iftrue, the pan mode cursor is shown in idle mode, iffalseit is still shown, but only during the active panning gesture. The default isfalse.- Parameters:
useIdlePanModeCursor- True, if the pan mode cursor shall be used, false else.
-
isUseIdlePanModeCursor
public boolean isUseIdlePanModeCursor()- Returns:
- True, when pan mode cursor is used, false else.
-