com.levigo.jadice.swing.thumbnailview
Class VisibleBoundsTool

java.lang.Object
  extended by com.levigo.jadice.swing.tool.Tool
      extended by com.levigo.jadice.swing.thumbnailview.VisibleBoundsTool
All Implemented Interfaces:
MenuContributor

public class VisibleBoundsTool
extends Tool

A tool used to visualize the area of the current page that is currently visible within an associated page view. The visible area, i.e. the bounds of the view port, are visualized as a rectangle floating above the thumb-nail representation of the current page. In addition to the visualization this tool also supports navigation by dragging the visible area within the current page or onto other pages in the same ThumbnailView.

UI-Properties used by this component


UI-Properties
Property Type Description Default value
ThumbnailView.visibleBoundsBorder Border The border used to visualize the visible bounds A 1-pixel red line or a fancier variant configured via GlobalJadiceComponentAddon
Nested Class Summary
static class VisibleBoundsTool.MouseSensitivity
          An enum of choices for the mouse-sensitivity of the visual bounds visualization.
 
Nested classes/interfaces inherited from class com.levigo.jadice.swing.tool.Tool
Tool.ActivationRequest
 
Field Summary
 
Fields inherited from class com.levigo.jadice.swing.tool.Tool
DEFAULT_PRIORITY, MAX_PRIORITY, MIN_PRIORITY
 
Constructor Summary
VisibleBoundsTool()
           
 
Method Summary
 int getFrameDragTolerance()
          Get the tolerance in pixels within which the frame will be draggable.
 VisibleBoundsTool.MouseSensitivity getMouseSensitivity()
          Return where the visual bounds visualization is sensitive to mouse input, i.e.
 Border getVisualizationBorder()
          Return the Border used to paint the visible bounds visualization.
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 isUseExclusiveModeWhileDragging()
           
protected  void render(RenderParameters parameters, boolean isActive)
          Renders the Tool's UI onto the given Graphics2D context using the given RenderControls.
 void setFrameDragTolerance(int frameDragTolerance)
          Set the tolerance in pixels within which the frame will be draggable.
protected  void setManager(ToolManager manager)
          Receives the ToolManager instance, which the Tool implementation has been registered for.
 void setMouseSensitivity(VisibleBoundsTool.MouseSensitivity mouseSensitivity)
          Set where the visual bounds visualization is sensitive to mouse input, i.e.
 void setUseExclusiveModeWhileDragging(boolean useExclusiveModeWhileDragging)
          Set whether to use the exclusive tool mode while the visible bounds frame is being dragged.
 void setVisualizationBorder(Border visualizationBorder)
          Set the Border used to paint the visible bounds visualization.
 
Methods inherited from class com.levigo.jadice.swing.tool.Tool
contribute, getActivationFeedback, getActivationRequest, getActivationRequestForKeyPressed, getActivationRequestForMouseDragged, getActivationRequestForMousePressed, getCursor, getDispatchPriority, getManager, getRenderPriority, handleEditEvent, handleKeyPressed, handleKeyReleased, handleKeyTyped, handleMouseClicked, handleMouseEntered, handleMouseExited, handleMouseWheelMoved, propagatePropertyChange, setActive, setCursor, setEnabled, setStatusFeedback
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VisibleBoundsTool

public VisibleBoundsTool()
Method Detail

handleMouseMoved

protected void handleMouseMoved(MouseEditEvent e,
                                boolean isActive)
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 class Tool
isActive - whether this tool is currently active

handleMousePressed

protected void handleMousePressed(MouseEditEvent e,
                                  boolean isActive)
Description copied from class: Tool
Invoked when a mouse button has been pressed on a component.

Overrides:
handleMousePressed in class Tool
isActive - whether this tool is currently active

handleMouseReleased

protected void handleMouseReleased(MouseEditEvent e,
                                   boolean isActive)
Description copied from class: Tool
Invoked when a mouse button has been released on a component.

Overrides:
handleMouseReleased in class Tool
isActive - whether this tool is currently active

handleMouseDragged

protected void handleMouseDragged(MouseEditEvent e,
                                  boolean isActive)
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 Drag&Drop implementations, MOUSE_DRAGGED events may not be delivered during a native Drag&Drop operation.

Overrides:
handleMouseDragged in class Tool
isActive - whether this tool is currently active

render

protected void render(RenderParameters parameters,
                      boolean isActive)
Description copied from class: Tool
Renders the Tool's UI onto the given Graphics2D context using the given RenderControls.

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.

Overrides:
render in class Tool
Parameters:
parameters - the view component which is currently being rendered
isActive - whether the called tool is currently active

setManager

protected void setManager(ToolManager manager)
Description copied from class: Tool
Receives the ToolManager instance, which the Tool implementation has been registered for. If the Tool is deregistered this method will be called with null.

Overrides:
setManager in class Tool

getFrameDragTolerance

public int getFrameDragTolerance()
Get the tolerance in pixels within which the frame will be draggable.

Returns:
the frameDragTolerance

setFrameDragTolerance

public void setFrameDragTolerance(int frameDragTolerance)
Set the tolerance in pixels within which the frame will be draggable.

Parameters:
frameDragTolerance - the frameDragTolerance 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 to false. Activate this option if some other tool conflicts with the visible bounds tool.

Parameters:
useExclusiveModeWhileDragging -

isUseExclusiveModeWhileDragging

public boolean isUseExclusiveModeWhileDragging()

getMouseSensitivity

public VisibleBoundsTool.MouseSensitivity 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

public void setMouseSensitivity(VisibleBoundsTool.MouseSensitivity mouseSensitivity)
Set where the visual bounds visualization is sensitive to mouse input, i.e. where it can be dragged. See VisibleBoundsTool.MouseSensitivity for options. Default: VisibleBoundsTool.MouseSensitivity.EDGES

Parameters:
mouseSensitivity - the mouse-sensitivity zones to use

getVisualizationBorder

public Border getVisualizationBorder()
Return the Border used to paint the visible bounds visualization.

Returns:
a Border

setVisualizationBorder

public void setVisualizationBorder(Border visualizationBorder)
Set the Border used to paint the visible bounds visualization. The default value is taken from the UI property ThumbnailView.visibleBoundsBorder.

Parameters:
visualizationBorder - the Border


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.