Package com.reportmill.panels
Class Tool
- java.lang.Object
- 
- com.reportmill.base.RMObject
- 
- com.reportmill.panels.Tool
 
 
- 
- All Implemented Interfaces:
- RMArchiver.Archiving,- java.lang.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
 
 public class Tool extends RMObject This is the base class for tools in RM - the objects that provide GUI editing for RM shapes.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classTool.RMShapeHandleAn inner class describing a shape and a handle.
 - 
Field SummaryFields Modifier and Type Field Description static byteHandleMaxXMaxYstatic byteHandleMaxXMidYstatic byteHandleMaxXMinYstatic byteHandleMidXMaxYstatic byteHandleMidXMinYstatic byteHandleMinXMaxYstatic byteHandleMinXMidYstatic byteHandleMinXMinYstatic byteHandleWidth
 - 
Constructor SummaryConstructors Constructor Description Tool()Creates a basic tool.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivateTool()Called when a tool is selected.voiddeactivateTool()Called 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.RMEditoreditor()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, java.awt.geom.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.RMPointgetHandlePoint(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.RMRectgetHandleRect(RMShape aShape, int handle, boolean isSuperSelected)Returns the rect for the handle at the given index in editor coords.javax.swing.ImageIcongetImageIcon()Returns the image icon used to represent shapes that this tool represents.static javax.swing.ImageIcongetImageIcon(java.lang.Class aClass)Returns the image icon for the given shape class.RMShapegetSelectedShape()Returns the current selected shape for the current editor.java.util.ListgetSelectedShapes()Returns the current selected shapes for the current editor.static SelectToolgetSelectTool()Returns the SelectTool.java.lang.ClassgetShapeClass()Returns the shape class that this tool handles.Tool.RMShapeHandlegetShapeHandleAtPoint(java.awt.geom.Point2D aPoint)Returns the shape handle for the given editor point.static ToolgetTool(java.lang.Object anObj)Returns the specific tool for a given shape.static ToolgetTool(java.util.List aList)Returns the specific tool for a list of shapes (if they have the same tool).RJPanelgetUI()Returns the Swing UI panel for this tool.java.lang.StringgetWindowTitle()Returns the string to be used for the inspector window title.booleanisInstance(java.lang.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, java.awt.event.MouseEvent anEvent)Event handling from select tool for super selected shapes.voidmouseDragged(java.awt.event.MouseEvent anEvent)Event handling for shape creation.voidmouseMoved(RMShape aShape, java.awt.event.MouseEvent anEvent)Event handling from select tool - called on mouse move when tool shape is super selected.voidmouseMoved(java.awt.event.MouseEvent anEvent)Event handling - called on mouse move when this tool is active.voidmousePressed(RMShape aShape, java.awt.event.MouseEvent anEvent)Event handling from select tool for super selected shapes.voidmousePressed(java.awt.event.MouseEvent anEvent)Event handling for shape creation.booleanmousePressedSelection(java.awt.event.MouseEvent anEvent)Event hook during selection.voidmouseReleased(RMShape aShape, java.awt.event.MouseEvent anEvent)Event handling from select tool for super selected shapes.voidmouseReleased(java.awt.event.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.RMShapenewInstance()Returns a new instance of the shape class that this tool is responsible for.voidpaintSelectedShape(RMShape aShape, java.awt.Graphics2D g)Handles painting the indication that a shape is selected.voidpaintSuperSelectedShape(RMShape aShape, java.awt.Graphics2D g)Handles painting the indication that a shape is super selected.voidpaintTool(java.awt.Graphics2D g)Paints when tool is active for things like SelectTool's handles & selection rect or polygon's in-progress path.voidprocessKeyEvent(RMShape aShape, java.awt.event.KeyEvent anEvent)Editor method.voidreactivateTool()Called when a tool is selected even when it's already the current tool.voidresetUI()Resets the UI associated with this tool.voidrespondUI(java.lang.Object anObj)Responder 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 Detail- 
HandleWidthpublic static final byte HandleWidth - See Also:
- Constant Field Values
 
 - 
HandleMinXMinYpublic static final byte HandleMinXMinY - See Also:
- Constant Field Values
 
 - 
HandleMaxXMinYpublic static final byte HandleMaxXMinY - See Also:
- Constant Field Values
 
 - 
HandleMinXMaxYpublic static final byte HandleMinXMaxY - See Also:
- Constant Field Values
 
 - 
HandleMaxXMaxYpublic static final byte HandleMaxXMaxY - See Also:
- Constant Field Values
 
 - 
HandleMinXMidYpublic static final byte HandleMinXMidY - See Also:
- Constant Field Values
 
 - 
HandleMaxXMidYpublic static final byte HandleMaxXMidY - See Also:
- Constant Field Values
 
 - 
HandleMidXMinYpublic static final byte HandleMidXMinY - See Also:
- Constant Field Values
 
 - 
HandleMidXMaxYpublic static final byte HandleMidXMaxY - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getToolpublic static Tool getTool(java.lang.Object anObj) Returns the specific tool for a given shape.
 - 
getToolpublic static Tool getTool(java.util.List aList) Returns the specific tool for a list of shapes (if they have the same tool).
 - 
getSelectToolpublic static SelectTool getSelectTool() Returns the SelectTool.
 - 
getCoreToolpublic static Tool getCoreTool(int anIndex) Returns the specific core tool at the given index.
 - 
getCoreToolIndexpublic static int getCoreToolIndex(Tool aTool) Returns the core tool index for the given tool.
 - 
getShapeClasspublic java.lang.Class getShapeClass() Returns the shape class that this tool handles.
 - 
newInstancepublic RMShape newInstance() Returns a new instance of the shape class that this tool is responsible for.
 - 
isInstancepublic boolean isInstance(java.lang.Object anObj) Returns whether given object is editable by this tool.
 - 
getWindowTitlepublic java.lang.String getWindowTitle() Returns the string to be used for the inspector window title.
 - 
editorpublic RMEditor editor() Returns the current editor.
 - 
getSelectedShapepublic RMShape getSelectedShape() Returns the current selected shape for the current editor.
 - 
getSelectedShapespublic java.util.List getSelectedShapes() Returns the current selected shapes for the current editor.
 - 
getUIpublic RJPanel getUI() Returns the Swing UI panel for this tool.
 - 
resetUIpublic void resetUI() Resets the UI associated with this tool.
 - 
respondUIpublic void respondUI(java.lang.Object anObj) Responder 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.
 - 
flushChangespublic void flushChanges(RMEditor anEditor, RMShape aShape) Called when a tool is deselected to give an opportunity to finalize changes in progress.
 - 
mouseMovedpublic void mouseMoved(java.awt.event.MouseEvent anEvent) Event handling - called on mouse move when this tool is active.
 - 
mousePressedpublic void mousePressed(java.awt.event.MouseEvent anEvent) Event handling for shape creation.
 - 
mouseDraggedpublic void mouseDragged(java.awt.event.MouseEvent anEvent) Event handling for shape creation.
 - 
mouseReleasedpublic void mouseReleased(java.awt.event.MouseEvent anEvent) Event handling for shape creation.
 - 
mouseMovedpublic void mouseMoved(RMShape aShape, java.awt.event.MouseEvent anEvent) Event handling from select tool - called on mouse move when tool shape is super selected. MouseMoved is useful for setting a custom cursor.
 - 
mousePressedpublic void mousePressed(RMShape aShape, java.awt.event.MouseEvent anEvent) Event handling from select tool for super selected shapes.
 - 
mouseDraggedpublic void mouseDragged(RMShape aShape, java.awt.event.MouseEvent anEvent) Event handling from select tool for super selected shapes.
 - 
mouseReleasedpublic void mouseReleased(RMShape aShape, java.awt.event.MouseEvent anEvent) Event handling from select tool for super selected shapes.
 - 
mousePressedSelectionpublic boolean mousePressedSelection(java.awt.event.MouseEvent anEvent) Event hook during selection.
 - 
processKeyEventpublic void processKeyEvent(RMShape aShape, java.awt.event.KeyEvent anEvent) Editor method.
 - 
paintToolpublic void paintTool(java.awt.Graphics2D g) Paints when tool is active for things like SelectTool's handles & selection rect or polygon's in-progress path.
 - 
paintSelectedShapepublic void paintSelectedShape(RMShape aShape, java.awt.Graphics2D g) Handles painting the indication that a shape is selected. Draws handles by default.
 - 
paintSuperSelectedShapepublic void paintSuperSelectedShape(RMShape aShape, java.awt.Graphics2D g) Handles painting the indication that a shape is super selected. Draws semi-transparent, outset handles by default.
 - 
getHandleCountpublic int getHandleCount(RMShape aShape) Returns the number of handles for this shape.
 - 
getHandlePointpublic RMPoint 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.
 - 
getHandleRectpublic RMRect getHandleRect(RMShape aShape, int handle, boolean isSuperSelected) Returns the rect for the handle at the given index in editor coords.
 - 
getHandleAtPointpublic int getHandleAtPoint(RMShape aShape, java.awt.geom.Point2D aPoint, boolean isSuperSelected) Returns the handle hit by the given editor coord point.
 - 
didBecomeSuperSelectedShapeInEditorpublic void didBecomeSuperSelectedShapeInEditor(RMShape aShape, RMEditor anEditor) Editor method - called when an instance of this tool's shape is super selected.
 - 
willLoseSuperSelectionInEditorpublic void willLoseSuperSelectionInEditor(RMShape aShape, RMEditor anEditor) Editor method - called when an instance of this tool's shape in de-super-selected.
 - 
isSelectedpublic boolean isSelected(RMShape aShape) Utility method, returns whether a given shape is selected in the editor.
 - 
isSuperSelectedpublic boolean isSuperSelected(RMShape aShape) Utility method, returns whether a given shape is superselected in the editor.
 - 
moveShapeHandlepublic void moveShapeHandle(RMShape aShape, int handle, RMPoint toPoint) Moves the handle at the given index to the given point.
 - 
getShapeHandleAtPointpublic Tool.RMShapeHandle getShapeHandleAtPoint(java.awt.geom.Point2D aPoint) Returns the shape handle for the given editor point.
 - 
getImageIconpublic javax.swing.ImageIcon getImageIcon() Returns the image icon used to represent shapes that this tool represents.
 - 
getImageIconpublic static javax.swing.ImageIcon getImageIcon(java.lang.Class aClass) Returns the image icon for the given shape class.
 
- 
 
-