Package adams.flow.transformer.draw
Class ObjectCentersFromReport
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.transformer.draw.AbstractDrawOperation
-
- adams.flow.transformer.draw.AbstractDrawObjectsFromReport
-
- adams.flow.transformer.draw.ObjectCentersFromReport
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,SizeOfHandler
,Serializable
public class ObjectCentersFromReport extends AbstractDrawObjectsFromReport
Displays the centers of objects in the image, using data from the attached report.
Suffixes:
.x
.y
.width
.height
Optionally, if type information is available per object, the locations can be displayed in distinct colors per type. The type itself can be displayed as well.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-prefix <java.lang.String> (property: prefix) The prefix of fields in the report to identify as object location, eg 'Object. '. default: Object.
-color <java.awt.Color> (property: color) The color to use for the objects. default: #ff0000
-use-colors-per-type <boolean> (property: useColorsPerType) If enabled, individual colors per type are used. default: false
-type-color-provider <adams.gui.visualization.core.ColorProvider> (property: typeColorProvider) The color provider to use for the various types. default: adams.gui.visualization.core.DefaultColorProvider
-type-suffix <java.lang.String> (property: typeSuffix) The suffix of fields in the report to identify the type. default: .type
-label-format <java.lang.String> (property: labelFormat) The label format string to use for the rectangles; '#' for index, '@' for type and '$' for short type (type suffix must be defined for '@' and '$' ); for instance: '# @'. default: #
-label-font <java.awt.Font> (property: labelFont) The font to use for the labels. default: Display-PLAIN-14
-predefined-labels <adams.core.base.BaseString> [-predefined-labels ...] (property: predefinedLabels) The predefined labels to use for setting up the colors; avoids constants changing in color pallet. default:
-diameter <int> (property: diameter) The diameter of the circle that is drawn; < 1 to use the rectangle's dimensions to draw an ellipse. default: 10 minimum: -1
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected double
m_Diameter
the diameter of the circle.-
Fields inherited from class adams.flow.transformer.draw.AbstractDrawObjectsFromReport
m_Overlays
-
Fields inherited from class adams.flow.transformer.draw.AbstractDrawOperation
m_Owner
-
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 ObjectCentersFromReport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.String
diameterTipText()
Returns the tip text for this property.protected String
doDraw(BufferedImageContainer image, List<Polygon> locations)
Performs the actual drawing of the objects.double
getDiameter()
Returns the diameter to use for drawing the circleString
globalInfo()
Returns a string describing the object.void
setDiameter(double value)
Sets the diameter to use for drawing the circle-
Methods inherited from class adams.flow.transformer.draw.AbstractDrawObjectsFromReport
colorTipText, doDraw, getColor, getLabelAnchor, getLabelFont, getLabelFormat, getLabelOffsetX, getLabelOffsetY, getPredefinedLabels, getPrefix, getTypeColorProvider, getTypeRegExp, getTypeSuffix, getUseColorsPerType, initialize, labelAnchorTipText, labelFontTipText, labelFormatTipText, labelOffsetXTipText, labelOffsetYTipText, predefinedLabelsTipText, prefixTipText, setColor, setLabelAnchor, setLabelFont, setLabelFormat, setLabelOffsetX, setLabelOffsetY, setPredefinedLabels, setPrefix, setTypeColorProvider, setTypeRegExp, setTypeSuffix, setUseColorsPerType, typeColorProviderTipText, typeRegExpTipText, typeSuffixTipText, useColorsPerTypeTipText
-
Methods inherited from class adams.flow.transformer.draw.AbstractDrawOperation
check, draw, getOwner, getQuickInfo, setOwner
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, 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.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
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 classAbstractDrawObjectsFromReport
-
setDiameter
public void setDiameter(double value)
Sets the diameter to use for drawing the circle- Parameters:
value
- the diameter, -1 if using the rectangle's dimensions, (0-1) for fraction of bbox width
-
getDiameter
public double getDiameter()
Returns the diameter to use for drawing the circle- Returns:
- the diameter, -1 if using the rectangle's dimensions, (0-1) for fraction of bbox width
-
diameterTipText
public String diameterTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
doDraw
protected String doDraw(BufferedImageContainer image, List<Polygon> locations)
Performs the actual drawing of the objects.- Specified by:
doDraw
in classAbstractDrawObjectsFromReport
- Parameters:
image
- the imagelocations
- the locations to paint- Returns:
- null if OK, otherwise error message
-
-