public class Toolbar
extends java.awt.Canvas
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.ItemListener, java.awt.event.ActionListener
| Modifier and Type | Field and Description |
|---|---|
static int |
ANGLE |
static int |
BRUSH_ROI |
static java.lang.String |
CORNER_DIAMETER |
static int |
CROSSHAIR |
static int |
CUSTOM1 |
static int |
CUSTOM2 |
static int |
CUSTOM3 |
static int |
CUSTOM4 |
static int |
CUSTOM5 |
static int |
CUSTOM6 |
static int |
CUSTOM7 |
static int |
DOUBLE_CLICK_THRESHOLD |
static int |
DROPPER |
static int |
ELLIPSE_ROI |
static int |
FREELINE |
static int |
FREEROI |
static int |
HAND |
static int |
LINE |
static int |
MAGNIFIER |
static int |
OVAL |
static int |
OVAL_ROI |
static int |
POINT |
static int |
POLYGON |
static int |
POLYLINE |
static int |
RECTANGLE |
static int |
SPARE1
Obsolete public constants
|
static int |
SPARE2
Obsolete public constants
|
static int |
SPARE3
Obsolete public constants
|
static int |
SPARE4
Obsolete public constants
|
static int |
SPARE5
Obsolete public constants
|
static int |
SPARE6
Obsolete public constants
|
static int |
SPARE7
Obsolete public constants
|
static int |
SPARE8
Obsolete public constants
|
static int |
SPARE9
Obsolete public constants
|
static int |
TEXT |
static java.lang.String |
TOOL_KEY |
static int |
UNUSED |
static int |
WAND |
| Constructor and Description |
|---|
Toolbar() |
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent e) |
void |
addMacroTool(java.lang.String name,
MacroInstaller macroInstaller)
Used by the MacroInstaller class to add a macro tool to the toolbar.
|
void |
addMacroTool(java.lang.String name,
MacroInstaller macroInstaller,
int id)
Used by the MacroInstaller class to install a set of macro tools.
|
static void |
addPlugInTool(PlugInTool tool)
Adds a plugin tool to the first available toolbar slot,
or to the last slot if the toolbar is full.
|
int |
addTool(java.lang.String toolTip)
Adds a tool to the toolbar.
|
static java.awt.Color |
getBackgroundColor() |
static int |
getBrushSize()
Returns the size of the selection brush tool, or 0 if the brush tool is not enabled.
|
static int |
getButtonSize() |
java.awt.Color |
getColor()
Deprecated.
replaced by getForegroundColor()
|
static java.awt.Color |
getForegroundColor() |
static Toolbar |
getInstance()
Returns a reference to the ImageJ toolbar.
|
java.awt.Dimension |
getMinimumSize() |
static boolean |
getMultiPointMode()
Returns 'true' if the multi-point tool is enabled.
|
int |
getNumTools() |
static int |
getOvalToolType()
Returns the oval tool type (OVAL_ROI, ELLIPSE_ROI or BRUSH_ROI).
|
static PlugInTool |
getPlugInTool() |
java.awt.Dimension |
getPreferredSize() |
static int |
getRoundRectArcSize()
Returns the rounded rectangle arc size, or 0 if the rounded rectangle tool is not enabled.
|
static int |
getToolId()
Returns the ID of the current tool (Toolbar.RECTANGLE, Toolbar.OVAL, etc.).
|
int |
getToolId(java.lang.String name)
Returns the ID of the tool whose name (the description displayed in the status bar)
starts with the specified string, or -1 if the tool is not found.
|
static java.lang.String |
getToolName()
Returns the name of the current tool.
|
static boolean |
installStartupMacrosTools() |
void |
installStartupTools() |
void |
itemStateChanged(java.awt.event.ItemEvent e) |
void |
mouseClicked(java.awt.event.MouseEvent e) |
void |
mouseDragged(java.awt.event.MouseEvent e) |
void |
mouseEntered(java.awt.event.MouseEvent e) |
void |
mouseExited(java.awt.event.MouseEvent e) |
void |
mouseMoved(java.awt.event.MouseEvent e) |
void |
mousePressed(java.awt.event.MouseEvent e) |
void |
mouseReleased(java.awt.event.MouseEvent e) |
void |
paint(java.awt.Graphics g) |
static void |
removeMacroTools() |
void |
restorePreviousTool() |
static void |
restoreTools() |
static void |
setBackgroundColor(java.awt.Color c) |
static void |
setBrushSize(int size)
Set the size of the selection brush tool, in pixels.
|
void |
setColor(java.awt.Color c)
Deprecated.
replaced by setForegroundColor()
|
static void |
setForegroundColor(java.awt.Color c) |
static void |
setRoundRectArcSize(int size)
Sets the rounded rectangle corner diameter (pixels).
|
void |
setTool(int tool) |
boolean |
setTool(java.lang.String name) |
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, updateaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validatepublic static final int RECTANGLE
public static final int OVAL
public static final int POLYGON
public static final int FREEROI
public static final int LINE
public static final int POLYLINE
public static final int FREELINE
public static final int POINT
public static final int CROSSHAIR
public static final int WAND
public static final int TEXT
public static final int UNUSED
public static final int MAGNIFIER
public static final int HAND
public static final int DROPPER
public static final int ANGLE
public static final int CUSTOM1
public static final int CUSTOM2
public static final int CUSTOM3
public static final int CUSTOM4
public static final int CUSTOM5
public static final int CUSTOM6
public static final int CUSTOM7
public static final int DOUBLE_CLICK_THRESHOLD
public static final int OVAL_ROI
public static final int ELLIPSE_ROI
public static final int BRUSH_ROI
public static final java.lang.String CORNER_DIAMETER
public static java.lang.String TOOL_KEY
public static final int SPARE1
public static final int SPARE2
public static final int SPARE3
public static final int SPARE4
public static final int SPARE5
public static final int SPARE6
public static final int SPARE7
public static final int SPARE8
public static final int SPARE9
public static int getToolId()
public int getToolId(java.lang.String name)
public static Toolbar getInstance()
public void paint(java.awt.Graphics g)
paint in class java.awt.Canvaspublic boolean setTool(java.lang.String name)
public static java.lang.String getToolName()
public void setTool(int tool)
public java.awt.Color getColor()
public void setColor(java.awt.Color c)
public static java.awt.Color getForegroundColor()
public static void setForegroundColor(java.awt.Color c)
public static java.awt.Color getBackgroundColor()
public static void setBackgroundColor(java.awt.Color c)
public static int getBrushSize()
public static void setBrushSize(int size)
public static int getRoundRectArcSize()
public static void setRoundRectArcSize(int size)
public static boolean getMultiPointMode()
public static int getOvalToolType()
public static int getButtonSize()
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenerpublic void restorePreviousTool()
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenerpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenerpublic void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenerpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenerpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenerpublic void itemStateChanged(java.awt.event.ItemEvent e)
itemStateChanged in interface java.awt.event.ItemListenerpublic static void restoreTools()
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListenerpublic java.awt.Dimension getPreferredSize()
getPreferredSize in class java.awt.Componentpublic java.awt.Dimension getMinimumSize()
getMinimumSize in class java.awt.Componentpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListenerpublic int addTool(java.lang.String toolTip)
public void addMacroTool(java.lang.String name,
MacroInstaller macroInstaller,
int id)
public void addMacroTool(java.lang.String name,
MacroInstaller macroInstaller)
public static void removeMacroTools()
public static void addPlugInTool(PlugInTool tool)
public static PlugInTool getPlugInTool()
public void installStartupTools()
public static boolean installStartupMacrosTools()
public int getNumTools()