Package org.scijava.tool
Class DefaultToolService
-
- All Implemented Interfaces:
Comparable<Prioritized>,Contextual,Disposable,Identifiable,Initializable,Locatable,Logged,HasPluginInfo,PTService<Tool>,RichPlugin,SciJavaPlugin,SingletonService<Tool>,Prioritized,SciJavaService,Service,ToolService,Versioned
public class DefaultToolService extends AbstractSingletonService<Tool> implements ToolService
Default service for keeping track of available tools, including which tool is active, and delegating UI events to the active tool.
-
-
Field Summary
-
Fields inherited from interface org.scijava.tool.ToolService
SEPARATOR_DISTANCE
-
-
Constructor Summary
Constructors Constructor Description DefaultToolService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ToolgetActiveTool()List<Tool>getAlwaysActiveTools()ToolgetTool(String name)List<Tool>getTools()protected voidonEvent(KyPressedEvent event)protected voidonEvent(KyReleasedEvent event)protected voidonEvent(MsClickedEvent event)protected voidonEvent(MsDraggedEvent event)protected voidonEvent(MsMovedEvent event)protected voidonEvent(MsPressedEvent event)protected voidonEvent(MsReleasedEvent event)protected voidonEvent(MsWheelEvent event)voidreportLine(double x1, double y1, double x2, double y2)Publishes line length and angle in the status bar.voidreportPoint(double x, double y)Publishes point coordinates to the status bar.voidreportRectangle(double x, double y, double w, double h)Publishes rectangle dimensions in the status bar.voidsetActiveTool(Tool activeTool)-
Methods inherited from class org.scijava.plugin.AbstractSingletonService
getInstance, getInstances, objectService, onEvent, onEvent
-
Methods inherited from class org.scijava.plugin.AbstractPTService
pluginService
-
Methods inherited from class org.scijava.service.AbstractService
getContext, setContext, toString
-
Methods inherited from class org.scijava.plugin.AbstractRichPlugin
getInfo, getPriority, setInfo, setPriority
-
Methods inherited from class org.scijava.AbstractContextual
context
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.scijava.Contextual
context, getContext, setContext
-
Methods inherited from interface org.scijava.Disposable
dispose
-
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.PTService
getPlugins, getPluginService, pluginService
-
Methods inherited from interface org.scijava.plugin.RichPlugin
getIdentifier, log
-
Methods inherited from interface org.scijava.service.Service
registerEventHandlers
-
Methods inherited from interface org.scijava.plugin.SingletonService
create, filterInstances, getInstance, getInstances, initialize, objectService
-
Methods inherited from interface org.scijava.tool.ToolService
getPluginType, getTool, isSeparatorNeeded, reportLine, reportPoint, reportRectangle
-
Methods inherited from interface org.scijava.Versioned
getVersion
-
-
-
-
Method Detail
-
getTool
public Tool getTool(String name)
- Specified by:
getToolin interfaceToolService
-
getTools
public List<Tool> getTools()
- Specified by:
getToolsin interfaceToolService
-
getAlwaysActiveTools
public List<Tool> getAlwaysActiveTools()
- Specified by:
getAlwaysActiveToolsin interfaceToolService
-
getActiveTool
public Tool getActiveTool()
- Specified by:
getActiveToolin interfaceToolService
-
setActiveTool
public void setActiveTool(Tool activeTool)
- Specified by:
setActiveToolin interfaceToolService
-
reportRectangle
public void reportRectangle(double x, double y, double w, double h)Description copied from interface:ToolServicePublishes rectangle dimensions in the status bar.- Specified by:
reportRectanglein interfaceToolService
-
reportLine
public void reportLine(double x1, double y1, double x2, double y2)Description copied from interface:ToolServicePublishes line length and angle in the status bar.- Specified by:
reportLinein interfaceToolService
-
reportPoint
public void reportPoint(double x, double y)Description copied from interface:ToolServicePublishes point coordinates to the status bar.- Specified by:
reportPointin interfaceToolService
-
onEvent
protected void onEvent(KyPressedEvent event)
-
onEvent
protected void onEvent(KyReleasedEvent event)
-
onEvent
protected void onEvent(MsPressedEvent event)
-
onEvent
protected void onEvent(MsReleasedEvent event)
-
onEvent
protected void onEvent(MsClickedEvent event)
-
onEvent
protected void onEvent(MsMovedEvent event)
-
onEvent
protected void onEvent(MsDraggedEvent event)
-
onEvent
protected void onEvent(MsWheelEvent event)
-
-