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 SummaryNested ClassesModifier and TypeClassDescriptionstatic classAn inner class describing a shape and a handle.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final byte
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidCalled when a tool is selected.voidCalled when a tool is deselected (when another tool is selected).voiddidBecomeSuperSelectedShapeInEditor(RMShape aShape, RMEditor anEditor) Editor method - called when an instance of this tool's shape is super selected.editor()Returns the current editor.voidflushChanges(RMEditor anEditor, RMShape aShape) Called when a tool is deselected to give an opportunity to finalize changes in progress.static ToolgetCoreTool(int anIndex) Returns the specific core tool at the given index.static intgetCoreToolIndex(Tool aTool) Returns the core tool index for the given tool.intgetHandleAtPoint(RMShape aShape, Point2D aPoint, boolean isSuperSelected) Returns the handle hit by the given editor coord point.intgetHandleCount(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 ImageIcongetImageIcon(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 SelectToolReturns the SelectTool.Returns the shape class that this tool handles.getShapeHandleAtPoint(Point2D aPoint) Returns the shape handle for the given editor point.static ToolReturns the specific tool for a given shape.static ToolReturns 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.booleanisInstance(Object anObj) Returns whether given object is editable by this tool.booleanisSelected(RMShape aShape) Utility method, returns whether a given shape is selected in the editor.booleanisSuperSelected(RMShape aShape) Utility method, returns whether a given shape is superselected in the editor.voidmouseDragged(RMShape aShape, MouseEvent anEvent) Event handling from select tool for super selected shapes.voidmouseDragged(MouseEvent anEvent) Event handling for shape creation.voidmouseMoved(RMShape aShape, MouseEvent anEvent) Event handling from select tool - called on mouse move when tool shape is super selected.voidmouseMoved(MouseEvent anEvent) Event handling - called on mouse move when this tool is active.voidmousePressed(RMShape aShape, MouseEvent anEvent) Event handling from select tool for super selected shapes.voidmousePressed(MouseEvent anEvent) Event handling for shape creation.booleanmousePressedSelection(MouseEvent anEvent) Event hook during selection.voidmouseReleased(RMShape aShape, MouseEvent anEvent) Event handling from select tool for super selected shapes.voidmouseReleased(MouseEvent anEvent) Event handling for shape creation.voidmoveShapeHandle(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.voidpaintSelectedShape(RMShape aShape, Graphics2D g) Handles painting the indication that a shape is selected.voidpaintSuperSelectedShape(RMShape aShape, Graphics2D g) Handles painting the indication that a shape is super selected.voidPaints when tool is active for things like SelectTool's handles & selection rect or polygon's in-progress path.voidprocessKeyEvent(RMShape aShape, KeyEvent anEvent) Editor method.voidCalled when a tool is selected even when it's already the current tool.voidresetUI()Resets the UI associated with this tool.voidResponder callback for the UI associated with this tool.voidwillLoseSuperSelectionInEditor(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.RMObjectclone, copy, didChange, didUndo, getAnimAttribute, getClassNameShort, initWithArchiver, undoClone, undoCopy, undoEquals
- 
Field Details- 
HandleWidthpublic static final byte HandleWidth- See Also:
 
- 
HandleMinXMinYpublic static final byte HandleMinXMinY- See Also:
 
- 
HandleMaxXMinYpublic static final byte HandleMaxXMinY- See Also:
 
- 
HandleMinXMaxYpublic static final byte HandleMinXMaxY- See Also:
 
- 
HandleMaxXMaxYpublic static final byte HandleMaxXMaxY- See Also:
 
- 
HandleMinXMidYpublic static final byte HandleMinXMidY- See Also:
 
- 
HandleMaxXMidYpublic static final byte HandleMaxXMidY- See Also:
 
- 
HandleMidXMinYpublic static final byte HandleMidXMinY- See Also:
 
- 
HandleMidXMaxYpublic static final byte HandleMidXMaxY- See Also:
 
 
- 
- 
Constructor Details- 
Toolpublic Tool()Creates a basic tool.
 
- 
- 
Method Details- 
getToolReturns the specific tool for a given shape.
- 
getToolReturns the specific tool for a list of shapes (if they have the same tool).
- 
getSelectToolReturns the SelectTool.
- 
getCoreToolReturns the specific core tool at the given index.
- 
getCoreToolIndexReturns the core tool index for the given tool.
- 
getShapeClassReturns the shape class that this tool handles.
- 
newInstanceReturns a new instance of the shape class that this tool is responsible for.
- 
isInstanceReturns whether given object is editable by this tool.
- 
getWindowTitleReturns the string to be used for the inspector window title.
- 
editorReturns the current editor.
- 
getSelectedShapeReturns the current selected shape for the current editor.
- 
getSelectedShapesReturns the current selected shapes for the current editor.
- 
getUIReturns the Swing UI panel for this tool.
- 
resetUIpublic void resetUI()Resets the UI associated with this tool.
- 
respondUIResponder callback for the UI associated with this tool.
- 
activateToolpublic void activateTool()Called when a tool is selected.
- 
deactivateToolpublic void deactivateTool()Called when a tool is deselected (when another tool is selected).
- 
reactivateToolpublic void reactivateTool()Called when a tool is selected even when it's already the current tool.
- 
flushChangesCalled when a tool is deselected to give an opportunity to finalize changes in progress.
- 
mouseMovedEvent handling - called on mouse move when this tool is active.
- 
mousePressedEvent handling for shape creation.
- 
mouseDraggedEvent handling for shape creation.
- 
mouseReleasedEvent handling for shape creation.
- 
mouseMovedEvent handling from select tool - called on mouse move when tool shape is super selected. MouseMoved is useful for setting a custom cursor.
- 
mousePressedEvent handling from select tool for super selected shapes.
- 
mouseDraggedEvent handling from select tool for super selected shapes.
- 
mouseReleasedEvent handling from select tool for super selected shapes.
- 
mousePressedSelectionEvent hook during selection.
- 
processKeyEventEditor method.
- 
paintToolPaints when tool is active for things like SelectTool's handles & selection rect or polygon's in-progress path.
- 
paintSelectedShapeHandles painting the indication that a shape is selected. Draws handles by default.
- 
paintSuperSelectedShapeHandles painting the indication that a shape is super selected. Draws semi-transparent, outset handles by default.
- 
getHandleCountReturns the number of handles for this shape.
- 
getHandlePointReturns the point for the handle of the given shape at the given handle index in the given shape's coords.
- 
getHandleRectReturns the rect for the handle at the given index in editor coords.
- 
getHandleAtPointReturns the handle hit by the given editor coord point.
- 
didBecomeSuperSelectedShapeInEditorEditor method - called when an instance of this tool's shape is super selected.
- 
willLoseSuperSelectionInEditorEditor method - called when an instance of this tool's shape in de-super-selected.
- 
isSelectedUtility method, returns whether a given shape is selected in the editor.
- 
isSuperSelectedUtility method, returns whether a given shape is superselected in the editor.
- 
moveShapeHandleMoves the handle at the given index to the given point.
- 
getShapeHandleAtPointReturns the shape handle for the given editor point.
- 
getImageIconReturns the image icon used to represent shapes that this tool represents.
- 
getImageIconReturns the image icon for the given shape class.
 
-