|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectartofillusion.ui.EditingTool
public abstract class EditingTool
EditingTool is the superclass of tools for editing objects or scenes. An EditingTool has an image which appears in a tool palette, allowing the tool to be selected. When selected, the editing tool responds to events in the scene or object viewer.
An EditingTool specifies what types of mouse clicks it wants to receive by the value it returns from its whichClicks() method. This should be a sum of the contants OBJECT_CLICKS (for mouse clicks on objects), HANDLE_CLICKS (for mouse clicks on handles), and ALL_CLICKS (for all mouse clicks regardless of what they are on). The exact definition of an "object" or "handle" is not specified. It is up to the ViewerCanvas generating the events to decide what constitutes an object or handle.
An EditingTool may also specify whether the current selection may be changed while that tool is active by the value it returns from its allowSelectionChanges() method. This method is always called after mousePressed(), allowing the tool to first determine what was clicked on before deciding whether to allow the selection to change in response to the click.
More precisely, here is the sequence of actions a ViewerCanvas performs when the mouse is pressed:
Field Summary | |
---|---|
static int |
ALL_CLICKS
|
static int |
HANDLE_CLICKS
|
static int |
OBJECT_CLICKS
|
Constructor Summary | |
---|---|
EditingTool(EditingWindow win)
|
Method Summary | |
---|---|
void |
activate()
|
boolean |
allowSelectionChanges()
Get whether the selection may be changed while this tool is active. |
void |
deactivate()
|
void |
drawOverlay(ViewerCanvas view)
Draw any graphics that this tool overlays on top of the view. |
ToolButton |
getButton()
Get the ToolButton used to represent this tool in a ToolPalette. |
java.lang.String |
getToolTipText()
Get the tool tip text to display for this tool (or null if it does not have a tool tip). |
EditingWindow |
getWindow()
Get the EditingWindow to which this tool belongs. |
boolean |
hilightSelection()
Get whether the current selection should be hilighted when this tool is active. |
void |
iconDoubleClicked()
|
boolean |
isEditable()
Get whether this tool opens a configuration dialog when double-clicked. |
void |
keyPressed(KeyPressedEvent e,
ViewerCanvas view)
|
void |
mouseDragged(WidgetMouseEvent e,
ViewerCanvas view)
|
void |
mouseMoved(WidgetMouseEvent e,
ViewerCanvas view)
|
void |
mousePressed(WidgetMouseEvent e,
ViewerCanvas view)
|
void |
mousePressedOnHandle(WidgetMouseEvent e,
ViewerCanvas view,
int obj,
int handle)
|
void |
mousePressedOnObject(WidgetMouseEvent e,
ViewerCanvas view,
int obj)
|
void |
mouseReleased(WidgetMouseEvent e,
ViewerCanvas view)
|
int |
whichClicks()
Get what types of mouse clicks this tool wants to receive. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ALL_CLICKS
public static final int OBJECT_CLICKS
public static final int HANDLE_CLICKS
Constructor Detail |
---|
public EditingTool(EditingWindow win)
Method Detail |
---|
public EditingWindow getWindow()
public ToolButton getButton()
public java.lang.String getToolTipText()
public int whichClicks()
public boolean allowSelectionChanges()
public boolean hilightSelection()
public void drawOverlay(ViewerCanvas view)
public void mousePressed(WidgetMouseEvent e, ViewerCanvas view)
public void mousePressedOnObject(WidgetMouseEvent e, ViewerCanvas view, int obj)
public void mousePressedOnHandle(WidgetMouseEvent e, ViewerCanvas view, int obj, int handle)
public void mouseReleased(WidgetMouseEvent e, ViewerCanvas view)
public void mouseDragged(WidgetMouseEvent e, ViewerCanvas view)
public void mouseMoved(WidgetMouseEvent e, ViewerCanvas view)
public void keyPressed(KeyPressedEvent e, ViewerCanvas view)
public void activate()
public void deactivate()
public boolean isEditable()
public void iconDoubleClicked()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |