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,WatermarkOverlay
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 booleanm_Enabledwhether 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 voidcleanUp()Cleans up data structures, frees up memory.voiddefineOptions()Adds options to the internal list of options.protected abstract voiddoImageChanged(ImagePanel.PaintPanel panel)Notifies the overlay that the image has changed.protected abstract voiddoPaintOverlay(ImagePanel.PaintPanel panel, Graphics g)Performs the actual painting of the overlay.StringenabledTipText()Returns the tip text for this property.voidimageChanged(ImagePanel.PaintPanel panel)Notifies the overlay that the image has changed.booleanisEnabled()Returns whether this overlay is enabled or not.voidoverlayAdded(ImagePanel.PaintPanel panel)Gets called when the image overlay got added to a paintable panel.voidoverlayRemoved(ImagePanel.PaintPanel panel)Gets called when the image overlay got removed from a paintable panel.voidpaintOverlay(ImagePanel.PaintPanel panel, Graphics g)Paints the overlay over the image.voidsetEnabled(boolean value)Sets whether this overlay is enabled or not.AbstractImageOverlayshallowCopy()Returns a shallow copy of itself, i.e., based on the commandline options.AbstractImageOverlayshallowCopy(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:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin 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:
imageChangedin 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:
paintOverlayin 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:
overlayAddedin 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:
overlayRemovedin 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:
shallowCopyin 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:
shallowCopyin 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:
cleanUpin interfaceCleanUpHandler
-
-