Package adams.gui.visualization.image
Class ReportObjectOverlay
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.visualization.image.AbstractReportBasedOverlayHelper
-
- adams.gui.visualization.image.ReportObjectOverlay
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,BoundingBoxFallbackSupporter
,Serializable
public class ReportObjectOverlay extends AbstractReportBasedOverlayHelper implements BoundingBoxFallbackSupporter
Ancestor for overlays that use object locations from a report.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected double
m_BoundingBoxFallbackRatio
the ratio used for determining whether to fall back from polygon on bbox.protected ColorProvider
m_ShapeColorProvider
the color provider to use when varying the shape colors.protected HashMap<Polygon,Color>
m_ShapeColors
the cached shape colors.protected boolean
m_VaryShapeColor
whether to vary the shape color.static String
PREFIX_DEFAULT
the default prefix.-
Fields inherited from class adams.gui.visualization.image.AbstractReportBasedOverlayHelper
m_AllObjects, m_Color, m_Colors, m_FilteredObjects, m_LabelAnchor, m_LabelFont, m_LabelFormat, m_LabelOffsetX, m_LabelOffsetY, m_Labels, m_Locations, m_ObjectLocationMappings, m_PredefinedLabels, m_Prefix, m_TypeColorProvider, m_TypeColors, m_TypeRegExp, m_TypeSuffix, m_UseColorsPerType
-
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 ReportObjectOverlay()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
boundingBoxFallbackRatioTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.boolean
determineLocations(Report report, LocatedObjectFilter filter)
Determines the locations of the objects.double
getBoundingBoxFallbackRatio()
Returns the ratio between shape area over bbox area.protected String
getDefaultPrefix()
Returns the default prefix for the objects in the report.Color
getShapeColor(Polygon poly)
Returns the shape color for the object.ColorProvider
getShapeColorProvider()
Returns the color provider to use when varying the shape colors.boolean
getVaryShapeColor()
Returns whether to vary the colors of the shapes.String
globalInfo()
Returns a string describing the object.boolean
hasShapeColor(Polygon poly)
Checks whether a shape color has been stored for the given object.void
reset()
Resets the scheme.void
setBoundingBoxFallbackRatio(double value)
Sets the ratio between shape area over bbox area.void
setPrefix(String value)
Sets the prefix to use for the objects in the report.void
setShapeColorProvider(ColorProvider value)
Sets the color provider to use when varying the shape colors.void
setVaryShapeColor(boolean value)
Sets whether to vary the colors of the shapes.String
shapeColorProviderTipText()
Returns the tip text for this property.String
varyShapeColorTipText()
Returns the tip text for this property.-
Methods inherited from class adams.gui.visualization.image.AbstractReportBasedOverlayHelper
applyFormatOptions, applyLabelFormat, calcStringDimenions, colorTipText, determineLocations, determineTypeSuffix, drawString, getAllObjects, getColor, getColor, getFilteredObjects, getLabel, getLabelAnchor, getLabelFont, getLabelFormat, getLabelOffsetX, getLabelOffsetY, getLocations, getObjectLocationMappings, getPredefinedLabels, getPrefix, getTypeColor, getTypeColorProvider, getTypeRegExp, getTypeSuffix, getUseColorsPerType, hasAllObjects, hasColor, hasFilteredObjects, hasLabel, hasLocations, hasObjectLocationMappings, hasTypeColor, labelAnchorTipText, labelFontTipText, labelFormatTipText, labelOffsetXTipText, labelOffsetYTipText, predefinedLabelsTipText, prefixTipText, setColor, setLabelAnchor, setLabelFont, setLabelFormat, setLabelOffsetX, setLabelOffsetY, setPredefinedLabels, setTypeColorProvider, setTypeRegExp, setTypeSuffix, setUseColorsPerType, typeColorProviderTipText, typeRegExpTipText, typeSuffixTipText, useColorsPerTypeTipText
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, 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
-
-
-
-
Field Detail
-
PREFIX_DEFAULT
public static final String PREFIX_DEFAULT
the default prefix.- See Also:
- Constant Field Values
-
m_VaryShapeColor
protected boolean m_VaryShapeColor
whether to vary the shape color.
-
m_ShapeColorProvider
protected ColorProvider m_ShapeColorProvider
the color provider to use when varying the shape colors.
-
m_BoundingBoxFallbackRatio
protected double m_BoundingBoxFallbackRatio
the ratio used for determining whether to fall back from polygon on bbox.
-
-
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 classAbstractReportBasedOverlayHelper
-
reset
public void reset()
Resets the scheme.- Overrides:
reset
in classAbstractReportBasedOverlayHelper
-
getDefaultPrefix
protected String getDefaultPrefix()
Returns the default prefix for the objects in the report.- Specified by:
getDefaultPrefix
in classAbstractReportBasedOverlayHelper
- Returns:
- the default
-
setPrefix
public void setPrefix(String value)
Sets the prefix to use for the objects in the report.- Overrides:
setPrefix
in classAbstractReportBasedOverlayHelper
- Parameters:
value
- the prefix
-
setVaryShapeColor
public void setVaryShapeColor(boolean value)
Sets whether to vary the colors of the shapes.- Parameters:
value
- true if to vary
-
getVaryShapeColor
public boolean getVaryShapeColor()
Returns whether to vary the colors of the shapes.- Returns:
- true if to vary
-
varyShapeColorTipText
public String varyShapeColorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setShapeColorProvider
public void setShapeColorProvider(ColorProvider value)
Sets the color provider to use when varying the shape colors.- Parameters:
value
- the provider
-
getShapeColorProvider
public ColorProvider getShapeColorProvider()
Returns the color provider to use when varying the shape colors.- Returns:
- the provider
-
shapeColorProviderTipText
public String shapeColorProviderTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setBoundingBoxFallbackRatio
public void setBoundingBoxFallbackRatio(double value)
Sets the ratio between shape area over bbox area. If below the bbox is used instead of the polygon.- Specified by:
setBoundingBoxFallbackRatio
in interfaceBoundingBoxFallbackSupporter
- Parameters:
value
- the ratio
-
getBoundingBoxFallbackRatio
public double getBoundingBoxFallbackRatio()
Returns the ratio between shape area over bbox area. If below the bbox is used instead of the polygon.- Specified by:
getBoundingBoxFallbackRatio
in interfaceBoundingBoxFallbackSupporter
- Returns:
- the ratio
-
boundingBoxFallbackRatioTipText
public String boundingBoxFallbackRatioTipText()
Returns the tip text for this property.- Specified by:
boundingBoxFallbackRatioTipText
in interfaceBoundingBoxFallbackSupporter
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
determineLocations
public boolean determineLocations(Report report, LocatedObjectFilter filter)
Determines the locations of the objects.- Specified by:
determineLocations
in classAbstractReportBasedOverlayHelper
- Parameters:
report
- the report to inspect- Returns:
- true if updated
-
hasShapeColor
public boolean hasShapeColor(Polygon poly)
Checks whether a shape color has been stored for the given object.- Parameters:
poly
- the object to check- Returns:
- true if custom color available
-
-