public class DefaultToolService extends AbstractSingletonService<Tool> implements ToolService
Constructor and Description |
---|
DefaultToolService() |
Modifier and Type | Method and Description |
---|---|
Tool |
getActiveTool() |
List<Tool> |
getAlwaysActiveTools() |
Class<Tool> |
getPluginType()
Gets the type of plugins managed by this service.
|
<T extends Tool> |
getTool(Class<T> toolClass)
Get a tool given its class.
|
Tool |
getTool(String name) |
List<Tool> |
getTools() |
boolean |
isSeparatorNeeded(Tool tool1,
Tool tool2)
Returns true if the two specified tools should have a separator between
them on the tool bar.
|
protected void |
onEvent(KyPressedEvent event) |
protected void |
onEvent(KyReleasedEvent event) |
protected void |
onEvent(MsClickedEvent event) |
protected void |
onEvent(MsDraggedEvent event) |
protected void |
onEvent(MsMovedEvent event) |
protected void |
onEvent(MsPressedEvent event) |
protected void |
onEvent(MsReleasedEvent event) |
protected void |
onEvent(MsWheelEvent event) |
void |
reportLine(double x1,
double y1,
double x2,
double y2)
Publishes line length and angle in the status bar.
|
void |
reportLine(RealCoords p1,
RealCoords p2)
Publishes line length and angle in the status bar.
|
void |
reportPoint(double x,
double y)
Publishes point coordinates to the status bar.
|
void |
reportPoint(RealCoords p)
Publishes point coordinates to the status bar.
|
void |
reportRectangle(double x,
double y,
double w,
double h)
Publishes rectangle dimensions in the status bar.
|
void |
reportRectangle(RealCoords p1,
RealCoords p2)
Publishes rectangle dimensions in the status bar.
|
void |
setActiveTool(Tool activeTool) |
create, filterInstances, getInstance, getInstances, initialize
getPlugins, getPluginService
dispose, getContext, registerEventHandlers, setContext, toString
compareTo, getInfo, getPriority, setInfo, setPriority
context
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getInstance, getInstances
create, getPlugins, getPluginService
initialize, registerEventHandlers
context, getContext, setContext
getPriority, setPriority
compareTo
getInfo, setInfo
dispose
public Tool getTool(String name)
getTool
in interface ToolService
public <T extends Tool> T getTool(Class<T> toolClass)
ToolService
getTool
in interface ToolService
T
- the tool's typetoolClass
- the class of the tool to fetchpublic List<Tool> getTools()
getTools
in interface ToolService
public List<Tool> getAlwaysActiveTools()
getAlwaysActiveTools
in interface ToolService
public Tool getActiveTool()
getActiveTool
in interface ToolService
public void setActiveTool(Tool activeTool)
setActiveTool
in interface ToolService
public boolean isSeparatorNeeded(Tool tool1, Tool tool2)
ToolService
isSeparatorNeeded
in interface ToolService
public void reportRectangle(double x, double y, double w, double h)
ToolService
reportRectangle
in interface ToolService
public void reportRectangle(RealCoords p1, RealCoords p2)
ToolService
reportRectangle
in interface ToolService
public void reportLine(double x1, double y1, double x2, double y2)
ToolService
reportLine
in interface ToolService
public void reportLine(RealCoords p1, RealCoords p2)
ToolService
reportLine
in interface ToolService
public void reportPoint(double x, double y)
ToolService
reportPoint
in interface ToolService
public void reportPoint(RealCoords p)
ToolService
reportPoint
in interface ToolService
public Class<Tool> getPluginType()
PTService
getPluginType
in interface PTService<Tool>
protected void onEvent(KyPressedEvent event)
protected void onEvent(KyReleasedEvent event)
protected void onEvent(MsPressedEvent event)
protected void onEvent(MsReleasedEvent event)
protected void onEvent(MsClickedEvent event)
protected void onEvent(MsMovedEvent event)
protected void onEvent(MsDraggedEvent event)
protected void onEvent(MsWheelEvent event)
Copyright © 2009–2015 SciJava. All rights reserved.