Interface IDesignTool
- All Known Implementing Classes:
AbstractBlockWorkspace.ConnectionTool
,AbstractDesignTool
,AbstractLayoutTool
,AbstractRectangularShapeTool
,AbstractShapeTool
,ArrowTool
,EllipseTool
,EyedropperTool
,GradientTool
,InstantiationTool
,LineTool
,NullTool
,PasteTool
,PathEditorTool
,PencilTool
,PolygonTool
,RectangleTool
,SelectionTool
public interface IDesignTool
Represents a "design tool", which is a mode that the design panel can be in. Tools affect the type of selection
editor that gets installed on selected components, and how the mouse behaves over the design panel.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPropertyChangeListener
(String propertyName, PropertyChangeListener listener) Adds a property change listener to this design tool.Provides a way for external objects to get a hold of Actions that the tool defines.The cursor to use given the current event mask, which can be used to detect what keys are being held downCalled while dragging as an easy way for a tool to install a highlight while dragging.getStatusBarText
(List<JComponent> selection, Point point, int inputMask) Calculates the currently applicable status bar text for this toolvoid
install
(DesignPanel panel) Installs the tool for the given panel.Gives the tool a chance to create a new selection control object to install handles on the selection.void
Called when the user clicks in the design space.void
onDoubleClick
(Point p, int modifiers) Called when the user double-clicksvoid
Called while the user is dragging.void
Called when the user stops dragging.void
onDragStart
(Point startPoint, Point lastPoint, Rectangle r, int modifiers) Called when the user start's dragging while this tool is active.void
onKeyEvent
(KeyEvent event, boolean press) void
void
onPopupTrigger
(Point p, int modifiers) Called when the user issues a click that matches the current system's notion of a popup-menu triggervoid
Called when the user presses the mouse in the design space.void
Called when the user presses the mouse in the design space.void
removePropertyChangeListener
(String propertyName, PropertyChangeListener listener) void
Uninstalls the tool.
-
Method Details
-
getCursor
The cursor to use given the current event mask, which can be used to detect what keys are being held down -
getStatusBarText
Calculates the currently applicable status bar text for this tool -
onClick
Called when the user clicks in the design space.- Parameters:
p
- The point at which they clicked. Relative to the designable container.modifiers
- A bitmask of modifiers. Comes fromInputEvent.getModifiersEx()
-
onDoubleClick
Called when the user double-clicks -
onPress
Called when the user presses the mouse in the design space.- Parameters:
p
- The point at which they pressed. Relative to the designable container.modifiers
- A bitmask of modifiers. Comes fromInputEvent.getModifiersEx()
-
onRelease
Called when the user presses the mouse in the design space.- Parameters:
p
- The point at which they pressed. Relative to the designable container.modifiers
- A bitmask of modifiers. Comes fromInputEvent.getModifiersEx()
-
onPopupTrigger
Called when the user issues a click that matches the current system's notion of a popup-menu trigger -
onMove
-
onDragStart
Called when the user start's dragging while this tool is active. All coordinates are relative to the interaction panel and are in zoomed space. -
onDrag
Called while the user is dragging. All coordinates are relative to the interaction panel and are in zoomed space. -
onDragEnd
Called when the user stops dragging. All coordinates are relative to the interaction panel and are in zoomed space. -
onKeyEvent
-
getAction
Provides a way for external objects to get a hold of Actions that the tool defines. For example, theSelectionTool
defines a number of alignment and z-order actions. -
getDragHighlight
IHighlight getDragHighlight()Called while dragging as an easy way for a tool to install a highlight while dragging. -
newSelectionControl
ISelectionControl newSelectionControl()Gives the tool a chance to create a new selection control object to install handles on the selection. Called on the active tool when the selection changes or after a tool is first installed. -
addPropertyChangeListener
Adds a property change listener to this design tool. The workspace will listen for these properties:- "handles": When this property changes,
newSelectionControl()
will be called again and the handles will be updated.
- "handles": When this property changes,
-
removePropertyChangeListener
-
getToolbarInitializer
IDesignTool.ToolbarInitializer getToolbarInitializer() -
install
Installs the tool for the given panel. Tools are built to be re-used by repeatedly being installed and then uninstalled as tools get switched out. -
uninstall
void uninstall()Uninstalls the tool.
-