Package com.reportmill.panels
Class Tool
java.lang.Object
com.reportmill.base.RMObject
com.reportmill.panels.Tool
- All Implemented Interfaces:
RMArchiver.Archiving
,Cloneable
- Direct Known Subclasses:
BarcodeTool
,CellDividerTool
,CellTableTool
,CrossTabTool
,DocumentTool
,GraphBarLabelTool
,GraphTool
,GraphTool.GraphContentTool
,ImageTool
,LabelsTool
,LabelTool
,LineGraphTool
,LineSegmentTool
,NestedDocTool
,OvalTool
,PageTool
,PolygonTool
,RBTool
,RectangleTool
,Scene3DTool
,SelectTool
,SoundTool
,SwitchShapeTool
,TableGroupTool
,TableRowTool
,TableTool
,TextTool
,TextToolAdvanced
This is the base class for tools in RM - the objects that provide GUI editing for RM shapes.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
An inner class describing a shape and a handle. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Called when a tool is selected.void
Called when a tool is deselected (when another tool is selected).void
didBecomeSuperSelectedShapeInEditor
(RMShape aShape, RMEditor anEditor) Editor method - called when an instance of this tool's shape is super selected.editor()
Returns the current editor.void
flushChanges
(RMEditor anEditor, RMShape aShape) Called when a tool is deselected to give an opportunity to finalize changes in progress.static Tool
getCoreTool
(int anIndex) Returns the specific core tool at the given index.static int
getCoreToolIndex
(Tool aTool) Returns the core tool index for the given tool.int
getHandleAtPoint
(RMShape aShape, Point2D aPoint, boolean isSuperSelected) Returns the handle hit by the given editor coord point.int
getHandleCount
(RMShape aShape) Returns the number of handles for this shape.getHandlePoint
(RMShape aShape, int handle, boolean isSuperSelected) Returns the point for the handle of the given shape at the given handle index in the given shape's coords.getHandleRect
(RMShape aShape, int handle, boolean isSuperSelected) Returns the rect for the handle at the given index in editor coords.Returns the image icon used to represent shapes that this tool represents.static ImageIcon
getImageIcon
(Class aClass) Returns the image icon for the given shape class.Returns the current selected shape for the current editor.Returns the current selected shapes for the current editor.static SelectTool
Returns the SelectTool.Returns the shape class that this tool handles.getShapeHandleAtPoint
(Point2D aPoint) Returns the shape handle for the given editor point.static Tool
Returns the specific tool for a given shape.static Tool
Returns the specific tool for a list of shapes (if they have the same tool).getUI()
Returns the Swing UI panel for this tool.Returns the string to be used for the inspector window title.boolean
isInstance
(Object anObj) Returns whether given object is editable by this tool.boolean
isSelected
(RMShape aShape) Utility method, returns whether a given shape is selected in the editor.boolean
isSuperSelected
(RMShape aShape) Utility method, returns whether a given shape is superselected in the editor.void
mouseDragged
(RMShape aShape, MouseEvent anEvent) Event handling from select tool for super selected shapes.void
mouseDragged
(MouseEvent anEvent) Event handling for shape creation.void
mouseMoved
(RMShape aShape, MouseEvent anEvent) Event handling from select tool - called on mouse move when tool shape is super selected.void
mouseMoved
(MouseEvent anEvent) Event handling - called on mouse move when this tool is active.void
mousePressed
(RMShape aShape, MouseEvent anEvent) Event handling from select tool for super selected shapes.void
mousePressed
(MouseEvent anEvent) Event handling for shape creation.boolean
mousePressedSelection
(MouseEvent anEvent) Event hook during selection.void
mouseReleased
(RMShape aShape, MouseEvent anEvent) Event handling from select tool for super selected shapes.void
mouseReleased
(MouseEvent anEvent) Event handling for shape creation.void
moveShapeHandle
(RMShape aShape, int handle, RMPoint toPoint) Moves the handle at the given index to the given point.Returns a new instance of the shape class that this tool is responsible for.void
paintSelectedShape
(RMShape aShape, Graphics2D g) Handles painting the indication that a shape is selected.void
paintSuperSelectedShape
(RMShape aShape, Graphics2D g) Handles painting the indication that a shape is super selected.void
Paints when tool is active for things like SelectTool's handles & selection rect or polygon's in-progress path.void
processKeyEvent
(RMShape aShape, KeyEvent anEvent) Editor method.void
Called when a tool is selected even when it's already the current tool.void
resetUI()
Resets the UI associated with this tool.void
Responder callback for the UI associated with this tool.void
willLoseSuperSelectionInEditor
(RMShape aShape, RMEditor anEditor) Editor method - called when an instance of this tool's shape in de-super-selected.Methods inherited from class com.reportmill.base.RMObject
clone, copy, didChange, didUndo, getAnimAttribute, getClassNameShort, initWithArchiver, undoClone, undoCopy, undoEquals
-
Field Details
-
HandleWidth
public static final byte HandleWidth- See Also:
-
HandleMinXMinY
public static final byte HandleMinXMinY- See Also:
-
HandleMaxXMinY
public static final byte HandleMaxXMinY- See Also:
-
HandleMinXMaxY
public static final byte HandleMinXMaxY- See Also:
-
HandleMaxXMaxY
public static final byte HandleMaxXMaxY- See Also:
-
HandleMinXMidY
public static final byte HandleMinXMidY- See Also:
-
HandleMaxXMidY
public static final byte HandleMaxXMidY- See Also:
-
HandleMidXMinY
public static final byte HandleMidXMinY- See Also:
-
HandleMidXMaxY
public static final byte HandleMidXMaxY- See Also:
-
-
Constructor Details
-
Tool
public Tool()Creates a basic tool.
-
-
Method Details
-
getTool
Returns the specific tool for a given shape. -
getTool
Returns the specific tool for a list of shapes (if they have the same tool). -
getSelectTool
Returns the SelectTool. -
getCoreTool
Returns the specific core tool at the given index. -
getCoreToolIndex
Returns the core tool index for the given tool. -
getShapeClass
Returns the shape class that this tool handles. -
newInstance
Returns a new instance of the shape class that this tool is responsible for. -
isInstance
Returns whether given object is editable by this tool. -
getWindowTitle
Returns the string to be used for the inspector window title. -
editor
Returns the current editor. -
getSelectedShape
Returns the current selected shape for the current editor. -
getSelectedShapes
Returns the current selected shapes for the current editor. -
getUI
Returns the Swing UI panel for this tool. -
resetUI
public void resetUI()Resets the UI associated with this tool. -
respondUI
Responder callback for the UI associated with this tool. -
activateTool
public void activateTool()Called when a tool is selected. -
deactivateTool
public void deactivateTool()Called when a tool is deselected (when another tool is selected). -
reactivateTool
public void reactivateTool()Called when a tool is selected even when it's already the current tool. -
flushChanges
Called when a tool is deselected to give an opportunity to finalize changes in progress. -
mouseMoved
Event handling - called on mouse move when this tool is active. -
mousePressed
Event handling for shape creation. -
mouseDragged
Event handling for shape creation. -
mouseReleased
Event handling for shape creation. -
mouseMoved
Event handling from select tool - called on mouse move when tool shape is super selected. MouseMoved is useful for setting a custom cursor. -
mousePressed
Event handling from select tool for super selected shapes. -
mouseDragged
Event handling from select tool for super selected shapes. -
mouseReleased
Event handling from select tool for super selected shapes. -
mousePressedSelection
Event hook during selection. -
processKeyEvent
Editor method. -
paintTool
Paints when tool is active for things like SelectTool's handles & selection rect or polygon's in-progress path. -
paintSelectedShape
Handles painting the indication that a shape is selected. Draws handles by default. -
paintSuperSelectedShape
Handles painting the indication that a shape is super selected. Draws semi-transparent, outset handles by default. -
getHandleCount
Returns the number of handles for this shape. -
getHandlePoint
Returns the point for the handle of the given shape at the given handle index in the given shape's coords. -
getHandleRect
Returns the rect for the handle at the given index in editor coords. -
getHandleAtPoint
Returns the handle hit by the given editor coord point. -
didBecomeSuperSelectedShapeInEditor
Editor method - called when an instance of this tool's shape is super selected. -
willLoseSuperSelectionInEditor
Editor method - called when an instance of this tool's shape in de-super-selected. -
isSelected
Utility method, returns whether a given shape is selected in the editor. -
isSuperSelected
Utility method, returns whether a given shape is superselected in the editor. -
moveShapeHandle
Moves the handle at the given index to the given point. -
getShapeHandleAtPoint
Returns the shape handle for the given editor point. -
getImageIcon
Returns the image icon used to represent shapes that this tool represents. -
getImageIcon
Returns the image icon for the given shape class.
-