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 Point2D
protected Point2D
protected Page
protected Point2D
protected Point2D
Fields inherited from class com.levigo.jadice.web.client.tool.Tool
DEFAULT_PRIORITY, MAX_PRIORITY, MIN_PRIORITY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRegisteredActions
(RegisteredAction... registeredActions) Returns the current default action which is registered to be executed on the next selection.protected Rectangle2D
getSelectionRectangle
(Point2D startPoint, Point2D endPoint) protected void
handleKeyReleased
(KeyEditEvent e, boolean isActive) Invoked when a key has been released.protected void
handleMouseDragged
(MouseEditEvent e, boolean isActive) Invoked when a mouse button is pressed on a component and then dragged.protected void
handleMouseEntered
(MouseEditEvent e, boolean isActive) Invoked when the mouse cursor enters the unobscured part of component's geometry.protected void
handleMousePressed
(MouseEditEvent e, boolean isActive) Invoked when a mouse button has been pressed on a component.protected void
handleMouseReleased
(MouseEditEvent e, boolean isActive) Invoked when a mouse button has been released on a component.protected void
onAreaSelected
(PageView pageView, com.levigo.jadice.web.shared.model.internal.SelectedArea area) Called when the user selected an area.protected void
render
(RenderParameters parameters, boolean isActive) Renders the Tool's UI onto the givenGraphics2D
context using the givenRenderControls
.void
setDefaultAction
(RegisteredAction defaultAction) Sets the default action to be executed on the next area selection.protected void
setEnabled
(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, 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:Tool
Renders the Tool's UI onto the givenGraphics2D
context 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:Tool
Invoked when the mouse cursor enters the unobscured part of component's geometry.- Overrides:
handleMouseEntered
in classTool
- Parameters:
e
- theMouseEditEvent
isActive
- whether this tool is currently active
-
handleMousePressed
Description copied from class:Tool
Invoked when a mouse button has been pressed on a component.- Overrides:
handleMousePressed
in classTool
- Parameters:
e
- the eventisActive
- whether this tool is currently active
-
handleMouseReleased
Description copied from class:Tool
Invoked when a mouse button has been released on a component.- Overrides:
handleMouseReleased
in classTool
- Parameters:
e
- the eventisActive
- whether this tool is currently active
-
handleKeyReleased
Description copied from class:Tool
Invoked when a key has been released. See the class description forKeyEvent
for a definition of a key released event.- Overrides:
handleKeyReleased
in classTool
- Parameters:
e
- theMouseEditEvent
isActive
- whether this tool is currently active
-
setEnabled
protected void setEnabled(boolean enabled) Description copied from class:Tool
Receive 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:
setEnabled
in classTool
- Parameters:
enabled
- controls whether to enable or disable thisTool
-
getSelectionRectangle
-
handleMouseDragged
Description copied from class:Tool
Invoked when a mouse button is pressed on a component and then dragged.MOUSE_DRAGGED
events 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,
MouseDragEvent
events may not be delivered during a native Drag&Drop operation.- Overrides:
handleMouseDragged
in 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
-