Class TextOverlay

  • 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 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.
    • Constructor Detail

      • TextOverlay

        public TextOverlay()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing the object.
        Specified by:
        globalInfo in interface adams.core.GlobalInfoSupporter
        Specified by:
        globalInfo in class adams.core.option.AbstractOptionHandler
        Returns:
        a description suitable for displaying in the gui
      • 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 class adams.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 class AbstractPositionableHeatmapOverlayWithDimensions
        Parameters:
        panel - the associated viewer
        g - the graphics context
        x - the actual x coordinate
        y - the actual y coordinate