Package adams.gui.visualization.image
Class AbstractImageOverlay
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.visualization.image.AbstractImageOverlay
-
- All Implemented Interfaces:
CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,ShallowCopySupporter<AbstractImageOverlay>
,SizeOfHandler
,ImageOverlay
,Serializable
- Direct Known Subclasses:
AbstractObjectOverlayFromReport
,AbstractPointOverlayFromReport
,BoofCVDetectLineSegmentsImageOverlay
,BoofCVDetectLinesImageOverlay
,HighlightLocations
,MetaDataText
,MultiImageOverlay
,NullOverlay
,ObjectAnnotations
public abstract class AbstractImageOverlay extends AbstractOptionHandler implements ImageOverlay, ShallowCopySupporter<AbstractImageOverlay>
Abstract ancestor for image overlays.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
m_Enabled
whether the overlay is enabled.-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description AbstractImageOverlay()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
cleanUp()
Cleans up data structures, frees up memory.void
defineOptions()
Adds options to the internal list of options.protected abstract void
doImageChanged(ImagePanel.PaintPanel panel)
Notifies the overlay that the image has changed.protected abstract void
doPaintOverlay(ImagePanel.PaintPanel panel, Graphics g)
Performs the actual painting of the overlay.String
enabledTipText()
Returns the tip text for this property.void
imageChanged(ImagePanel.PaintPanel panel)
Notifies the overlay that the image has changed.boolean
isEnabled()
Returns whether this overlay is enabled or not.void
overlayAdded(ImagePanel.PaintPanel panel)
Gets called when the image overlay got added to a paintable panel.void
overlayRemoved(ImagePanel.PaintPanel panel)
Gets called when the image overlay got removed from a paintable panel.void
paintOverlay(ImagePanel.PaintPanel panel, Graphics g)
Paints the overlay over the image.void
setEnabled(boolean value)
Sets whether this overlay is enabled or not.AbstractImageOverlay
shallowCopy()
Returns a shallow copy of itself, i.e., based on the commandline options.AbstractImageOverlay
shallowCopy(boolean expand)
Returns a shallow copy of itself, i.e., based on the commandline options.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
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, wait, wait, wait
-
Methods inherited from interface adams.core.Destroyable
destroy
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
-
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractOptionHandler
-
setEnabled
public void setEnabled(boolean value)
Sets whether this overlay is enabled or not.- Parameters:
value
- true if to enable this overlay
-
isEnabled
public boolean isEnabled()
Returns whether this overlay is enabled or not.- Returns:
- true if overlay enabled
-
enabledTipText
public String enabledTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
doImageChanged
protected abstract void doImageChanged(ImagePanel.PaintPanel panel)
Notifies the overlay that the image has changed.- Parameters:
panel
- the panel this overlay belongs to
-
imageChanged
public void imageChanged(ImagePanel.PaintPanel panel)
Notifies the overlay that the image has changed.- Specified by:
imageChanged
in interfaceImageOverlay
- Parameters:
panel
- the panel this overlay belongs to
-
doPaintOverlay
protected abstract void doPaintOverlay(ImagePanel.PaintPanel panel, Graphics g)
Performs the actual painting of the overlay.- Parameters:
panel
- the panel this overlay is forg
- the graphics context
-
paintOverlay
public void paintOverlay(ImagePanel.PaintPanel panel, Graphics g)
Paints the overlay over the image.- Specified by:
paintOverlay
in interfaceImageOverlay
- Parameters:
panel
- the panel this overlay is forg
- the graphics context
-
overlayAdded
public void overlayAdded(ImagePanel.PaintPanel panel)
Gets called when the image overlay got added to a paintable panel.
Default implementation does nothing.- Specified by:
overlayAdded
in interfaceImageOverlay
- Parameters:
panel
- the panel it got added to
-
overlayRemoved
public void overlayRemoved(ImagePanel.PaintPanel panel)
Gets called when the image overlay got removed from a paintable panel.
Default implementation does nothing.- Specified by:
overlayRemoved
in interfaceImageOverlay
- Parameters:
panel
- the panel it got removed from
-
shallowCopy
public AbstractImageOverlay shallowCopy()
Returns a shallow copy of itself, i.e., based on the commandline options.- Specified by:
shallowCopy
in interfaceShallowCopySupporter<AbstractImageOverlay>
- Returns:
- the shallow copy
-
shallowCopy
public AbstractImageOverlay shallowCopy(boolean expand)
Returns a shallow copy of itself, i.e., based on the commandline options.- Specified by:
shallowCopy
in interfaceShallowCopySupporter<AbstractImageOverlay>
- Parameters:
expand
- whether to expand variables to their current values- Returns:
- the shallow copy
-
cleanUp
public void cleanUp()
Cleans up data structures, frees up memory.
Default implementation does nothing.- Specified by:
cleanUp
in interfaceCleanUpHandler
-
-