Class VisibleBoundsTool
java.lang.Object
com.levigo.jadice.web.client.tool.Tool
com.levigo.jadice.web.client.tools.VisibleBoundsTool
- All Implemented Interfaces:
MenuContributor
Tool for a
ThumbnailPageView
to visualize the visible area of the associated
BasicPageView
.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
An enum of choices for the mouse-sensitivity of the visual bounds visualization.static interface
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 int
Return the dispatch priority for this tool.int
Get the tolerance in pixels within which the frame will be draggable.Return where the visual bounds visualization is sensitive to mouse input, i.e. where it can be dragged.protected void
handleMouseDragged
(MouseEditEvent e, boolean isActive) Invoked when a mouse button is pressed on a component and then dragged.protected void
handleMouseMoved
(MouseEditEvent e, boolean isActive) Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed.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.boolean
protected void
paintVisibleBounds
(Rectangle renderedPageBounds, Rectangle visibleBounds, com.levigo.util.gwtawt.client.WebGraphics wg) protected void
render
(RenderParameters parameters, boolean isActive) Renders the Tool's UI onto the givenGraphics2D
context using the givenRenderControls
.void
setFrameDragTolerance
(int frameDragTolerance) Set the tolerance in pixels within which the frame will be draggable.protected void
setManager
(ToolManager manager) Receives theToolManager
instance, which theTool
implementation has been registered for.void
setMouseSensitivity
(VisibleBoundsTool.MouseSensitivity mouseSensitivity) Set where the visual bounds visualization is sensitive to mouse input, i.e. where it can be dragged.void
setUseExclusiveModeWhileDragging
(boolean useExclusiveModeWhileDragging) Set whether to use the exclusive tool mode while the visible bounds frame is being dragged.Methods inherited from class com.levigo.jadice.web.client.tool.Tool
contribute, ensureDebugId, getActivationFeedback, getActivationFeedback, getActivationRequest, getActivationRequestForKeyPressed, getActivationRequestForMouseDragged, getActivationRequestForMousePressed, getActivationRequestForTouchMove, getActivationRequestForTouchStart, getManager, getRenderPriority, handleEditEvent, handleGestureChange, handleGestureEnd, handleGestureStart, handleKeyPressed, handleKeyReleased, handleKeyTyped, handleMouseClicked, handleMouseEntered, handleMouseExited, handleMouseWheelMoved, handlePointerDown, handlePointerMove, handlePointerUp, handleTouchEnd, handleTouchMove, handleTouchStart, propagatePropertyChange, setActive, setCursor, setCursor, setEnabled, setStatusFeedback
-
Constructor Details
-
VisibleBoundsTool
public VisibleBoundsTool()
-
-
Method Details
-
getDispatchPriority
protected int getDispatchPriority()Description copied from class:Tool
Return 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_PRIORITY
minus the render priority.- Overrides:
getDispatchPriority
in classTool
- Returns:
- the dispatch priority
-
handleMouseMoved
Description copied from class:Tool
Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed.- Overrides:
handleMouseMoved
in classTool
- Parameters:
e
- the eventisActive
- 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
-
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
-
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.
-
paintVisibleBounds
-
setManager
Description copied from class:Tool
Receives theToolManager
instance, which theTool
implementation has been registered for. If theTool
isderegistered
this method will be called with null.- Overrides:
setManager
in classTool
- Parameters:
manager
- theToolManager
-
getFrameDragTolerance
public int getFrameDragTolerance()Get the tolerance in pixels within which the frame will be draggable.- Returns:
- The frame rrag tolerance.
-
setFrameDragTolerance
public void setFrameDragTolerance(int frameDragTolerance) Set the tolerance in pixels within which the frame will be draggable.- Parameters:
frameDragTolerance
- The frame drag tolerance to set.
-
setUseExclusiveModeWhileDragging
public void setUseExclusiveModeWhileDragging(boolean useExclusiveModeWhileDragging) Set whether to use the exclusive tool mode while the visible bounds frame is being dragged. This is not normally necessary and therefore defaults tofalse
. Activate this option if some other tool conflicts with the visible bounds tool.- Parameters:
useExclusiveModeWhileDragging
- True, if exclusive mode shall be used, false else.
-
isUseExclusiveModeWhileDragging
public boolean isUseExclusiveModeWhileDragging()- Returns:
- True, if exclusive mode is used, false else.
-
getMouseSensitivity
Return where the visual bounds visualization is sensitive to mouse input, i.e. where it can be dragged.- Returns:
- the mouse-sensitivity zones
-
setMouseSensitivity
Set where the visual bounds visualization is sensitive to mouse input, i.e. where it can be dragged. SeeVisibleBoundsTool.MouseSensitivity
for options. Default:VisibleBoundsTool.MouseSensitivity.EDGES
- Parameters:
mouseSensitivity
- the mouse-sensitivity zones to use
-