Class CrossHairTool

java.lang.Object
com.levigo.jadice.web.client.tool.Tool
com.levigo.jadice.web.client.tools.CrossHairTool
All Implemented Interfaces:
MenuContributor

public class CrossHairTool extends Tool
  • Field Details

    • FROZEN_STATE_DISABLED

      public static final int FROZEN_STATE_DISABLED
      Code for disabled frozen state
      See Also:
    • FROZEN_STATE_ENABLED

      public static final int FROZEN_STATE_ENABLED
      Code for enabled frozen state
      See Also:
    • FROZEN_STATE_RESET_ON_DOCCHANGE

      public static final int FROZEN_STATE_RESET_ON_DOCCHANGE
      Code for enabled frozen state, reset on document change
      See Also:
    • FROZEN_STATE_RESET_ON_PAGECHANGE

      public static final int FROZEN_STATE_RESET_ON_PAGECHANGE
      Code for enabled frozen state, reset on page change
      See Also:
  • Constructor Details

    • CrossHairTool

      public CrossHairTool()
      Constructor
  • Method Details

    • getRenderPriority

      protected int getRenderPriority()
      Description copied from class: Tool
      Return the render priority for this tool. Tools with higher dispatch priorities are rendered 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.DEFAULT_PRIORITY.
      Overrides:
      getRenderPriority in class Tool
      Returns:
      the dispatch priority
    • 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 the Tool.handleEditEvent(boolean, EditEvent) and Tool.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 class Tool
      Parameters:
      enabled - controls whether to enable or disable this Tool
    • 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
    • getColor

      public Color getColor()
      Returns the line color
      Returns:
      Color
    • setColor

      public void setColor(Color color)
      Changes the line color.
      Parameters:
      color - The color to use.
    • getLineWidth

      public int getLineWidth()
      Returns the line width.
      Returns:
      The line width.
    • setLineWidth

      public void setLineWidth(int lineWidth)
      Changes the line width.
      Parameters:
      lineWidth - The line width to use.
    • getFrozenStateMode

      public int getFrozenStateMode()
      Returns the frozen state mode.

      The frozen state mode describes how instances of the CrossHairPane class handle the frozen mode. See also FROZEN_STATE_DISABLED, FROZEN_STATE_ENABLED, FROZEN_STATE_RESET_ON_DOCCHANGE, FROZEN_STATE_RESET_ON_PAGECHANGE.

      Returns:
      The frozen state mode used by instances of this class.
    • isFrozen

      public boolean isFrozen()
      Gets the frozen state.
      Returns:
      true if the pane is in frozen state; false otherwise
    • setFrozen

      public void setFrozen(boolean frozen)
      Sets / unsets the frozen state where the pane will remain in focus of the last point before being set to frozen. If the frozen state mode is disabled, this method will do nothing.
      Parameters:
      frozen - the frozen flag to be set
      See Also:
    • handleMouseClicked

      protected void handleMouseClicked(MouseEditEvent e, boolean isActive)
      Description copied from class: Tool
      Invoked when the mouse button has been clicked (pressed and released) on a component.
      Overrides:
      handleMouseClicked in class Tool
      Parameters:
      e - the MouseEditEvent
      isActive - whether this tool is currently active
    • 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
    • setFrozenStateMode

      public void setFrozenStateMode(int frozenStateMode)
    • setToggleFrozenMouseButton

      public void setToggleFrozenMouseButton(int toggleFrozenMouseButton)
    • getToggleFrozenMouseButton

      public int getToggleFrozenMouseButton()
    • setToggleFrozenModifier

      public void setToggleFrozenModifier(int toggleFrozenModifier)
    • getToggleFrozenModifier

      public int getToggleFrozenModifier()
    • handleKeyPressed

      protected void handleKeyPressed(KeyEditEvent editEvent, boolean isActive)
      Description copied from class: Tool
      Invoked when a key has been pressed. See the class description for KeyEvent for a definition of a key pressed event.
      Overrides:
      handleKeyPressed in class Tool
      Parameters:
      editEvent - the MouseEditEvent
      isActive - whether this tool is currently active