Package com.reportmill.panels
Class PolygonTool
- java.lang.Object
-
- com.reportmill.base.RMObject
-
- com.reportmill.panels.Tool
-
- com.reportmill.panels.PolygonTool
-
- All Implemented Interfaces:
RMArchiver.Archiving
,java.lang.Cloneable
- Direct Known Subclasses:
PolygonTool.PencilTool
public class PolygonTool extends Tool
This class manages creation and editing of polygon shapes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PolygonTool.PencilTool
This inner class defines a polygon tool subclass for drawing freehand pencil sketches instead.-
Nested classes/interfaces inherited from class com.reportmill.panels.Tool
Tool.RMShapeHandle
-
-
Field Summary
-
Fields inherited from class com.reportmill.panels.Tool
HandleMaxXMaxY, HandleMaxXMidY, HandleMaxXMinY, HandleMidXMaxY, HandleMidXMinY, HandleMinXMaxY, HandleMinXMidY, HandleMinXMinY, HandleWidth
-
-
Constructor Summary
Constructors Constructor Description PolygonTool()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deactivateTool()
Overrides standard tool method to trigger polygon creation when the tool is deactivated.java.lang.Class
getShapeClass()
Returns the class that this tool is responsible for.boolean
getSmoothPathOnMouseUp()
Returns whether tool should smooth path segments during creation.void
mouseDragged(RMShape aShape, java.awt.event.MouseEvent anEvent)
Event handling for shape editing.void
mouseDragged(java.awt.event.MouseEvent anEvent)
Handles mouse dragged for polygon creation.void
mouseMoved(RMShape aShape, java.awt.event.MouseEvent anEvent)
Event handling - overridden to maintain default cursor.void
mousePressed(RMShape aShape, java.awt.event.MouseEvent anEvent)
Event handling for shape editing.void
mousePressed(java.awt.event.MouseEvent anEvent)
Handles mouse pressed for polygon creation.void
mouseReleased(java.awt.event.MouseEvent anEvent)
Handles mouse released for polygon creation.RMShape
newInstance()
Returns a new instance of the shape class that this tool is responsible for.void
paintTool(java.awt.Graphics2D g)
Draws the polygon tool's path durring path creation.void
reactivateTool()
Overrides standard tool method to trigger polygon creation when the tool is reactivated.-
Methods inherited from class com.reportmill.panels.Tool
activateTool, didBecomeSuperSelectedShapeInEditor, editor, flushChanges, getCoreTool, getCoreToolIndex, getHandleAtPoint, getHandleCount, getHandlePoint, getHandleRect, getImageIcon, getImageIcon, getSelectedShape, getSelectedShapes, getSelectTool, getShapeHandleAtPoint, getTool, getTool, getUI, getWindowTitle, isInstance, isSelected, isSuperSelected, mouseMoved, mousePressedSelection, mouseReleased, moveShapeHandle, paintSelectedShape, paintSuperSelectedShape, processKeyEvent, resetUI, respondUI, willLoseSuperSelectionInEditor
-
Methods inherited from class com.reportmill.base.RMObject
clone, copy, didChange, didUndo, getAnimAttribute, getClassNameShort, initWithArchiver, undoClone, undoCopy, undoEquals
-
-
-
-
Method Detail
-
getShapeClass
public java.lang.Class getShapeClass()
Returns the class that this tool is responsible for.- Overrides:
getShapeClass
in classTool
-
newInstance
public RMShape newInstance()
Returns a new instance of the shape class that this tool is responsible for.- Overrides:
newInstance
in classTool
-
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 classTool
-
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent anEvent)
Handles mouse dragged for polygon creation.- Overrides:
mouseDragged
in classTool
-
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent anEvent)
Handles mouse released for polygon creation.- Overrides:
mouseReleased
in classTool
-
mouseMoved
public void mouseMoved(RMShape aShape, java.awt.event.MouseEvent anEvent)
Event handling - overridden to maintain default cursor.- Overrides:
mouseMoved
in classTool
-
mousePressed
public void mousePressed(RMShape aShape, java.awt.event.MouseEvent anEvent)
Event handling for shape editing.- Overrides:
mousePressed
in classTool
-
mouseDragged
public void mouseDragged(RMShape aShape, java.awt.event.MouseEvent anEvent)
Event handling for shape editing.- Overrides:
mouseDragged
in classTool
-
deactivateTool
public void deactivateTool()
Overrides standard tool method to trigger polygon creation when the tool is deactivated.- Overrides:
deactivateTool
in classTool
-
reactivateTool
public void reactivateTool()
Overrides standard tool method to trigger polygon creation when the tool is reactivated.- Overrides:
reactivateTool
in classTool
-
-