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 Detail

      • 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
    • Constructor Detail

      • AbstractIgnitionRMTool

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

      • createShapeTool

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

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

        public void mouseDragged​(java.awt.event.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​(java.awt.event.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>