Package org.scijava.tool
Interface Tool
-
- All Superinterfaces:
Comparable<Prioritized>,Contextual,HasPluginInfo,Identifiable,Locatable,Logged,Prioritized,RichPlugin,SciJavaPlugin,SingletonPlugin,Versioned
- All Known Implementing Classes:
AbstractTool,DummyTool
public interface Tool extends RichPlugin, SingletonPlugin
Interface for 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
PanToolmight pan a display when the mouse is dragged or arrow key is pressed, while aPencilToolcould draw hard lines on the data within a display.Tools discoverable at runtime must implement this interface and be annotated with @
PluginwithPlugin.type()=Tool.class. While it possible to create a tool merely by implementing this interface, it is encouraged to instead extendAbstractTool, for convenience.- Author:
- Rick Lentz, Grant Harris, Curtis Rueden
- See Also:
Plugin,ToolService
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default voidactivate()Informs the tool that it is now active.default voidconfigure()Occurs when the user right clicks this tool's icon.default voiddeactivate()Informs the tool that it is no longer active.default MouseCursorgetCursor()The tool's mouse pointer.default StringgetDescription()Returns the text the tool provides when mouse hovers over tooldefault booleanisActiveInAppFrame()When true, tool receives events when the main application frame is active.default booleanisAlwaysActive()When true, tool has no button but rather is active all the time.default voidonKeyDown(KyPressedEvent evt)Occurs when a key on the keyboard is pressed while the tool is active.default voidonKeyUp(KyReleasedEvent evt)Occurs when a key on the keyboard is released while the tool is active.default voidonMouseClick(MsClickedEvent evt)Occurs when a mouse button is double clicked while the tool is active.default voidonMouseDown(MsPressedEvent evt)Occurs when a mouse button is pressed while the tool is active.default voidonMouseDrag(MsDraggedEvent evt)Occurs when the mouse is dragged while the tool is active.default voidonMouseMove(MsMovedEvent evt)Occurs when the mouse is moved while the tool is active.default voidonMouseUp(MsReleasedEvent evt)Occurs when a mouse button is released while the tool is active.default voidonMouseWheel(MsWheelEvent evt)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.plugin.HasPluginInfo
getInfo, setInfo
-
Methods inherited from interface org.scijava.Locatable
getLocation
-
Methods inherited from interface org.scijava.Prioritized
compareTo, getPriority, setPriority
-
Methods inherited from interface org.scijava.plugin.RichPlugin
getIdentifier, log
-
Methods inherited from interface org.scijava.Versioned
getVersion
-
-
-
-
Method Detail
-
isAlwaysActive
default boolean isAlwaysActive()
When true, tool has no button but rather is active all the time.
-
isActiveInAppFrame
default boolean isActiveInAppFrame()
When true, tool receives events when the main application frame is active. When false, tool only receives events when a display window is active.
-
getCursor
default MouseCursor getCursor()
The tool's mouse pointer.
-
activate
default void activate()
Informs the tool that it is now active.
-
deactivate
default void deactivate()
Informs the tool that it is no longer active.
-
onKeyDown
default void onKeyDown(KyPressedEvent evt)
Occurs when a key on the keyboard is pressed while the tool is active.
-
onKeyUp
default void onKeyUp(KyReleasedEvent evt)
Occurs when a key on the keyboard is released while the tool is active.
-
onMouseDown
default void onMouseDown(MsPressedEvent evt)
Occurs when a mouse button is pressed while the tool is active.
-
onMouseUp
default void onMouseUp(MsReleasedEvent evt)
Occurs when a mouse button is released while the tool is active.
-
onMouseClick
default void onMouseClick(MsClickedEvent evt)
Occurs when a mouse button is double clicked while the tool is active.
-
onMouseMove
default void onMouseMove(MsMovedEvent evt)
Occurs when the mouse is moved while the tool is active.
-
onMouseDrag
default void onMouseDrag(MsDraggedEvent evt)
Occurs when the mouse is dragged while the tool is active.
-
onMouseWheel
default void onMouseWheel(MsWheelEvent evt)
Occurs when the mouse wheel is moved while the tool is active.
-
configure
default void configure()
Occurs when the user right clicks this tool's icon.
-
getDescription
default String getDescription()
Returns the text the tool provides when mouse hovers over tool
-
-