Interface Tool
-
- All Superinterfaces:
CleanUpHandler
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,Serializable
- All Known Subinterfaces:
CustomizableTool
- All Known Implementing Classes:
AbstractShapeTool
,AbstractTool
,AbstractToolWithParameterPanel
,BucketFill
,Eraser
,Filter
,Pencil
,Pointer
,PolygonFill
,SwitchLabel
public interface Tool extends Serializable, GlobalInfoSupporter, CleanUpHandler, LoggingSupporter, LoggingLevelHandler
Interface for tools.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
activate()
Gets called to activate the tool.void
annotationsChanged()
Hook method for when new annotations have been set.void
deactivate()
Gets called to deactivate the tool.Color
getActiveColor()
Returns the active color.CombinedLayer.CombinedSubLayer
getActiveCombinedSubLayer()
Returns the active combined sub layer.BufferedImage
getActiveImage()
Returns the active image.OverlayLayer
getActiveOverlay()
Returns the active overlay layer.CanvasPanel
getCanvas()
Returns the currently set canvas panel.Cursor
getCursor()
Returns the mouse cursor to use.Icon
getIcon()
The icon of the tool.ToolKeyAdapter
getKeyListener()
Returns the mouse listener to use.LayerManager
getLayerManager()
Returns the layer manager.ToolMouseAdapter
getMouseListener()
Returns the mouse listener to use.ToolMouseMotionAdapter
getMouseMotionListener()
Returns the mouse motion listener to use.String
getName()
The name of the tool.BasePanel
getOptionPanel()
Returns the panel for setting the options.PaintOperation
getPaintOperation()
Returns the paint operation for the tool.double
getZoom()
Returns the current zoom.boolean
hasActiveCombinedSubLayer()
Returns whether an active combined sub layer is present.boolean
hasActiveOverlay()
Returns whether an active overlay layer is present.boolean
hasAnyActive()
Returns whether any active layer is present.boolean
isAutomaticUndoEnabled()
Returns whether automatic undo is enabled.void
setCanvas(CanvasPanel value)
Sets the canvas panel to use.-
Methods inherited from interface adams.core.CleanUpHandler
cleanUp
-
Methods inherited from interface adams.core.GlobalInfoSupporter
globalInfo
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel, setLoggingLevel
-
Methods inherited from interface adams.core.logging.LoggingSupporter
getLogger, isLoggingEnabled
-
-
-
-
Method Detail
-
setCanvas
void setCanvas(CanvasPanel value)
Sets the canvas panel to use.- Parameters:
value
- the panel
-
getCanvas
CanvasPanel getCanvas()
Returns the currently set canvas panel.- Returns:
- the panel, null if none set
-
getLayerManager
LayerManager getLayerManager()
Returns the layer manager.- Returns:
- the layer manager, null if not available
-
hasAnyActive
boolean hasAnyActive()
Returns whether any active layer is present.- Returns:
- true if an active layer present
- See Also:
hasActiveOverlay()
,hasActiveCombinedSubLayer()
-
hasActiveOverlay
boolean hasActiveOverlay()
Returns whether an active overlay layer is present.- Returns:
- true if available
-
getActiveOverlay
OverlayLayer getActiveOverlay()
Returns the active overlay layer.- Returns:
- the layer, null if none available
-
hasActiveCombinedSubLayer
boolean hasActiveCombinedSubLayer()
Returns whether an active combined sub layer is present.- Returns:
- true if available
-
getActiveCombinedSubLayer
CombinedLayer.CombinedSubLayer getActiveCombinedSubLayer()
Returns the active combined sub layer.- Returns:
- the layer, null if none available
-
getActiveImage
BufferedImage getActiveImage()
Returns the active image.- Returns:
- the image or null if none active
-
getActiveColor
Color getActiveColor()
Returns the active color.- Returns:
- the color or null if none active
-
getZoom
double getZoom()
Returns the current zoom.- Returns:
- the zoom (1.0 = 100%)
-
isAutomaticUndoEnabled
boolean isAutomaticUndoEnabled()
Returns whether automatic undo is enabled.- Returns:
- true if enabled
-
getName
String getName()
The name of the tool.- Returns:
- the name
-
getIcon
Icon getIcon()
The icon of the tool.- Returns:
- the icon
-
getCursor
Cursor getCursor()
Returns the mouse cursor to use.- Returns:
- the cursor
-
getMouseListener
ToolMouseAdapter getMouseListener()
Returns the mouse listener to use.- Returns:
- the listener
-
getMouseMotionListener
ToolMouseMotionAdapter getMouseMotionListener()
Returns the mouse motion listener to use.- Returns:
- the listener
-
getKeyListener
ToolKeyAdapter getKeyListener()
Returns the mouse listener to use.- Returns:
- the listener
-
getPaintOperation
PaintOperation getPaintOperation()
Returns the paint operation for the tool.- Returns:
- the paint operation
-
getOptionPanel
BasePanel getOptionPanel()
Returns the panel for setting the options.- Returns:
- the options panel
-
activate
void activate()
Gets called to activate the tool.
-
deactivate
void deactivate()
Gets called to deactivate the tool.
-
annotationsChanged
void annotationsChanged()
Hook method for when new annotations have been set.
-
-