Class TextMapOverlay
- 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.AbstractPositionableMapOverlayWithDimensions
-
- adams.flow.sink.openstreetmapviewer.TextMapOverlay
-
- 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 TextMapOverlay extends AbstractPositionableMapOverlayWithDimensions
Displays text, either fixed, from a variable or from storage.
Precedence: fixed > variable > storage
-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
-width <int> (property: width) The width of the bounding box around the text. default: 100 minimum: -1
-height <int> (property: height) The height of the bounding box around the text. default: 20 minimum: -1
-offset-x <int> (property: offsetX) The X offset for the text. default: 4
-offset-y <int> (property: offsetY) The Y offset for the text. default: -4
-text <java.lang.String> (property: text) The fixed text to output. default:
-storage-name <adams.flow.control.StorageName> (property: storageName) The name of the storage item to output. default: null
-variable-name <adams.core.VariableName> (property: variableName) The variable to use for the filename instead of the auto-generated one. default: variable
-text-color <java.awt.Color> (property: textColor) The text color. default: #000000
-font <java.awt.Font> (property: font) The font to use for the text. default: helvetica-PLAIN-12
- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Font
m_Font
the font to use.protected int
m_OffsetX
the X offset of the overlay.protected int
m_OffsetY
the Y offset of the overlay.protected adams.flow.control.StorageName
m_StorageName
the storage item to output.protected String
m_Text
the fixed text.protected Color
m_TextColor
the color of the text.protected adams.core.VariableName
m_VariableName
the variable to obtain the text from.-
Fields inherited from class adams.flow.sink.openstreetmapviewer.AbstractPositionableMapOverlayWithDimensions
m_Height, m_Width
-
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 TextMapOverlay()
-
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.String
fontTipText()
Returns the tip text for this property.protected int
getDefaultHeight()
Returns the default height for the overlay.protected int
getDefaultWidth()
Returns the default width for the overlay.Font
getFont()
Returns the font for the text.int
getOffsetX()
Returns the currently set X offset for the text.int
getOffsetY()
Returns the currently set Y offset of the text.adams.flow.control.StorageName
getStorageName()
Returns the name for the hashset in the internal storage.String
getText()
Returns the fixed text to output.Color
getTextColor()
Returns the color for the text.adams.core.VariableName
getVariableName()
Returns the variable to use for outputting the text.String
globalInfo()
Returns a string describing the object.String
heightTipText()
Returns the tip text for this property.String
offsetXTipText()
Returns the tip text for this property.String
offsetYTipText()
Returns the tip text for this property.void
setFont(Font value)
Sets the font for the text.void
setOffsetX(int value)
Sets the X offset for the text.void
setOffsetY(int value)
Sets the Y offset of the text.void
setStorageName(adams.flow.control.StorageName value)
Sets the name for the hashset in the internal storage.void
setText(String value)
Sets the fixed text to output.void
setTextColor(Color value)
Sets the color for the text.void
setVariableName(adams.core.VariableName value)
Sets the variable to use for outputting the text.String
storageNameTipText()
Returns the tip text for this property.String
textColorTipText()
Returns the tip text for this property.String
textTipText()
Returns the tip text for this property.String
variableNameTipText()
Returns the tip text for this property.String
widthTipText()
Returns the tip text for this property.-
Methods inherited from class adams.flow.sink.openstreetmapviewer.AbstractPositionableMapOverlayWithDimensions
doPaintOverlay, getHeight, getWidth, setHeight, setWidth
-
Methods inherited from class adams.flow.sink.openstreetmapviewer.AbstractPositionableMapOverlay
getDefaultX, getDefaultY, getX, getY, setX, setY, xTipText, yTipText
-
Methods inherited from class adams.flow.sink.openstreetmapviewer.AbstractMapOverlay
enabledTipText, isEnabled, paintOverlay, postPaintOverlay, prePaintOverlay, 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_OffsetX
protected int m_OffsetX
the X offset of the overlay.
-
m_OffsetY
protected int m_OffsetY
the Y offset of the overlay.
-
m_Text
protected String m_Text
the fixed text.
-
m_VariableName
protected adams.core.VariableName m_VariableName
the variable to obtain the text from.
-
m_StorageName
protected adams.flow.control.StorageName m_StorageName
the storage item to output.
-
m_TextColor
protected Color m_TextColor
the color of the text.
-
m_Font
protected Font m_Font
the font to use.
-
-
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 classAbstractPositionableMapOverlayWithDimensions
-
getDefaultHeight
protected int getDefaultHeight()
Returns the default height for the overlay.- Specified by:
getDefaultHeight
in classAbstractPositionableMapOverlayWithDimensions
- Returns:
- the default height
-
heightTipText
public String heightTipText()
Returns the tip text for this property.- Specified by:
heightTipText
in classAbstractPositionableMapOverlayWithDimensions
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getDefaultWidth
protected int getDefaultWidth()
Returns the default width for the overlay.- Specified by:
getDefaultWidth
in classAbstractPositionableMapOverlayWithDimensions
- Returns:
- the default width
-
widthTipText
public String widthTipText()
Returns the tip text for this property.- Specified by:
widthTipText
in classAbstractPositionableMapOverlayWithDimensions
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setOffsetX
public void setOffsetX(int value)
Sets the X offset for the text.- Parameters:
value
- the X offset
-
getOffsetX
public int getOffsetX()
Returns the currently set X offset for the text.- Returns:
- the X offset
-
offsetXTipText
public String offsetXTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setOffsetY
public void setOffsetY(int value)
Sets the Y offset of the text.- Parameters:
value
- the Y offset
-
getOffsetY
public int getOffsetY()
Returns the currently set Y offset of the text.- Returns:
- the Y offset
-
offsetYTipText
public String offsetYTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setText
public void setText(String value)
Sets the fixed text to output.- Parameters:
value
- the text
-
getText
public String getText()
Returns the fixed text to output.- Returns:
- the text
-
textTipText
public String textTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setStorageName
public void setStorageName(adams.flow.control.StorageName value)
Sets the name for the hashset in the internal storage.- Parameters:
value
- the name
-
getStorageName
public adams.flow.control.StorageName getStorageName()
Returns the name for the hashset in the internal storage.- Returns:
- the name
-
storageNameTipText
public String storageNameTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setVariableName
public void setVariableName(adams.core.VariableName value)
Sets the variable to use for outputting the text.- Parameters:
value
- the variable to use (without the @{ and })
-
getVariableName
public adams.core.VariableName getVariableName()
Returns the variable to use for outputting the text.- Returns:
- the variable to use (without the @{ and })
-
variableNameTipText
public String variableNameTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setTextColor
public void setTextColor(Color value)
Sets the color for the text.- Parameters:
value
- the text color
-
getTextColor
public Color getTextColor()
Returns the color for the text.- Returns:
- the text color
-
textColorTipText
public String textColorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setFont
public void setFont(Font value)
Sets the font for the text.- Parameters:
value
- the font
-
getFont
public Font getFont()
Returns the font for the text.- Returns:
- the font
-
fontTipText
public String fontTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
doPaintOverlay
protected void doPaintOverlay(OpenStreetMapViewer viewer, Graphics g, int x, int y)
Performs the actual painting.- Specified by:
doPaintOverlay
in classAbstractPositionableMapOverlayWithDimensions
- Parameters:
viewer
- the associated viewerg
- the graphics contextx
- the actual x coordinatey
- the actual y coordinate
-
-