Class PolygonTool

    • Constructor Detail

      • PolygonTool

        public PolygonTool()
    • Method Detail

      • getShapeClass

        public java.lang.Class getShapeClass()
        Returns the class that this tool is responsible for.
        Overrides:
        getShapeClass in class Tool
      • newInstance

        public RMShape newInstance()
        Returns a new instance of the shape class that this tool is responsible for.
        Overrides:
        newInstance in class Tool
      • 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 Tool
      • mouseDragged

        public void mouseDragged​(java.awt.event.MouseEvent anEvent)
        Handles mouse dragged for polygon creation.
        Overrides:
        mouseDragged in class Tool
      • mouseReleased

        public void mouseReleased​(java.awt.event.MouseEvent anEvent)
        Handles mouse released for polygon creation.
        Overrides:
        mouseReleased in class Tool
      • mouseMoved

        public void mouseMoved​(RMShape aShape,
                               java.awt.event.MouseEvent anEvent)
        Event handling - overridden to maintain default cursor.
        Overrides:
        mouseMoved in class Tool
      • mousePressed

        public void mousePressed​(RMShape aShape,
                                 java.awt.event.MouseEvent anEvent)
        Event handling for shape editing.
        Overrides:
        mousePressed in class Tool
      • mouseDragged

        public void mouseDragged​(RMShape aShape,
                                 java.awt.event.MouseEvent anEvent)
        Event handling for shape editing.
        Overrides:
        mouseDragged in class Tool
      • deactivateTool

        public void deactivateTool()
        Overrides standard tool method to trigger polygon creation when the tool is deactivated.
        Overrides:
        deactivateTool in class Tool
      • reactivateTool

        public void reactivateTool()
        Overrides standard tool method to trigger polygon creation when the tool is reactivated.
        Overrides:
        reactivateTool in class Tool
      • paintTool

        public void paintTool​(java.awt.Graphics2D g)
        Draws the polygon tool's path durring path creation.
        Overrides:
        paintTool in class Tool