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 AnnotationCheckm_AnnotationCheckfor detecting invalid annotations and displaying them differently.protected LocatedObjectsm_Annotationsthe annotations.protected AnnotationCleaner[]m_Cleanersthe cleaners to use.protected intm_CustomAlphathe custom alpha value to use.protected Map<Color,Color>m_CustomAlphaColorCachethe color cache.protected booleanm_CustomAlphaEnabledwhether a custom alpha is in use.protected gnu.trove.set.TIntSetm_InvalidAnnotationsindices of invalid annotations.protected AnnotationColorsm_InvalidOutlineColorthe colorizers for the outline (invalid annotations).protected OutlinePlotterm_InvalidOutlinePlotterthe outline plotters (invalid annotations).protected AnnotationColorsm_InvalidShapeColorthe colorizers for the shape annotations (invalid annotations).protected ShapePlotterm_InvalidShapePlotterthe shape plotter for annotations (invalid annotations).protected AnnotationColors[]m_LabelColorsthe colorizers for the labels.protected LabelPlotter[]m_LabelPlottersthe label plotters.protected AnnotationColors[]m_OutlineColorsthe colorizers for the outline.protected OutlinePlotter[]m_OutlinePlottersthe outline plotters.protected Stringm_Prefixthe prefix to use.protected AnnotationColors[]m_ShapeColorsthe colorizers for the shape.protected ShapePlotter[]m_ShapePlottersthe 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 StringannotationCheckTipText()Returns the tip text for this property.voidannotationsChanged()Hook method for when annotations change.protected ColorapplyAlpha(Color c)Applies the custom alpha value to the color if necessary.StringcleanersTipText()Returns the tip text for this property.voiddefineOptions()Adds options to the internal list of options.protected voiddoPaint(ObjectAnnotationPanel panel, Graphics g)Paints the overlay.AnnotationCheckgetAnnotationCheck()Returns the check scheme to use for identifying invalid annotations.AnnotationCleaner[]getCleaners()Returns the cleaners for the annotations.intgetCustomAlpha()Returns the custom alpha value (0: transparent, 255: opaque).AnnotationColorsgetInvalidOutlineColor()Returns the colorizer for the outline plotter of invalid annotations.OutlinePlottergetInvalidOutlinePlotter()Returns the plotter for the outlines of invalid annotations.AnnotationColorsgetInvalidShapeColor()Returns the colorizer for the shape plotter for invalid annotations.ShapePlottergetInvalidShapePlotter()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.StringgetPrefix()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.StringglobalInfo()Returns a string describing the object.protected voidinitAnnotations(ObjectAnnotationPanel panel)Initializes the annotations.protected voidinitialize()Initializes the members.StringinvalidOutlineColorTipText()Returns the tip text for this property.StringinvalidOutlinePlotterTipText()Returns the tip text for this property.StringinvalidShapeColorTipText()Returns the tip text for this property.StringinvalidShapePlotterTipText()Returns the tip text for this property.booleanisCustomAlphaEnabled()Returns whether a custom alpha value is in use for the overlay colors.StringlabelColorsTipText()Returns the tip text for this property.StringlabelPlottersTipText()Returns the tip text for this property.StringoutlineColorsTipText()Returns the tip text for this property.StringoutlinePlottersTipText()Returns the tip text for this property.StringprefixTipText()Returns the tip text for this property.protected voidreset()Resets the scheme.voidsetAnnotationCheck(AnnotationCheck value)Sets the check scheme to use for identifying invalid annotations.voidsetCleaners(AnnotationCleaner[] value)Sets the cleaners for the annotations.voidsetCustomAlpha(int value)Sets the custom alpha value (0: transparent, 255: opaque).voidsetCustomAlphaEnabled(boolean value)Sets whether to use a custom alpha value for the overlay colors.voidsetInvalidOutlineColor(AnnotationColors value)Sets the colorizer for the outline plotter of invalid annotations.voidsetInvalidOutlinePlotter(OutlinePlotter value)Sets the plotter for the outlines of invalid annotations.voidsetInvalidShapeColor(AnnotationColors value)Sets the colorizer for the shape plotter for invalid annotations.voidsetInvalidShapePlotter(ShapePlotter value)Sets the plotter for the shapes of invalid annotations.voidsetLabelColors(AnnotationColors[] value)Sets the colorizers for the label plotters.voidsetLabelPlotters(LabelPlotter[] value)Sets the plotters for the labels.voidsetOutlineColors(AnnotationColors[] value)Sets the colorizers for the outline plotters.voidsetOutlinePlotters(OutlinePlotter[] value)Sets the plotters for the outlines.voidsetPrefix(String value)Sets the field prefix used in the report.voidsetShapeColors(AnnotationColors[] value)Sets the colorizers for the shape plotters.voidsetShapePlotters(ShapePlotter[] value)Sets the plotters for the shapes.StringshapeColorsTipText()Returns the tip text for this property.StringshapePlottersTipText()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:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractOverlay
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initializein classAbstractOptionHandler
-
reset
protected void reset()
Resets the scheme.- Overrides:
resetin classAbstractOptionHandler
-
setPrefix
public void setPrefix(String value)
Sets the field prefix used in the report.- Specified by:
setPrefixin interfaceObjectPrefixHandler- Parameters:
value- the field prefix
-
getPrefix
public String getPrefix()
Returns the field prefix used in the report.- Specified by:
getPrefixin interfaceObjectPrefixHandler- Returns:
- the field prefix
-
prefixTipText
public String prefixTipText()
Returns the tip text for this property.- Specified by:
prefixTipTextin 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:
setCustomAlphaEnabledin 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:
isCustomAlphaEnabledin 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:
setCustomAlphain interfaceOverlayWithCustomAlphaSupport- Parameters:
value- the alpha value
-
getCustomAlpha
public int getCustomAlpha()
Returns the custom alpha value (0: transparent, 255: opaque).- Specified by:
getCustomAlphain interfaceOverlayWithCustomAlphaSupport- Returns:
- the alpha value
-
annotationsChanged
public void annotationsChanged()
Hook method for when annotations change.- Specified by:
annotationsChangedin interfaceOverlay- Overrides:
annotationsChangedin 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:
doPaintin classAbstractOverlay- Parameters:
panel- the owning panelg- the graphics context
-
-