public class Tools extends java.lang.Object implements java.lang.Iterable<PaletteEntry>
Modifier and Type | Method and Description |
---|---|
PaletteEntry |
getActiveTool()
Get active tool.
|
static Tools |
getInstance()
Retrieve singleton instance of Tools.
|
PaletteEntry |
getSelectTool()
Access the selected tool.
|
PaletteEntry |
getTool(java.lang.String name)
Retrieves the desired tool by name.
|
java.util.Iterator<PaletteEntry> |
iterator()
Returns list of all registered actions.
|
void |
register(PaletteEntry entry)
Register a new entry with the tool repository.
|
void |
setActiveTool(PaletteEntry entry)
Set active tool.
|
public static Tools getInstance()
public PaletteEntry getSelectTool()
Select
action.public PaletteEntry getTool(java.lang.String name)
name
- desired toolpublic void setActiveTool(PaletteEntry entry)
entry
- entry to selectjava.lang.IllegalArgumentException
- if no entry already exists to matches entrypublic PaletteEntry getActiveTool() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- if no active tool yet set.public void register(PaletteEntry entry)
Select.selectName
is added,
its entry is stored as being the special Select tool.entry
- new entry to be addedjava.lang.IllegalArgumentException
- if entry already exists that matches entry.public java.util.Iterator<PaletteEntry> iterator()
iterator
in interface java.lang.Iterable<PaletteEntry>