Class ObjectAnnotations
- 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.ObjectAnnotations
-
- All Implemented Interfaces:
CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,ObjectPrefixHandler
,Overlay
,OverlayWithCustomAlphaSupport
,Serializable
public class ObjectAnnotations extends AbstractOverlay implements ObjectPrefixHandler, OverlayWithCustomAlphaSupport
Flexible overlay for object annotations.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected AnnotationCheck
m_AnnotationCheck
for detecting invalid annotations and displaying them differently.protected LocatedObjects
m_Annotations
the annotations.protected AnnotationCleaner[]
m_Cleaners
the cleaners to use.protected int
m_CustomAlpha
the custom alpha value to use.protected Map<Color,Color>
m_CustomAlphaColorCache
the color cache.protected boolean
m_CustomAlphaEnabled
whether a custom alpha is in use.protected gnu.trove.set.TIntSet
m_InvalidAnnotations
indices of invalid annotations.protected AnnotationColors
m_InvalidOutlineColor
the colorizers for the outline (invalid annotations).protected OutlinePlotter
m_InvalidOutlinePlotter
the outline plotters (invalid annotations).protected AnnotationColors
m_InvalidShapeColor
the colorizers for the shape annotations (invalid annotations).protected ShapePlotter
m_InvalidShapePlotter
the shape plotter for annotations (invalid annotations).protected AnnotationColors[]
m_LabelColors
the colorizers for the labels.protected LabelPlotter[]
m_LabelPlotters
the label plotters.protected AnnotationColors[]
m_OutlineColors
the colorizers for the outline.protected OutlinePlotter[]
m_OutlinePlotters
the outline plotters.protected String
m_Prefix
the prefix to use.protected AnnotationColors[]
m_ShapeColors
the colorizers for the shape.protected ShapePlotter[]
m_ShapePlotters
the shape plotters.-
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 ObjectAnnotations()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
annotationCheckTipText()
Returns the tip text for this property.void
annotationsChanged()
Hook method for when annotations change.protected Color
applyAlpha(Color c)
Applies the custom alpha value to the color if necessary.String
cleanersTipText()
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.AnnotationCheck
getAnnotationCheck()
Returns the check scheme to use for identifying invalid annotations.AnnotationCleaner[]
getCleaners()
Returns the cleaners for the annotations.int
getCustomAlpha()
Returns the custom alpha value (0: transparent, 255: opaque).AnnotationColors
getInvalidOutlineColor()
Returns the colorizer for the outline plotter of invalid annotations.OutlinePlotter
getInvalidOutlinePlotter()
Returns the plotter for the outlines of invalid annotations.AnnotationColors
getInvalidShapeColor()
Returns the colorizer for the shape plotter for invalid annotations.ShapePlotter
getInvalidShapePlotter()
Returns the plotter for the shapes of invalid annotations.AnnotationColors[]
getLabelColors()
Returns the colorizers for the label plotters.LabelPlotter[]
getLabelPlotters()
Returns the plotters for the labels.AnnotationColors[]
getOutlineColors()
Returns the colorizers for the outline plotters.OutlinePlotter[]
getOutlinePlotters()
Returns the plotters for the outlines.String
getPrefix()
Returns the field prefix used in the report.AnnotationColors[]
getShapeColors()
Returns the colorizers for the shape plotters.ShapePlotter[]
getShapePlotters()
Returns the plotters for the shapes.String
globalInfo()
Returns a string describing the object.protected void
initAnnotations(ObjectAnnotationPanel panel)
Initializes the annotations.protected void
initialize()
Initializes the members.String
invalidOutlineColorTipText()
Returns the tip text for this property.String
invalidOutlinePlotterTipText()
Returns the tip text for this property.String
invalidShapeColorTipText()
Returns the tip text for this property.String
invalidShapePlotterTipText()
Returns the tip text for this property.boolean
isCustomAlphaEnabled()
Returns whether a custom alpha value is in use for the overlay colors.String
labelColorsTipText()
Returns the tip text for this property.String
labelPlottersTipText()
Returns the tip text for this property.String
outlineColorsTipText()
Returns the tip text for this property.String
outlinePlottersTipText()
Returns the tip text for this property.String
prefixTipText()
Returns the tip text for this property.protected void
reset()
Resets the scheme.void
setAnnotationCheck(AnnotationCheck value)
Sets the check scheme to use for identifying invalid annotations.void
setCleaners(AnnotationCleaner[] value)
Sets the cleaners for the annotations.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
setInvalidOutlineColor(AnnotationColors value)
Sets the colorizer for the outline plotter of invalid annotations.void
setInvalidOutlinePlotter(OutlinePlotter value)
Sets the plotter for the outlines of invalid annotations.void
setInvalidShapeColor(AnnotationColors value)
Sets the colorizer for the shape plotter for invalid annotations.void
setInvalidShapePlotter(ShapePlotter value)
Sets the plotter for the shapes of invalid annotations.void
setLabelColors(AnnotationColors[] value)
Sets the colorizers for the label plotters.void
setLabelPlotters(LabelPlotter[] value)
Sets the plotters for the labels.void
setOutlineColors(AnnotationColors[] value)
Sets the colorizers for the outline plotters.void
setOutlinePlotters(OutlinePlotter[] value)
Sets the plotters for the outlines.void
setPrefix(String value)
Sets the field prefix used in the report.void
setShapeColors(AnnotationColors[] value)
Sets the colorizers for the shape plotters.void
setShapePlotters(ShapePlotter[] value)
Sets the plotters for the shapes.String
shapeColorsTipText()
Returns the tip text for this property.String
shapePlottersTipText()
Returns the tip text for this property.-
Methods inherited from class adams.gui.visualization.object.overlay.AbstractOverlay
cleanUp, enabledTipText, getEnabled, paint, setEnabled
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, 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
cleanUp, enabledTipText, getEnabled, paint, setEnabled
-
-
-
-
Field Detail
-
m_Prefix
protected String m_Prefix
the prefix to use.
-
m_Cleaners
protected AnnotationCleaner[] m_Cleaners
the cleaners to use.
-
m_ShapePlotters
protected ShapePlotter[] m_ShapePlotters
the shape plotters.
-
m_ShapeColors
protected AnnotationColors[] m_ShapeColors
the colorizers for the shape.
-
m_OutlinePlotters
protected OutlinePlotter[] m_OutlinePlotters
the outline plotters.
-
m_OutlineColors
protected AnnotationColors[] m_OutlineColors
the colorizers for the outline.
-
m_LabelPlotters
protected LabelPlotter[] m_LabelPlotters
the label plotters.
-
m_LabelColors
protected AnnotationColors[] m_LabelColors
the colorizers for the labels.
-
m_AnnotationCheck
protected AnnotationCheck m_AnnotationCheck
for detecting invalid annotations and displaying them differently.
-
m_InvalidShapePlotter
protected ShapePlotter m_InvalidShapePlotter
the shape plotter for annotations (invalid annotations).
-
m_InvalidShapeColor
protected AnnotationColors m_InvalidShapeColor
the colorizers for the shape annotations (invalid annotations).
-
m_InvalidOutlinePlotter
protected OutlinePlotter m_InvalidOutlinePlotter
the outline plotters (invalid annotations).
-
m_InvalidOutlineColor
protected AnnotationColors m_InvalidOutlineColor
the colorizers for the outline (invalid annotations).
-
m_Annotations
protected transient LocatedObjects m_Annotations
the annotations.
-
m_InvalidAnnotations
protected transient gnu.trove.set.TIntSet m_InvalidAnnotations
indices of invalid annotations.
-
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
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classAbstractOptionHandler
-
reset
protected void reset()
Resets the scheme.- Overrides:
reset
in classAbstractOptionHandler
-
setPrefix
public void setPrefix(String value)
Sets the field prefix used in the report.- Specified by:
setPrefix
in interfaceObjectPrefixHandler
- Parameters:
value
- the field prefix
-
getPrefix
public String getPrefix()
Returns the field prefix used in the report.- Specified by:
getPrefix
in interfaceObjectPrefixHandler
- Returns:
- the field prefix
-
prefixTipText
public String prefixTipText()
Returns the tip text for this property.- Specified by:
prefixTipText
in interfaceObjectPrefixHandler
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setCleaners
public void setCleaners(AnnotationCleaner[] value)
Sets the cleaners for the annotations.- Parameters:
value
- the cleaners
-
getCleaners
public AnnotationCleaner[] getCleaners()
Returns the cleaners for the annotations.- Returns:
- the cleaners
-
cleanersTipText
public String cleanersTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setShapeColors
public void setShapeColors(AnnotationColors[] value)
Sets the colorizers for the shape plotters.- Parameters:
value
- the colorizers
-
getShapeColors
public AnnotationColors[] getShapeColors()
Returns the colorizers for the shape plotters.- Returns:
- the colorizers
-
shapeColorsTipText
public String shapeColorsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setShapePlotters
public void setShapePlotters(ShapePlotter[] value)
Sets the plotters for the shapes.- Parameters:
value
- the plotters
-
getShapePlotters
public ShapePlotter[] getShapePlotters()
Returns the plotters for the shapes.- Returns:
- the plotters
-
shapePlottersTipText
public String shapePlottersTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setOutlineColors
public void setOutlineColors(AnnotationColors[] value)
Sets the colorizers for the outline plotters.- Parameters:
value
- the colorizers
-
getOutlineColors
public AnnotationColors[] getOutlineColors()
Returns the colorizers for the outline plotters.- Returns:
- the colorizers
-
outlineColorsTipText
public String outlineColorsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setOutlinePlotters
public void setOutlinePlotters(OutlinePlotter[] value)
Sets the plotters for the outlines.- Parameters:
value
- the plotters
-
getOutlinePlotters
public OutlinePlotter[] getOutlinePlotters()
Returns the plotters for the outlines.- Returns:
- the plotters
-
outlinePlottersTipText
public String outlinePlottersTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setLabelColors
public void setLabelColors(AnnotationColors[] value)
Sets the colorizers for the label plotters.- Parameters:
value
- the colorizers
-
getLabelColors
public AnnotationColors[] getLabelColors()
Returns the colorizers for the label plotters.- Returns:
- the colorizers
-
labelColorsTipText
public String labelColorsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setLabelPlotters
public void setLabelPlotters(LabelPlotter[] value)
Sets the plotters for the labels.- Parameters:
value
- the plotters
-
getLabelPlotters
public LabelPlotter[] getLabelPlotters()
Returns the plotters for the labels.- Returns:
- the plotters
-
labelPlottersTipText
public String labelPlottersTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setAnnotationCheck
public void setAnnotationCheck(AnnotationCheck value)
Sets the check scheme to use for identifying invalid annotations.- Parameters:
value
- the check
-
getAnnotationCheck
public AnnotationCheck getAnnotationCheck()
Returns the check scheme to use for identifying invalid annotations.- Returns:
- the check
-
annotationCheckTipText
public String annotationCheckTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setInvalidShapeColor
public void setInvalidShapeColor(AnnotationColors value)
Sets the colorizer for the shape plotter for invalid annotations.- Parameters:
value
- the colorizer
-
getInvalidShapeColor
public AnnotationColors getInvalidShapeColor()
Returns the colorizer for the shape plotter for invalid annotations.- Returns:
- the colorizer
-
invalidShapeColorTipText
public String invalidShapeColorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setInvalidShapePlotter
public void setInvalidShapePlotter(ShapePlotter value)
Sets the plotter for the shapes of invalid annotations.- Parameters:
value
- the plotter
-
getInvalidShapePlotter
public ShapePlotter getInvalidShapePlotter()
Returns the plotter for the shapes of invalid annotations.- Returns:
- the plotter
-
invalidShapePlotterTipText
public String invalidShapePlotterTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setInvalidOutlineColor
public void setInvalidOutlineColor(AnnotationColors value)
Sets the colorizer for the outline plotter of invalid annotations.- Parameters:
value
- the colorizer
-
getInvalidOutlineColor
public AnnotationColors getInvalidOutlineColor()
Returns the colorizer for the outline plotter of invalid annotations.- Returns:
- the colorizer
-
invalidOutlineColorTipText
public String invalidOutlineColorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setInvalidOutlinePlotter
public void setInvalidOutlinePlotter(OutlinePlotter value)
Sets the plotter for the outlines of invalid annotations.- Parameters:
value
- the plotter
-
getInvalidOutlinePlotter
public OutlinePlotter getInvalidOutlinePlotter()
Returns the plotter for the outlines of invalid annotations.- Returns:
- the plotter
-
invalidOutlinePlotterTipText
public String invalidOutlinePlotterTipText()
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
-
annotationsChanged
public void annotationsChanged()
Hook method for when annotations change.- Specified by:
annotationsChanged
in interfaceOverlay
- Overrides:
annotationsChanged
in classAbstractOverlay
-
initAnnotations
protected void initAnnotations(ObjectAnnotationPanel panel)
Initializes the annotations.- Parameters:
panel
- the context
-
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
-
-