Class VisibleBoundsTool

  • All Implemented Interfaces:
    MenuContributor

    public class VisibleBoundsTool
    extends Tool
    Tool for a ThumbnailPageView to visualize the visible area of the associated BasicPageView.
    • Constructor Detail

      • VisibleBoundsTool

        public VisibleBoundsTool()
    • Method Detail

      • 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 range Tool.MIN_PRIORITY...Tool.MAX_PRIORITY. The default priority is equal to Tool.MAX_PRIORITY minus the render priority.
        Overrides:
        getDispatchPriority in class Tool
        Returns:
        the dispatch priority
      • 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
        Parameters:
        e - the event
        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
        Parameters:
        e - the event
        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
        Parameters:
        e - the event
        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 DragDrop implementations, MouseDragEvent events may not be delivered during a native Drag&Drop operation.

        Overrides:
        handleMouseDragged in class Tool
        Parameters:
        e - the event
        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
      • paintVisibleBounds

        protected void paintVisibleBounds​(Rectangle renderedPageBounds,
                                          Rectangle visibleBounds,
                                          com.levigo.util.gwtawt.client.WebGraphics wg)
      • 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 to false. 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

        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