Package com.reportmill.panels
Class SelectTool
- java.lang.Object
-
- com.reportmill.base.RMObject
-
- com.reportmill.panels.Tool
-
- com.reportmill.panels.SelectTool
-
- All Implemented Interfaces:
RMArchiver.Archiving
,java.lang.Cloneable
public class SelectTool extends Tool
This class handles mouse selection and manipulation of shapes, including: - Click on a shape selects a shape - Double click on a shape super-selects a shape - Drag a rect selects shapes - Shift click or shift drag XORs selection - Click and drag handle resizes shape
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.reportmill.panels.Tool
Tool.RMShapeHandle
-
-
Field Summary
Fields Modifier and Type Field Description static byte
DragModeEventDispatch
static byte
DragModeMove
static byte
DragModeNone
static byte
DragModeResize
static byte
DragModeSelect
-
Fields inherited from class com.reportmill.panels.Tool
HandleMaxXMaxY, HandleMaxXMidY, HandleMaxXMinY, HandleMidXMaxY, HandleMidXMinY, HandleMinXMaxY, HandleMinXMidY, HandleMinXMinY, HandleWidth
-
-
Constructor Summary
Constructors Constructor Description SelectTool()
Creates a new select tool.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getDragMode()
Returns the last drag mode handled by the select tool.boolean
getRedoMousePressed()
Returns whether select tool should redo current mouse down.RJPanel
getUI()
Returns the Swing UI for the current selected shape(s).void
mouseDragged(java.awt.event.MouseEvent anEvent)
Handles mouse dragged for the select tool.void
mouseMoved(java.awt.event.MouseEvent anEvent)
Handles mouse moved - forward on to super selected shape tool.void
mousePressed(java.awt.event.MouseEvent anEvent)
Handles mouse pressed for the select tool.void
mouseReleased(java.awt.event.MouseEvent anEvent)
Handles mouse released for the select tool.void
paintTool(java.awt.Graphics2D g)
Paints tool specific things, like handles.void
reactivateTool()
Tool callback selects parent of selected shapes (or just shape, if it's super-selected).void
resetUI()
Called to reset the Swing GUI for the currently selected shape.void
setRedoMousePressed(boolean aFlag)
Sets whether select tool should redo current mouse dwon.-
Methods inherited from class com.reportmill.panels.Tool
activateTool, deactivateTool, didBecomeSuperSelectedShapeInEditor, editor, flushChanges, getCoreTool, getCoreToolIndex, getHandleAtPoint, getHandleCount, getHandlePoint, getHandleRect, getImageIcon, getImageIcon, getSelectedShape, getSelectedShapes, getSelectTool, getShapeClass, getShapeHandleAtPoint, getTool, getTool, getWindowTitle, isInstance, isSelected, isSuperSelected, mouseDragged, mouseMoved, mousePressed, mousePressedSelection, mouseReleased, moveShapeHandle, newInstance, paintSelectedShape, paintSuperSelectedShape, processKeyEvent, respondUI, willLoseSuperSelectionInEditor
-
Methods inherited from class com.reportmill.base.RMObject
clone, copy, didChange, didUndo, getAnimAttribute, getClassNameShort, initWithArchiver, undoClone, undoCopy, undoEquals
-
-
-
-
Field Detail
-
DragModeNone
public static final byte DragModeNone
- See Also:
- Constant Field Values
-
DragModeMove
public static final byte DragModeMove
- See Also:
- Constant Field Values
-
DragModeResize
public static final byte DragModeResize
- See Also:
- Constant Field Values
-
DragModeSelect
public static final byte DragModeSelect
- See Also:
- Constant Field Values
-
DragModeEventDispatch
public static final byte DragModeEventDispatch
- See Also:
- Constant Field Values
-
-
Method Detail
-
mouseMoved
public void mouseMoved(java.awt.event.MouseEvent anEvent)
Handles mouse moved - forward on to super selected shape tool.- Overrides:
mouseMoved
in classTool
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent anEvent)
Handles mouse pressed for the select tool.- Overrides:
mousePressed
in classTool
-
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent anEvent)
Handles mouse dragged for the select tool.- Overrides:
mouseDragged
in classTool
-
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent anEvent)
Handles mouse released for the select tool.- Overrides:
mouseReleased
in classTool
-
getUI
public RJPanel getUI()
Returns the Swing UI for the current selected shape(s).
-
resetUI
public void resetUI()
Called to reset the Swing GUI for the currently selected shape.
-
getDragMode
public int getDragMode()
Returns the last drag mode handled by the select tool.
-
getRedoMousePressed
public boolean getRedoMousePressed()
Returns whether select tool should redo current mouse down.
-
setRedoMousePressed
public void setRedoMousePressed(boolean aFlag)
Sets whether select tool should redo current mouse dwon.
-
paintTool
public void paintTool(java.awt.Graphics2D g)
Paints tool specific things, like handles.
-
reactivateTool
public void reactivateTool()
Tool callback selects parent of selected shapes (or just shape, if it's super-selected).- Overrides:
reactivateTool
in classTool
-
-