Class AreaSelectionTool
- All Implemented Interfaces:
MenuContributor
Actions can be registered via addRegisteredActions(RegisteredAction...). If an area is
selected, a toolbar will pop up to execute one of the registered actions. If no toolbar is
desired, a default action can be set via setDefaultAction(RegisteredAction).
If a default action is set, it will be executed immediately and no toolbar will be shown. This default action will be removed after the area selection and has to be set before each selection, if desired.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.levigo.jadice.web.client.tool.Tool
Tool.ActivationRequest -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Point2Dprotected Point2Dprotected Pageprotected Point2Dprotected Point2DFields inherited from class com.levigo.jadice.web.client.tool.Tool
DEFAULT_PRIORITY, MAX_PRIORITY, MIN_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRegisteredActions(RegisteredAction... registeredActions) Returns the current default action which is registered to be executed on the next selection.protected Rectangle2DgetSelectionRectangle(Point2D startPoint, Point2D endPoint) protected voidhandleKeyReleased(KeyEditEvent e, boolean isActive) Invoked when a key has been released.protected voidhandleMouseDragged(MouseEditEvent e, boolean isActive) Invoked when a mouse button is pressed on a component and then dragged.protected voidhandleMouseEntered(MouseEditEvent e, boolean isActive) Invoked when the mouse cursor enters the unobscured part of component's geometry.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.protected voidonAreaSelected(PageView pageView, com.levigo.jadice.web.shared.model.internal.SelectedArea area) Called when the user selected an area.protected voidrender(RenderParameters parameters, boolean isActive) Renders the Tool's UI onto the givenGraphics2Dcontext using the givenRenderControls.voidsetDefaultAction(RegisteredAction defaultAction) Sets the default action to be executed on the next area selection.protected voidsetEnabled(boolean enabled) Receive notification from the tool manager about the tool's enabled state.Methods inherited from class com.levigo.jadice.web.client.tool.Tool
contribute, ensureDebugId, getActivationFeedback, getActivationFeedback, getActivationRequest, getActivationRequestForKeyPressed, getActivationRequestForMouseDragged, getActivationRequestForMousePressed, getActivationRequestForTouchMove, getActivationRequestForTouchStart, getDispatchPriority, getManager, getRenderPriority, handleEditEvent, handleGestureChange, handleGestureEnd, handleGestureStart, handleKeyPressed, handleKeyTyped, handleMouseClicked, handleMouseExited, handleMouseMoved, handleMouseWheelMoved, handlePointerDown, handlePointerMove, handlePointerUp, handleTouchEnd, handleTouchMove, handleTouchStart, propagatePropertyChange, setActive, setCursor, setCursor, setManager, setStatusFeedback
-
Field Details
-
startPointDocument
-
endPointDocument
-
startPointScreen
-
endPointScreen
-
page
-
-
Constructor Details
-
AreaSelectionTool
public AreaSelectionTool()
-
-
Method Details
-
render
Description copied from class:ToolRenders the Tool's UI onto the givenGraphics2Dcontext using the givenRenderControls.This render method is called within the context and during the rendering of a single page. The page being rendered is passed to implementors of this method in order to be able to control and influence the page rendering.
-
handleMouseEntered
Description copied from class:ToolInvoked when the mouse cursor enters the unobscured part of component's geometry.- Overrides:
handleMouseEnteredin classTool- Parameters:
e- theMouseEditEventisActive- whether this tool is currently active
-
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
-
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
-
handleKeyReleased
Description copied from class:ToolInvoked when a key has been released. See the class description forKeyEventfor a definition of a key released event.- Overrides:
handleKeyReleasedin classTool- Parameters:
e- theMouseEditEventisActive- whether this tool is currently active
-
setEnabled
protected void setEnabled(boolean enabled) Description copied from class:ToolReceive notification from the tool manager about the tool's enabled state. In general, tools need not and should not try to implement different behaviour depending on the enabled state, as this is already covered by the ToolManager calling theTool.handleEditEvent(boolean, EditEvent)andTool.render(RenderParameters, boolean)in the appropriate state only. However, some tools may need to perform extended actions (for example, for resource management purposes) upon a change of the enabled state.- Overrides:
setEnabledin classTool- Parameters:
enabled- controls whether to enable or disable thisTool
-
getSelectionRectangle
-
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
-
getRegisteredActions
-
addRegisteredActions
-
getDefaultAction
Returns the current default action which is registered to be executed on the next selection.- Returns:
- the default action
-
setDefaultAction
Sets the default action to be executed on the next area selection. Please note that after a selection, the default action will be set to null and has to be set when starting the area selection with a command.- Parameters:
defaultAction- the default action to be executed on next selection
-
createToolbarActionContext
-
getPageView
-