|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Tool
Interface for ImageJ tools. A tool is a collection of rules binding user input (e.g., keyboard and mouse events) to display and data manipulation in a coherent way.
For example, a PanTool
might pan a display when the mouse is dragged
or arrow key is pressed, while a PencilTool
could draw hard lines on
the data within a display.
Tools discoverable at runtime must implement this interface and be annotated
with @Plugin
with Plugin.type()
= Tool
.class. While
it possible to create a tool merely by implementing this interface, it is
encouraged to instead extend AbstractTool
, for convenience.
Plugin
,
ToolService
Method Summary | |
---|---|
void |
activate()
Informs the tool that it is now active. |
void |
configure()
Occurs when the user right clicks this tool's icon. |
void |
deactivate()
Informs the tool that it is no longer active. |
MouseCursor |
getCursor()
The tool's mouse pointer. |
String |
getDescription()
Returns the text the tool provides when mouse hovers over tool |
boolean |
isActiveInAppFrame()
When true, tool receives events when the main ImageJ application frame is active. |
boolean |
isAlwaysActive()
When true, tool has no button but rather is active all the time. |
void |
onKeyDown(KyPressedEvent event)
Occurs when a key on the keyboard is pressed while the tool is active. |
void |
onKeyUp(KyReleasedEvent event)
Occurs when a key on the keyboard is released while the tool is active. |
void |
onMouseClick(MsClickedEvent event)
Occurs when a mouse button is double clicked while the tool is active. |
void |
onMouseDown(MsPressedEvent event)
Occurs when a mouse button is pressed while the tool is active. |
void |
onMouseDrag(MsDraggedEvent event)
Occurs when the mouse is dragged while the tool is active. |
void |
onMouseMove(MsMovedEvent event)
Occurs when the mouse is moved while the tool is active. |
void |
onMouseUp(MsReleasedEvent event)
Occurs when a mouse button is released while the tool is active. |
void |
onMouseWheel(MsWheelEvent event)
Occurs when the mouse wheel is moved while the tool is active. |
Methods inherited from interface org.scijava.Contextual |
---|
context, getContext, setContext |
Methods inherited from interface org.scijava.Prioritized |
---|
getPriority, setPriority |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Methods inherited from interface org.scijava.plugin.HasPluginInfo |
---|
getInfo, setInfo |
Method Detail |
---|
boolean isAlwaysActive()
boolean isActiveInAppFrame()
MouseCursor getCursor()
void activate()
void deactivate()
void onKeyDown(KyPressedEvent event)
void onKeyUp(KyReleasedEvent event)
void onMouseDown(MsPressedEvent event)
void onMouseUp(MsReleasedEvent event)
void onMouseClick(MsClickedEvent event)
void onMouseMove(MsMovedEvent event)
void onMouseDrag(MsDraggedEvent event)
void onMouseWheel(MsWheelEvent event)
void configure()
String getDescription()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |