Package adams.gui.tools.previewbrowser
Class AnnotationsAndPredictionsFromReport
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.tools.previewbrowser.AbstractContentHandler
-
- adams.gui.tools.previewbrowser.AnnotationsAndPredictionsFromReport
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,ContentHandler
,Serializable
public class AnnotationsAndPredictionsFromReport extends AbstractContentHandler
Displays the following image types with an overlay for the annotations and predictions stored in the report with the same name: jpg,bmp,gif,png,wbmp,jpeg
Annotations have to have the prefix 'Object.' and predictions 'Prediction.'.
The color for annotations is red and for predictions green.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static Color
COLOR_ANNOTATIONS
the color for the annotations.static Color
COLOR_PREDICTIONS
the color for the predictions.protected Font
m_LabelFont
the label font.protected String
m_LabelFormat
the label for the rectangles.protected String
m_Prefix
the prefix for the objects in the report.protected BaseRegExp
m_TypeRegExp
the regular expression for the types to draw.protected String
m_TypeSuffix
the suffix for the type.static String
PREFIX_ANNOTATIONS
the prefix for the annoations.static String
PREFIX_PREDICTIONS
the prefix for the predictions.-
Fields inherited from class adams.gui.tools.previewbrowser.AbstractContentHandler
m_Relation
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
Fields inherited from interface adams.gui.tools.previewbrowser.ContentHandler
MATCH_ALL
-
-
Constructor Summary
Constructors Constructor Description AnnotationsAndPredictionsFromReport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PreviewPanel
createPreview(File file)
Creates the actual view.void
defineOptions()
Adds options to the internal list of options.String[]
getExtensions()
Returns the list of extensions (without dot) that this handler can take care of.Font
getLabelFont()
Returns the label font.String
getLabelFormat()
Returns the label format.String
getPrefix()
Returns the prefix to use for the objects in the report.BaseRegExp
getTypeRegExp()
Returns the regular expression that the types must match in order to get drawn.String
getTypeSuffix()
Returns the suffix to use for the types.String
globalInfo()
Returns a string describing the object.String
labelFontTipText()
Returns the tip text for this property.String
labelFormatTipText()
Returns the tip text for this property.protected Report
loadReport(File file)
Loads the report associated with the image.String
prefixTipText()
Returns the tip text for this property.PreviewPanel
reusePreview(File file, PreviewPanel previewPanel)
Reuses the last preview, if possible.void
setLabelFont(Font value)
Sets the label font.void
setLabelFormat(String value)
Sets the label format.void
setPrefix(String value)
Sets the prefix to use for the objects in the report.void
setTypeRegExp(BaseRegExp value)
Sets the regular expression that the types must match in order to get drawn.void
setTypeSuffix(String value)
Sets the suffix to use for the types.protected String
toString(Color color)
String
typeRegExpTipText()
Returns the tip text for this property.String
typeSuffixTipText()
Returns the tip text for this property.-
Methods inherited from class adams.gui.tools.previewbrowser.AbstractContentHandler
checkFile, getHandlers, getHandlersForFile, getHandlersForFile, getPreview, getRelation, hasHandler, hasHandler
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, 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.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_ANNOTATIONS
public static final String PREFIX_ANNOTATIONS
the prefix for the annoations.- See Also:
- Constant Field Values
-
PREFIX_PREDICTIONS
public static final String PREFIX_PREDICTIONS
the prefix for the predictions.- See Also:
- Constant Field Values
-
COLOR_ANNOTATIONS
public static final Color COLOR_ANNOTATIONS
the color for the annotations.
-
COLOR_PREDICTIONS
public static final Color COLOR_PREDICTIONS
the color for the predictions.
-
m_Prefix
protected String m_Prefix
the prefix for the objects in the report.
-
m_TypeSuffix
protected String m_TypeSuffix
the suffix for the type.
-
m_TypeRegExp
protected BaseRegExp m_TypeRegExp
the regular expression for the types to draw.
-
m_LabelFormat
protected String m_LabelFormat
the label for the rectangles.
-
m_LabelFont
protected Font m_LabelFont
the label font.
-
-
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 classAbstractOptionHandler
-
setPrefix
public void setPrefix(String value)
Sets the prefix to use for the objects in the report.- Parameters:
value
- the prefix
-
getPrefix
public String getPrefix()
Returns the prefix to use for the objects in the report.- Returns:
- the prefix
-
prefixTipText
public String prefixTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setTypeSuffix
public void setTypeSuffix(String value)
Sets the suffix to use for the types.- Parameters:
value
- the suffix
-
getTypeSuffix
public String getTypeSuffix()
Returns the suffix to use for the types.- Returns:
- the suffix
-
typeSuffixTipText
public String typeSuffixTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setTypeRegExp
public void setTypeRegExp(BaseRegExp value)
Sets the regular expression that the types must match in order to get drawn.- Parameters:
value
- the expression
-
getTypeRegExp
public BaseRegExp getTypeRegExp()
Returns the regular expression that the types must match in order to get drawn.- Returns:
- the expression
-
typeRegExpTipText
public String typeRegExpTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setLabelFormat
public void setLabelFormat(String value)
Sets the label format.- Parameters:
value
- the label format
-
getLabelFormat
public String getLabelFormat()
Returns the label format.- Returns:
- the label format
-
labelFormatTipText
public String labelFormatTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setLabelFont
public void setLabelFont(Font value)
Sets the label font.- Parameters:
value
- the label font
-
getLabelFont
public Font getLabelFont()
Returns the label font.- Returns:
- the label font
-
labelFontTipText
public String labelFontTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getExtensions
public String[] getExtensions()
Returns the list of extensions (without dot) that this handler can take care of.- Returns:
- the list of extensions (no dot)
-
loadReport
protected Report loadReport(File file)
Loads the report associated with the image.- Parameters:
file
- the image file- Returns:
- the report, null if none available or failed to load
-
createPreview
public PreviewPanel createPreview(File file)
Creates the actual view.- Specified by:
createPreview
in interfaceContentHandler
- Specified by:
createPreview
in classAbstractContentHandler
- Parameters:
file
- the file to create the view for- Returns:
- the view
-
reusePreview
public PreviewPanel reusePreview(File file, PreviewPanel previewPanel)
Reuses the last preview, if possible.- Specified by:
reusePreview
in interfaceContentHandler
- Overrides:
reusePreview
in classAbstractContentHandler
- Parameters:
file
- the file to create the view for- Returns:
- the view
-
-