public interface Tool extends RichPlugin, SingletonPlugin
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
Modifier and Type | Method and Description |
---|---|
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 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.
|
context, getContext, setContext
getPriority, setPriority
compareTo
getInfo, setInfo
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()
Copyright © 2009–2015 SciJava. All rights reserved.