Class ImageMapOverlay
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.sink.openstreetmapviewer.AbstractMapOverlay
-
- adams.flow.sink.openstreetmapviewer.AbstractPositionableMapOverlay
-
- adams.flow.sink.openstreetmapviewer.ImageMapOverlay
-
- All Implemented Interfaces:
adams.core.Destroyable
,adams.core.GlobalInfoSupporter
,adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.option.OptionHandler
,adams.core.SizeOfHandler
,Serializable
public class ImageMapOverlay extends AbstractPositionableMapOverlay
Overlays the map with an icon obtained from a file.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-enabled <boolean> (property: enabled) If enabled, the overlay gets painted. default: true
-x <int> (property: x) The X position of the overlay (>=0: absolute, -1: left, -2: center, -3: right). default: -3 minimum: -3
-y <int> (property: y) The Y position of the overlay (>=0: absolute, -1: top, -2: center, -3: bottom ). default: -1 minimum: -3
-image-file <adams.core.io.PlaceholderFile> (property: imageFile) The image file to overlay. default: ${CWD}
-scale <double> (property: scale) The scaling factor for the image; 1.0 = actual size of image. default: 1.0 minimum: 0.0
- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected ImageIcon
m_Image
the image to paint.protected adams.core.io.PlaceholderFile
m_ImageFile
the image file to load.protected double
m_Scale
the scaling factor.-
Fields inherited from class adams.flow.sink.openstreetmapviewer.AbstractPositionableMapOverlay
m_X, m_Y
-
Fields inherited from class adams.flow.sink.openstreetmapviewer.AbstractMapOverlay
m_Enabled
-
-
Constructor Summary
Constructors Constructor Description ImageMapOverlay()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.protected void
doPaintOverlay(OpenStreetMapViewer viewer, Graphics g, int x, int y)
Performs the actual painting.protected int
getHeight()
Returns the height of the image.adams.core.io.PlaceholderFile
getImageFile()
Returns the image file to overlay.double
getScale()
Returns the scaling factor (1.0 = actual image size).protected int
getWidth()
Returns the width of the image.String
globalInfo()
Returns a string describing the object.String
imageFileTipText()
Returns the tip text for this property.protected void
prePaintOverlay(OpenStreetMapViewer viewer, Graphics g)
Gets executed before the actual painting.String
scaleTipText()
Returns the tip text for this property.void
setImageFile(adams.core.io.PlaceholderFile value)
Sets the image file to overlay.void
setScale(double value)
Sets the scaling factor (1.0 = actual image size).-
Methods inherited from class adams.flow.sink.openstreetmapviewer.AbstractPositionableMapOverlay
doPaintOverlay, getDefaultX, getDefaultY, getX, getY, setX, setY, xTipText, yTipText
-
Methods inherited from class adams.flow.sink.openstreetmapviewer.AbstractMapOverlay
enabledTipText, isEnabled, paintOverlay, postPaintOverlay, setEnabled
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_ImageFile
protected adams.core.io.PlaceholderFile m_ImageFile
the image file to load.
-
m_Image
protected transient ImageIcon m_Image
the image to paint.
-
m_Scale
protected double m_Scale
the scaling factor.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceadams.core.GlobalInfoSupporter
- Specified by:
globalInfo
in classadams.core.option.AbstractOptionHandler
- 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 interfaceadams.core.option.OptionHandler
- Overrides:
defineOptions
in classAbstractPositionableMapOverlay
-
setImageFile
public void setImageFile(adams.core.io.PlaceholderFile value)
Sets the image file to overlay.- Parameters:
value
- the file
-
getImageFile
public adams.core.io.PlaceholderFile getImageFile()
Returns the image file to overlay.- Returns:
- the file
-
imageFileTipText
public String imageFileTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setScale
public void setScale(double value)
Sets the scaling factor (1.0 = actual image size).- Parameters:
value
- the scaling factor
-
getScale
public double getScale()
Returns the scaling factor (1.0 = actual image size).- Returns:
- the scaling factor
-
scaleTipText
public String scaleTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getHeight
protected int getHeight()
Returns the height of the image.- Overrides:
getHeight
in classAbstractPositionableMapOverlay
- Returns:
- the height
-
getWidth
protected int getWidth()
Returns the width of the image.- Overrides:
getWidth
in classAbstractPositionableMapOverlay
- Returns:
- the width
-
prePaintOverlay
protected void prePaintOverlay(OpenStreetMapViewer viewer, Graphics g)
Gets executed before the actual painting.
Loads the image.- Overrides:
prePaintOverlay
in classAbstractMapOverlay
- Parameters:
viewer
- the associated viewerg
- the graphics context
-
doPaintOverlay
protected void doPaintOverlay(OpenStreetMapViewer viewer, Graphics g, int x, int y)
Performs the actual painting.- Specified by:
doPaintOverlay
in classAbstractPositionableMapOverlay
- Parameters:
viewer
- the associated viewerg
- the graphics contextx
- the actual x coordinatey
- the actual y coordinate
-
-