public abstract class AbstractTool extends Object implements ij.ImageListener, WindowFocusListener, ij.plugin.PlugIn
Modifier and Type | Class and Description |
---|---|
protected class |
AbstractTool.KeyProxy |
protected class |
AbstractTool.KeyProxyIfNotConsumed |
protected class |
AbstractTool.MouseMotionProxy |
protected class |
AbstractTool.MouseMotionProxyIfNotConsumed |
protected class |
AbstractTool.MouseProxy |
protected class |
AbstractTool.MouseWheelProxy |
protected class |
AbstractTool.MouseWheelProxyIfNotConsumed |
protected class |
AbstractTool.ToolbarMouseAdapter
This class is used to monitor tool toggles and double-clicks on the toolbar icon of this concrete tool.
|
Modifier and Type | Field and Description |
---|---|
protected boolean |
clearToolsIfNecessary |
protected AbstractTool.KeyProxyIfNotConsumed |
ijKeyProxy |
protected AbstractTool.KeyProxy |
keyProxy |
protected AbstractTool.MouseMotionProxy |
mouseMotionProxy |
protected AbstractTool.MouseProxy |
mouseProxy |
protected AbstractTool.MouseWheelProxy |
mouseWheelProxy |
protected String |
savedToolName |
protected SliceListener |
sliceListener |
protected List<SliceObserver> |
sliceObservers |
protected boolean |
toolActive |
protected Toolbar |
toolbar |
protected AbstractTool.ToolbarMouseAdapter |
toolbarMouseListener |
protected int |
toolID |
protected ToolToggleListener |
toolToggleListener |
Constructor and Description |
---|
AbstractTool() |
Modifier and Type | Method and Description |
---|---|
protected void |
addKeyListener(Component component) |
protected void |
addMouseMotionListener(ImageCanvas canvas) |
protected void |
addMouseWheelListener(ImageWindow window) |
ImageCanvas |
getImageCanvas(ComponentEvent e) |
ij.ImagePlus |
getImagePlus(ComponentEvent e) |
ImageWindow |
getImageWindow(ComponentEvent e) |
int |
getOffscreenX(MouseEvent e) |
double |
getOffscreenXDouble(MouseEvent e) |
int |
getOffscreenY(MouseEvent e) |
double |
getOffscreenYDouble(MouseEvent e) |
String |
getToolIcon()
Return the string encoding of the tool icon as it will appear in the
toolbar.
|
int |
getToolID() |
String |
getToolName()
Return the tool name.
|
void |
imageClosed(ij.ImagePlus image) |
void |
imageOpened(ij.ImagePlus image) |
void |
imageUpdated(ij.ImagePlus image) |
boolean |
isThisTool() |
protected boolean |
maybeUnregister() |
protected void |
registerTool() |
protected void |
registerTool(ImageCanvas canvas) |
protected void |
registerTool(ij.ImagePlus image) |
void |
run(String arg) |
protected void |
unregisterTool() |
protected void |
unregisterTool(ImageCanvas canvas) |
protected void |
unregisterTool(ij.ImagePlus image) |
protected boolean |
wasToolbarCleared() |
void |
windowGainedFocus(WindowEvent e) |
void |
windowLostFocus(WindowEvent e) |
protected Toolbar toolbar
protected int toolID
protected AbstractTool.MouseProxy mouseProxy
protected AbstractTool.MouseWheelProxy mouseWheelProxy
protected AbstractTool.MouseMotionProxy mouseMotionProxy
protected AbstractTool.KeyProxy keyProxy
protected AbstractTool.KeyProxyIfNotConsumed ijKeyProxy
protected SliceListener sliceListener
protected List<SliceObserver> sliceObservers
protected AbstractTool.ToolbarMouseAdapter toolbarMouseListener
protected ToolToggleListener toolToggleListener
protected String savedToolName
protected boolean clearToolsIfNecessary
protected boolean toolActive
public void run(String arg)
run
in interface ij.plugin.PlugIn
public void imageOpened(ij.ImagePlus image)
imageOpened
in interface ij.ImageListener
public void imageClosed(ij.ImagePlus image)
imageClosed
in interface ij.ImageListener
public void imageUpdated(ij.ImagePlus image)
imageUpdated
in interface ij.ImageListener
public void windowGainedFocus(WindowEvent e)
windowGainedFocus
in interface WindowFocusListener
public void windowLostFocus(WindowEvent e)
windowLostFocus
in interface WindowFocusListener
public final int getToolID()
public final boolean isThisTool()
protected void registerTool()
protected void registerTool(ij.ImagePlus image)
protected void registerTool(ImageCanvas canvas)
protected void addKeyListener(Component component)
protected void addMouseMotionListener(ImageCanvas canvas)
protected void addMouseWheelListener(ImageWindow window)
protected boolean maybeUnregister()
protected boolean wasToolbarCleared()
protected void unregisterTool()
protected void unregisterTool(ij.ImagePlus image)
protected void unregisterTool(ImageCanvas canvas)
public ij.ImagePlus getImagePlus(ComponentEvent e)
public ImageCanvas getImageCanvas(ComponentEvent e)
public ImageWindow getImageWindow(ComponentEvent e)
public int getOffscreenX(MouseEvent e)
public int getOffscreenY(MouseEvent e)
public double getOffscreenXDouble(MouseEvent e)
public double getOffscreenYDouble(MouseEvent e)
public String getToolName()
Copyright © 2015–2021 Fiji. All rights reserved.