Class SelectTool

All Implemented Interfaces:
RMArchiver.Archiving, Cloneable

public class SelectTool extends Tool
This class handles mouse selection and manipulation of shapes, including: - Click on a shape selects a shape - Double click on a shape super-selects a shape - Drag a rect selects shapes - Shift click or shift drag XORs selection - Click and drag handle resizes shape
  • Field Details

  • Constructor Details

    • SelectTool

      public SelectTool()
      Creates a new select tool.
  • Method Details

    • mouseMoved

      public void mouseMoved(MouseEvent anEvent)
      Handles mouse moved - forward on to super selected shape tool.
      Overrides:
      mouseMoved in class Tool
    • mousePressed

      public void mousePressed(MouseEvent anEvent)
      Handles mouse pressed for the select tool.
      Overrides:
      mousePressed in class Tool
    • mouseDragged

      public void mouseDragged(MouseEvent anEvent)
      Handles mouse dragged for the select tool.
      Overrides:
      mouseDragged in class Tool
    • mouseReleased

      public void mouseReleased(MouseEvent anEvent)
      Handles mouse released for the select tool.
      Overrides:
      mouseReleased in class Tool
    • getUI

      public RJPanel getUI()
      Returns the Swing UI for the current selected shape(s).
      Overrides:
      getUI in class Tool
    • resetUI

      public void resetUI()
      Called to reset the Swing GUI for the currently selected shape.
      Overrides:
      resetUI in class Tool
    • getDragMode

      public int getDragMode()
      Returns the last drag mode handled by the select tool.
    • getRedoMousePressed

      public boolean getRedoMousePressed()
      Returns whether select tool should redo current mouse down.
    • setRedoMousePressed

      public void setRedoMousePressed(boolean aFlag)
      Sets whether select tool should redo current mouse dwon.
    • paintTool

      public void paintTool(Graphics2D g)
      Paints tool specific things, like handles.
      Overrides:
      paintTool in class Tool
    • reactivateTool

      public void reactivateTool()
      Tool callback selects parent of selected shapes (or just shape, if it's super-selected).
      Overrides:
      reactivateTool in class Tool