Class AbstractShapeTool
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.gui.visualization.segmentation.tool.AbstractTool
-
- adams.gui.visualization.segmentation.tool.AbstractToolWithParameterPanel
-
- adams.gui.visualization.segmentation.tool.AbstractShapeTool
-
- All Implemented Interfaces:
CleanUpHandler
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,SizeOfHandler
,CustomizableTool
,Tool
,Serializable
public abstract class AbstractShapeTool extends AbstractToolWithParameterPanel
Ancestor for shaped tools.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Point
m_LastPoint
the last point that was drawn on.-
Fields inherited from class adams.gui.visualization.segmentation.tool.AbstractToolWithParameterPanel
m_ButtonApply
-
Fields inherited from class adams.gui.visualization.segmentation.tool.AbstractTool
m_KeyListener, m_Listener, m_MotionListener, m_PaintOperation, m_PanelCanvas, m_PanelFullOptions, m_PanelOptions
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description AbstractShapeTool()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected ToolMouseAdapter
createMouseListener()
Creates the mouse listener to use.protected ToolMouseMotionAdapter
createMouseMotionListener()
Creates the mouse motion listener to use.protected void
doDrawShape(Point p)
Draws the currently selected shape at the specified location.protected abstract void
doDrawShape(List<Point> points)
Draws the currently selected shape at the specified locations.protected void
drawShape(Point p)
Draws the currently selected shape at the specified location.protected void
drawShape(Point from, Point to)
Draws the shape along the line between the two points.-
Methods inherited from class adams.gui.visualization.segmentation.tool.AbstractToolWithParameterPanel
addOptions, applyOptions, createOptionPanel
-
Methods inherited from class adams.gui.visualization.segmentation.tool.AbstractTool
activate, annotationsChanged, apply, checkBeforeApply, cleanUp, createApplyButton, createCursor, createKeyListener, createPaintOperation, deactivate, doApply, getActiveColor, getActiveCombinedSubLayer, getActiveImage, getActiveOverlay, getCanvas, getCursor, getKeyListener, getLayerManager, getMouseListener, getMouseMotionListener, getOptionPanel, getPaintOperation, getZoom, hasActiveCombinedSubLayer, hasActiveOverlay, hasAnyActive, initialize, isAutomaticUndoEnabled, setApplyButtonState, setCanvas
-
Methods inherited from class adams.core.logging.CustomLoggingLevelObject
setLoggingLevel
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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
-
Methods inherited from interface adams.gui.visualization.segmentation.tool.Tool
activate, annotationsChanged, deactivate, getActiveColor, getActiveCombinedSubLayer, getActiveImage, getActiveOverlay, getCanvas, getCursor, getIcon, getKeyListener, getLayerManager, getMouseListener, getMouseMotionListener, getName, getOptionPanel, getPaintOperation, getZoom, hasActiveCombinedSubLayer, hasActiveOverlay, hasAnyActive, isAutomaticUndoEnabled, setCanvas
-
-
-
-
Field Detail
-
m_LastPoint
protected Point m_LastPoint
the last point that was drawn on.
-
-
Method Detail
-
doDrawShape
protected void doDrawShape(Point p)
Draws the currently selected shape at the specified location.- Parameters:
p
- the location
-
doDrawShape
protected abstract void doDrawShape(List<Point> points)
Draws the currently selected shape at the specified locations.- Parameters:
points
- the locations
-
drawShape
protected void drawShape(Point p)
Draws the currently selected shape at the specified location. Skips drawing if no active layer. Updates the canvas after a successful draw.- Parameters:
p
- the location
-
drawShape
protected void drawShape(Point from, Point to)
Draws the shape along the line between the two points.- Parameters:
from
- the starting pointto
- the end point
-
createMouseListener
protected ToolMouseAdapter createMouseListener()
Creates the mouse listener to use.- Specified by:
createMouseListener
in classAbstractTool
- Returns:
- the listener, null if not applicable
-
createMouseMotionListener
protected ToolMouseMotionAdapter createMouseMotionListener()
Creates the mouse motion listener to use.- Specified by:
createMouseMotionListener
in classAbstractTool
- Returns:
- the listener, null if not applicable
-
-