Class TextOverlay
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.visualization.image.AbstractImageOverlay
-
- All Implemented Interfaces:
adams.core.CleanUpHandler
,adams.core.Destroyable
,adams.core.GlobalInfoSupporter
,adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.option.OptionHandler
,adams.core.ShallowCopySupporter<adams.gui.visualization.image.AbstractImageOverlay>
,adams.core.SizeOfHandler
,adams.gui.visualization.image.ImageOverlay
,Serializable
public class TextOverlay extends AbstractPositionableHeatmapOverlayWithDimensions
Displays text as overlay, either the fixed text, or if empty, a report value.
-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, this overlay is painted over the image. 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:
-report-field <adams.data.report.Field> (property: reportField) The report field to display. default:
-text-color <java.awt.Color> (property: textColor) The text color. default: #ff0000
-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.data.report.Field
m_ReportField
the report value.protected String
m_Text
the fixed text.protected Color
m_TextColor
the color of the text.-
Fields inherited from class adams.gui.visualization.heatmap.overlay.AbstractPositionableHeatmapOverlayWithDimensions
m_Height, m_Width
-
Fields inherited from class adams.gui.visualization.heatmap.overlay.AbstractPositionableHeatmapOverlay
m_X, m_Y
-
Fields inherited from class adams.gui.visualization.heatmap.overlay.AbstractHeatmapOverlay
m_HeatmapPanel
-
-
Constructor Summary
Constructors Constructor Description TextOverlay()
-
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
doImageChanged(adams.gui.visualization.image.ImagePanel.PaintPanel panel)
Notifies the overlay that the image has changed.protected void
doPaintOverlay(adams.gui.visualization.image.ImagePanel.PaintPanel panel, 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.data.report.Field
getReportField()
Returns the report field to output.String
getText()
Returns the fixed text to output.Color
getTextColor()
Returns the color for 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.String
reportFieldTipText()
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
setReportField(adams.data.report.Field value)
Sets the report field to output.void
setText(String value)
Sets the fixed text to output.void
setTextColor(Color value)
Sets the color for the text.String
textColorTipText()
Returns the tip text for this property.String
textTipText()
Returns the tip text for this property.String
widthTipText()
Returns the tip text for this property.-
Methods inherited from class adams.gui.visualization.heatmap.overlay.AbstractPositionableHeatmapOverlayWithDimensions
doPaintOverlay, getHeight, getWidth, setHeight, setWidth
-
Methods inherited from class adams.gui.visualization.heatmap.overlay.AbstractPositionableHeatmapOverlay
getDefaultX, getDefaultY, getX, getY, setX, setY, xTipText, yTipText
-
Methods inherited from class adams.gui.visualization.heatmap.overlay.AbstractHeatmapOverlay
getHeatmapPanel, paintOverlay, setHeatmapPanel
-
Methods inherited from class adams.gui.visualization.image.AbstractImageOverlay
cleanUp, enabledTipText, imageChanged, isEnabled, overlayAdded, overlayRemoved, setEnabled, shallowCopy, shallowCopy
-
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_ReportField
protected adams.data.report.Field m_ReportField
the report value.
-
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 classAbstractPositionableHeatmapOverlayWithDimensions
-
getDefaultHeight
protected int getDefaultHeight()
Returns the default height for the overlay.- Specified by:
getDefaultHeight
in classAbstractPositionableHeatmapOverlayWithDimensions
- Returns:
- the default height
-
heightTipText
public String heightTipText()
Returns the tip text for this property.- Specified by:
heightTipText
in classAbstractPositionableHeatmapOverlayWithDimensions
- 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 classAbstractPositionableHeatmapOverlayWithDimensions
- Returns:
- the default width
-
widthTipText
public String widthTipText()
Returns the tip text for this property.- Specified by:
widthTipText
in classAbstractPositionableHeatmapOverlayWithDimensions
- 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.
-
setReportField
public void setReportField(adams.data.report.Field value)
Sets the report field to output.- Parameters:
value
- the field
-
getReportField
public adams.data.report.Field getReportField()
Returns the report field to output.- Returns:
- the field
-
reportFieldTipText
public String reportFieldTipText()
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.
-
doImageChanged
protected void doImageChanged(adams.gui.visualization.image.ImagePanel.PaintPanel panel)
Notifies the overlay that the image has changed.- Specified by:
doImageChanged
in classadams.gui.visualization.image.AbstractImageOverlay
- Parameters:
panel
- the panel this overlay belongs to
-
doPaintOverlay
protected void doPaintOverlay(adams.gui.visualization.image.ImagePanel.PaintPanel panel, Graphics g, int x, int y)
Performs the actual painting.- Specified by:
doPaintOverlay
in classAbstractPositionableHeatmapOverlayWithDimensions
- Parameters:
panel
- the associated viewerg
- the graphics contextx
- the actual x coordinatey
- the actual y coordinate
-
-