Class RMPolygonShapeTool<T extends RMPolygonShape>

    • Field Detail

      • _mouseDownPointIndex

        public static int _mouseDownPointIndex
    • Constructor Detail

      • RMPolygonShapeTool

        public RMPolygonShapeTool()
      • RMPolygonShapeTool

        public RMPolygonShapeTool​(com.google.common.eventbus.EventBus ebus)
    • Method Detail

      • createUI

        protected javax.swing.JComponent createUI()
        Override to return empty panel.
        Overrides:
        createUI in class RMTool<T extends RMPolygonShape>
      • getShapeClass

        public java.lang.Class getShapeClass()
        Returns the class that this tool is responsible for.
        Overrides:
        getShapeClass in class RMTool<T extends RMPolygonShape>
      • newInstance

        protected T newInstance()
        Returns a new instance of the shape class that this tool is responsible for.
        Overrides:
        newInstance in class RMTool<T extends RMPolygonShape>
      • getSmoothPathOnMouseUp

        public boolean getSmoothPathOnMouseUp()
        Returns whether tool should smooth path segments during creation.
      • mousePressed

        public void mousePressed​(java.awt.event.MouseEvent anEvent)
        Handles mouse pressed for polygon creation.
        Overrides:
        mousePressed in class RMTool<T extends RMPolygonShape>
      • mouseDragged

        public void mouseDragged​(java.awt.event.MouseEvent anEvent)
        Handles mouse dragged for polygon creation.
        Overrides:
        mouseDragged in class RMTool<T extends RMPolygonShape>
      • mouseReleased

        public void mouseReleased​(java.awt.event.MouseEvent anEvent)
        Handles mouse released for polygon creation.
        Overrides:
        mouseReleased in class RMTool<T extends RMPolygonShape>
      • mouseMoved

        public void mouseMoved​(T aPolygon,
                               java.awt.event.MouseEvent anEvent)
        Event handling - overridden to maintain default cursor.
        Overrides:
        mouseMoved in class RMTool<T extends RMPolygonShape>
      • mousePressed

        public void mousePressed​(T aPolygon,
                                 java.awt.event.MouseEvent anEvent)
        Event handling for shape editing.
        Overrides:
        mousePressed in class RMTool<T extends RMPolygonShape>
      • mouseDragged

        public void mouseDragged​(T aPolygon,
                                 java.awt.event.MouseEvent anEvent)
        Event handling for shape editing.
        Overrides:
        mouseDragged in class RMTool<T extends RMPolygonShape>
      • deactivateTool

        public void deactivateTool()
        Overrides standard tool method to trigger polygon creation when the tool is deactivated.
        Overrides:
        deactivateTool in class RMTool<T extends RMPolygonShape>
      • reactivateTool

        public void reactivateTool()
        Overrides standard tool method to trigger polygon creation when the tool is reactivated.
        Overrides:
        reactivateTool in class RMTool<T extends RMPolygonShape>
      • paintTool

        public void paintTool​(java.awt.Graphics2D g)
        Draws the polygon tool's path durring path creation.
        Overrides:
        paintTool in class RMTool<T extends RMPolygonShape>
      • runContextMenu

        public void runContextMenu​(RMPolygonShape aPolyShape,
                                   java.awt.event.MouseEvent anEvent)
        Runs a context menu for the given event.
      • deleteSelectedPoint

        public void deleteSelectedPoint()
        Delete the selected control point and readjust shape bounds
      • processKeyEvent

        public void processKeyEvent​(T aShape,
                                    java.awt.event.KeyEvent anEvent)
        Editor method.
        Overrides:
        processKeyEvent in class RMTool<T extends RMPolygonShape>
        Parameters:
        aShape -
        anEvent -
      • addNewPoint

        public void addNewPoint()
        Add a point to the curve by subdividing the path segment at the hit point.
      • getPathHandleSize

        public RMSize getPathHandleSize​(RMPolygonShape aPoly)
        For hit testing - returns the size of the handles scaled to path coordinates