Class AbstractWatermark
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.visualization.watermark.AbstractWatermark
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,Watermark
,Serializable
- Direct Known Subclasses:
AbstractImageWatermark
,Default
,MultiWatermark
,Null
,Text
public abstract class AbstractWatermark extends AbstractOptionHandler implements Watermark
Ancestor for watermark plugins.- 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 watermark 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 AbstractWatermark()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
applyWatermark(Graphics g, Dimension dimension)
Applies the watermark in the specified graphics context.protected boolean
canApplyWatermark(Graphics g, Dimension dimension)
Returns whether the watermark can be applied.void
defineOptions()
Adds options to the internal list of options.protected abstract void
doApplyWatermark(Graphics g, Dimension dimension)
Applies the watermark in the specified graphics context.String
enabledTipText()
Returns the tip text for this property.boolean
getEnabled()
Returns whether the watermark is enabled.void
setEnabled(boolean value)
Sets whether to enable the watermark.-
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.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
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 to enable the watermark.- Parameters:
value
- true if to enable
-
getEnabled
public boolean getEnabled()
Returns whether the watermark is enabled.- Returns:
- true if 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.
-
canApplyWatermark
protected boolean canApplyWatermark(Graphics g, Dimension dimension)
Returns whether the watermark can be applied.
Default implementation just returns true.- Parameters:
g
- the graphics contextdimension
- the dimension of the drawing area- Returns:
- true if it can be applied
-
doApplyWatermark
protected abstract void doApplyWatermark(Graphics g, Dimension dimension)
Applies the watermark in the specified graphics context.- Parameters:
g
- the graphics contextdimension
- the dimension of the drawing area
-
applyWatermark
public void applyWatermark(Graphics g, Dimension dimension)
Applies the watermark in the specified graphics context.- Specified by:
applyWatermark
in interfaceWatermark
- Parameters:
g
- the graphics contextdimension
- the dimension of the drawing area
-
-