Class AbstractIgnitionRMTool<T extends RMParentShape>

Direct Known Subclasses:
GenericInstantiationTool

public abstract class AbstractIgnitionRMTool<T extends RMParentShape> extends RMTool<T>
Author: Perry Arellano-Jones Year: 12May2015

This class provides the base for any RMTool class that we want to allow drag-to-size RMShape creation for. To add a new tool, simply extend this class and implement createShapeTool to create a new instance of the RMTool you'd like to create. Note that some RMTools do not have native methods to create an Shape at an arbitrary location/size, so a new constructor may be required.

  • Field Details

    • TOOL_USED

      public static final String TOOL_USED
      See Also:
    • x

      protected double x
    • y

      protected double y
    • width

      protected double width
    • height

      protected double height
    • currentEditor

      protected RMEditor currentEditor
    • eventBus

      protected com.google.common.eventbus.EventBus eventBus
    • parent

      protected RMParentShape parent
  • Constructor Details

    • AbstractIgnitionRMTool

      public AbstractIgnitionRMTool(RMEditor currentEditor, com.google.common.eventbus.EventBus eventBus)
  • Method Details

    • createShapeTool

      public abstract RMShape createShapeTool(RMEditor editor, String keyPath, double x, double y, double width, double height)
    • mousePressed

      public void mousePressed(MouseEvent anEvent)
      Description copied from class: RMTool
      Event handling for shape creation.
      Overrides:
      mousePressed in class RMTool<T extends RMParentShape>
    • mouseDragged

      public void mouseDragged(MouseEvent anEvent)
      Event handling for shape creation, collect the location of the drag to size the new tool
      Overrides:
      mouseDragged in class RMTool<T extends RMParentShape>
    • mouseReleased

      public void mouseReleased(MouseEvent anEvent)
      On release, we want to get rid of the rectangle and create a new Tool in its place, then notify the palette the tool was used to turn off the button toggle.
      Overrides:
      mouseReleased in class RMTool<T extends RMParentShape>