Class ClassificationLabelTextOverlay
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.visualization.object.overlay.AbstractOverlay
-
- adams.gui.visualization.object.overlay.ClassificationLabelTextOverlay
-
- All Implemented Interfaces:
CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,Overlay
,OverlayWithCustomAlphaSupport
,Serializable
public class ClassificationLabelTextOverlay extends AbstractOverlay implements OverlayWithCustomAlphaSupport
Displays the classification label retrieved from the field in the report and overlays it as text on the image.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Color
m_Color
the color for the objects.protected int
m_CustomAlpha
the custom alpha value to use.protected boolean
m_CustomAlphaEnabled
whether a custom alpha is in use.protected Field
m_Field
the field to store the classification label in.protected Font
m_LabelFont
the label font.protected int
m_LabelOffsetX
the x offset for the label.protected int
m_LabelOffsetY
the y offset for the label.-
Fields inherited from class adams.gui.visualization.object.overlay.AbstractOverlay
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 ClassificationLabelTextOverlay()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Color
applyAlpha(Color c)
Applies the custom alpha value to the color if necessary.String
colorTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.protected void
doPaint(ObjectAnnotationPanel panel, Graphics g)
Paints the overlay.String
fieldTipText()
Returns the tip text for this property.Color
getColor()
Returns the color to use for the label.int
getCustomAlpha()
Returns the custom alpha value (0: transparent, 255: opaque).Field
getField()
Returns the field to use.Font
getLabelFont()
Returns the label font.int
getLabelOffsetX()
Returns the X offset for the label.int
getLabelOffsetY()
Returns the Y offset for the label.String
globalInfo()
Returns a string describing the object.boolean
isCustomAlphaEnabled()
Returns whether a custom alpha value is in use for the overlay colors.String
labelFontTipText()
Returns the tip text for this property.String
labelOffsetXTipText()
Returns the tip text for this property.String
labelOffsetYTipText()
Returns the tip text for this property.void
setColor(Color value)
Sets the color to use for the label.void
setCustomAlpha(int value)
Sets the custom alpha value (0: transparent, 255: opaque).void
setCustomAlphaEnabled(boolean value)
Sets whether to use a custom alpha value for the overlay colors.void
setField(Field value)
Sets the field to use.void
setLabelFont(Font value)
Sets the label font.void
setLabelOffsetX(int value)
Sets the X offset for the label.void
setLabelOffsetY(int value)
Sets the Y offset for the label.-
Methods inherited from class adams.gui.visualization.object.overlay.AbstractOverlay
annotationsChanged, cleanUp, enabledTipText, getEnabled, paint, 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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.Destroyable
destroy
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
Methods inherited from interface adams.gui.visualization.object.overlay.Overlay
annotationsChanged, cleanUp, enabledTipText, getEnabled, paint, setEnabled
-
-
-
-
Field Detail
-
m_Field
protected Field m_Field
the field to store the classification label in.
-
m_Color
protected Color m_Color
the color for the objects.
-
m_LabelFont
protected Font m_LabelFont
the label font.
-
m_LabelOffsetX
protected int m_LabelOffsetX
the x offset for the label.
-
m_LabelOffsetY
protected int m_LabelOffsetY
the y offset for the label.
-
m_CustomAlphaEnabled
protected boolean m_CustomAlphaEnabled
whether a custom alpha is in use.
-
m_CustomAlpha
protected int m_CustomAlpha
the custom alpha value to use.
-
-
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 classAbstractOverlay
-
setField
public void setField(Field value)
Sets the field to use.- Parameters:
value
- the field
-
getField
public Field getField()
Returns the field to use.- Returns:
- the field
-
fieldTipText
public String fieldTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setColor
public void setColor(Color value)
Sets the color to use for the label.- Parameters:
value
- the color
-
getColor
public Color getColor()
Returns the color to use for the label.- Returns:
- the color
-
colorTipText
public String colorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setLabelFont
public void setLabelFont(Font value)
Sets the label font.- Parameters:
value
- the label font
-
getLabelFont
public Font getLabelFont()
Returns the label font.- Returns:
- the label font
-
labelFontTipText
public String labelFontTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setLabelOffsetX
public void setLabelOffsetX(int value)
Sets the X offset for the label.- Parameters:
value
- the X offset
-
getLabelOffsetX
public int getLabelOffsetX()
Returns the X offset for the label.- Returns:
- the X offset
-
labelOffsetXTipText
public String labelOffsetXTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setLabelOffsetY
public void setLabelOffsetY(int value)
Sets the Y offset for the label.- Parameters:
value
- the Y offset
-
getLabelOffsetY
public int getLabelOffsetY()
Returns the Y offset for the label.- Returns:
- the Y offset
-
labelOffsetYTipText
public String labelOffsetYTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setCustomAlphaEnabled
public void setCustomAlphaEnabled(boolean value)
Sets whether to use a custom alpha value for the overlay colors.- Specified by:
setCustomAlphaEnabled
in interfaceOverlayWithCustomAlphaSupport
- Parameters:
value
- true if to use custom alpha
-
isCustomAlphaEnabled
public boolean isCustomAlphaEnabled()
Returns whether a custom alpha value is in use for the overlay colors.- Specified by:
isCustomAlphaEnabled
in interfaceOverlayWithCustomAlphaSupport
- Returns:
- true if custom alpha in use
-
setCustomAlpha
public void setCustomAlpha(int value)
Sets the custom alpha value (0: transparent, 255: opaque).- Specified by:
setCustomAlpha
in interfaceOverlayWithCustomAlphaSupport
- Parameters:
value
- the alpha value
-
getCustomAlpha
public int getCustomAlpha()
Returns the custom alpha value (0: transparent, 255: opaque).- Specified by:
getCustomAlpha
in interfaceOverlayWithCustomAlphaSupport
- Returns:
- the alpha value
-
applyAlpha
protected Color applyAlpha(Color c)
Applies the custom alpha value to the color if necessary.- Parameters:
c
- the color to update- Returns:
- the (potentially) updated color
-
doPaint
protected void doPaint(ObjectAnnotationPanel panel, Graphics g)
Paints the overlay.- Specified by:
doPaint
in classAbstractOverlay
- Parameters:
panel
- the owning panelg
- the graphics context
-
-