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 classAn inner class describing a shape and a handle. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final byte -
Constructor Summary
Constructors -
Method Summary
Modifier 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.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.
-