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 doublem_BoundingBoxFallbackRatiothe ratio used for determining whether to fall back from polygon on bbox.protected ColorProviderm_ShapeColorProviderthe color provider to use when varying the shape colors.protected HashMap<Polygon,Color>m_ShapeColorsthe cached shape colors.protected booleanm_VaryShapeColorwhether to vary the shape color.static StringPREFIX_DEFAULTthe 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 StringboundingBoxFallbackRatioTipText()Returns the tip text for this property.voiddefineOptions()Adds options to the internal list of options.booleandetermineLocations(Report report, LocatedObjectFilter filter)Determines the locations of the objects.doublegetBoundingBoxFallbackRatio()Returns the ratio between shape area over bbox area.protected StringgetDefaultPrefix()Returns the default prefix for the objects in the report.ColorgetShapeColor(Polygon poly)Returns the shape color for the object.ColorProvidergetShapeColorProvider()Returns the color provider to use when varying the shape colors.booleangetVaryShapeColor()Returns whether to vary the colors of the shapes.StringglobalInfo()Returns a string describing the object.booleanhasShapeColor(Polygon poly)Checks whether a shape color has been stored for the given object.voidreset()Resets the scheme.voidsetBoundingBoxFallbackRatio(double value)Sets the ratio between shape area over bbox area.voidsetPrefix(String value)Sets the prefix to use for the objects in the report.voidsetShapeColorProvider(ColorProvider value)Sets the color provider to use when varying the shape colors.voidsetVaryShapeColor(boolean value)Sets whether to vary the colors of the shapes.StringshapeColorProviderTipText()Returns the tip text for this property.StringvaryShapeColorTipText()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:
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 classAbstractReportBasedOverlayHelper
-
reset
public void reset()
Resets the scheme.- Overrides:
resetin classAbstractReportBasedOverlayHelper
-
getDefaultPrefix
protected String getDefaultPrefix()
Returns the default prefix for the objects in the report.- Specified by:
getDefaultPrefixin classAbstractReportBasedOverlayHelper- Returns:
- the default
-
setPrefix
public void setPrefix(String value)
Sets the prefix to use for the objects in the report.- Overrides:
setPrefixin 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:
setBoundingBoxFallbackRatioin 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:
getBoundingBoxFallbackRatioin interfaceBoundingBoxFallbackSupporter- Returns:
- the ratio
-
boundingBoxFallbackRatioTipText
public String boundingBoxFallbackRatioTipText()
Returns the tip text for this property.- Specified by:
boundingBoxFallbackRatioTipTextin 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:
determineLocationsin 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
-
-