Class FromResource
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,Watermark
,Serializable
public class FromResource extends AbstractImageWatermark
Uses the specified image (available from the classpath) as watermark.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected String
m_ImageResource
the image resource.-
Fields inherited from class adams.gui.visualization.watermark.AbstractImageWatermark
m_Alpha, m_Image, m_Initialized, m_Location, m_Padding, m_Scale, m_X, m_Y
-
Fields inherited from class adams.gui.visualization.watermark.AbstractWatermark
m_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 FromResource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.String
getImageResource()
Returns the classpath resource to load the image from, ignored if empty.String
globalInfo()
Returns a string describing the object.String
imageResourceTipText()
Returns the tip text for this property.protected Image
loadImage()
Loads the image.void
setImageResource(String value)
Sets the classpath resource to load the image from, ignored if empty.-
Methods inherited from class adams.gui.visualization.watermark.AbstractImageWatermark
alphaTipText, canApplyWatermark, doApplyWatermark, getAlpha, getDefaultAlpha, getDefaultLocation, getDefaultPadding, getDefaultScale, getDefaultX, getDefaultY, getLocation, getPadding, getScale, getX, getY, initializeImage, locationTipText, paddingTipText, reset, scaleTipText, setAlpha, setLocation, setPadding, setScale, setX, setY, XTipText, YTipText
-
Methods inherited from class adams.gui.visualization.watermark.AbstractWatermark
applyWatermark, enabledTipText, getEnabled, setEnabled
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, 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
-
-
-
-
Field Detail
-
m_ImageResource
protected String m_ImageResource
the image resource.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractImageWatermark
-
setImageResource
public void setImageResource(String value)
Sets the classpath resource to load the image from, ignored if empty.- Parameters:
value
- the resource path
-
getImageResource
public String getImageResource()
Returns the classpath resource to load the image from, ignored if empty.- Returns:
- the resource path
-
imageResourceTipText
public String imageResourceTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
loadImage
protected Image loadImage()
Loads the image.- Specified by:
loadImage
in classAbstractImageWatermark
- Returns:
- the image, null if failed to load
-
-