Package adams.gui.tools.previewbrowser
Class ObjectAnnotationsHandler
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.tools.previewbrowser.AbstractContentHandler
-
- adams.gui.tools.previewbrowser.ObjectAnnotationsHandler
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,SizeOfHandler,ObjectPrefixHandler,ContentHandler,Serializable
public class ObjectAnnotationsHandler extends AbstractContentHandler implements ObjectPrefixHandler
Overlays the annotations onto the image.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-image-reader <adams.data.io.input.AbstractImageReader> (property: imageReader) The image reader to use. default: adams.data.io.input.JAIImageReader
-file-suffix <java.lang.String> (property: fileSuffix) The forced suffix (incl ext) to append to the image name for generating the meta-data file name. default:
-reader <adams.data.io.input.AbstractReportReader> (property: reader) The reader setup to use for reading the object locations from the spreadsheet. default: adams.data.io.input.ObjectLocationsSpreadSheetReader -reader \"adams.data.io.input.CsvSpreadSheetReader -data-row-type adams.data.spreadsheet.DenseDataRow -spreadsheet-type adams.data.spreadsheet.DefaultSpreadSheet\" -row-finder adams.data.spreadsheet.rowfinder.AllFinder -col-left x0 -col-top y0 -col-right x1 -col-bottom y1 -col-type label_str
-prefix <java.lang.String> (property: prefix) The report field prefix used for objects. default: Object.
-cleaner <adams.gui.visualization.object.objectannotations.cleaning.AnnotationCleaner> [-cleaner ...] (property: cleaners) The cleaners to apply to the annotations. default:
-shape-plotter <adams.gui.visualization.object.objectannotations.shape.ShapePlotter> [-shape-plotter ...] (property: shapePlotters) The plotters to use for drawing the shapes. default:
-shape-color <adams.gui.visualization.object.objectannotations.colors.AnnotationColors> [-shape-color ...] (property: shapeColors) The colorizers for the corresponding shape plotters. default:
-outline-plotter <adams.gui.visualization.object.objectannotations.outline.OutlinePlotter> [-outline-plotter ...] (property: outlinePlotters) The plotters to use for drawing the outlines. default: adams.gui.visualization.object.objectannotations.outline.RectangleOutline
-outline-color <adams.gui.visualization.object.objectannotations.colors.AnnotationColors> [-outline-color ...] (property: outlineColors) The colorizers for the corresponding outline plotters. default: adams.gui.visualization.object.objectannotations.colors.FixedColor
-label-plotter <adams.gui.visualization.object.objectannotations.label.LabelPlotter> [-label-plotter ...] (property: labelPlotters) The plotters to use for drawing the labels. default:
-label-color <adams.gui.visualization.object.objectannotations.colors.AnnotationColors> [-label-color ...] (property: labelColors) The colorizers for the corresponding label plotters. default:
-show-object-panel <boolean> (property: showObjectPanel) If enabled, the panel for selecting located objects is being displayed. default: false
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected AnnotationCleaner[]m_Cleanersthe cleaners to use.protected Stringm_FileSuffixthe file suffix to force (incl extension).protected ImageReaderm_ImageReaderthe image reader to use.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 AbstractReportReaderm_Readerthe reader to use.protected AnnotationColors[]m_ShapeColorsthe colorizers for the shape.protected ShapePlotter[]m_ShapePlottersthe shape plotters.protected booleanm_ShowObjectPanelwhether to show the located object panel.-
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 ObjectAnnotationsHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringcleanersTipText()Returns the tip text for this property.PreviewPanelcreatePreview(File file)Creates the actual view.voiddefineOptions()Adds options to the internal list of options.StringfileSuffixTipText()Returns the tip text for this property.AnnotationCleaner[]getCleaners()Returns the cleaners for the annotations.protected ImageReadergetDefaultImageReader()Returns the default image reader.protected AbstractReportReadergetDefaultReader()Returns the default reader.String[]getExtensions()Returns the list of extensions (without dot) that this handler can take care of.StringgetFileSuffix()Returns the forced suffix (incl ext) to append to the image name for generating the meta-data file name.ImageReadergetImageReader()Returns the image reader to use.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.AbstractReportReadergetReader()Returns the reader setup to use for reading the object locations from the spreadsheet.AnnotationColors[]getShapeColors()Returns the colorizers for the shape plotters.ShapePlotter[]getShapePlotters()Returns the plotters for the shapes.booleangetShowObjectPanel()Returns whether to show the panel with the located objects.StringglobalInfo()Returns a string describing the object.StringimageReaderTipText()Returns the tip text for this property.StringlabelColorsTipText()Returns the tip text for this property.StringlabelPlottersTipText()Returns the tip text for this property.protected ReportloadAnnotations(ImagePanel panel, File file)Loads the report associated with the image.StringoutlineColorsTipText()Returns the tip text for this property.StringoutlinePlottersTipText()Returns the tip text for this property.StringprefixTipText()Returns the tip text for this property.StringreaderTipText()Returns the tip text for this property.PreviewPanelreusePreview(File file, PreviewPanel previewPanel)Reuses the last preview, if possible.voidsetCleaners(AnnotationCleaner[] value)Sets the cleaners for the annotations.voidsetFileSuffix(String value)Sets the forced suffix (incl ext) to append to the image name for generating the meta-data file name.voidsetImageReader(ImageReader value)Sets the image reader to use.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.voidsetReader(AbstractReportReader value)Sets the reader setup to use for reading the object locations from the spreadsheet.voidsetShapeColors(AnnotationColors[] value)Sets the colorizers for the shape plotters.voidsetShapePlotters(ShapePlotter[] value)Sets the plotters for the shapes.voidsetShowObjectPanel(boolean value)Sets whether to show the panel with the located panels.StringshapeColorsTipText()Returns the tip text for this property.StringshapePlottersTipText()Returns the tip text for this property.StringshowObjectPanelTipText()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
-
m_FileSuffix
protected String m_FileSuffix
the file suffix to force (incl extension).
-
m_ImageReader
protected ImageReader m_ImageReader
the image reader to use.
-
m_Reader
protected AbstractReportReader m_Reader
the reader to use.
-
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_ShowObjectPanel
protected boolean m_ShowObjectPanel
whether to show the located object panel.
-
-
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 classAbstractOptionHandler
-
getDefaultImageReader
protected ImageReader getDefaultImageReader()
Returns the default image reader.- Returns:
- the default
-
setImageReader
public void setImageReader(ImageReader value)
Sets the image reader to use.- Parameters:
value- the reader
-
getImageReader
public ImageReader getImageReader()
Returns the image reader to use.- Returns:
- the reader
-
imageReaderTipText
public String imageReaderTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getDefaultReader
protected AbstractReportReader getDefaultReader()
Returns the default reader.- Returns:
- the reader
-
setFileSuffix
public void setFileSuffix(String value)
Sets the forced suffix (incl ext) to append to the image name for generating the meta-data file name.- Parameters:
value- the suffix
-
getFileSuffix
public String getFileSuffix()
Returns the forced suffix (incl ext) to append to the image name for generating the meta-data file name.- Returns:
- the suffix
-
fileSuffixTipText
public String fileSuffixTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setReader
public void setReader(AbstractReportReader value)
Sets the reader setup to use for reading the object locations from the spreadsheet.- Parameters:
value- the reader
-
getReader
public AbstractReportReader getReader()
Returns the reader setup to use for reading the object locations from the spreadsheet.- Returns:
- the reader
-
readerTipText
public String readerTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
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.
-
setShowObjectPanel
public void setShowObjectPanel(boolean value)
Sets whether to show the panel with the located panels.- Parameters:
value- true if to show
-
getShowObjectPanel
public boolean getShowObjectPanel()
Returns whether to show the panel with the located objects.- Returns:
- true if to show
-
showObjectPanelTipText
public String showObjectPanelTipText()
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.- Specified by:
getExtensionsin interfaceContentHandler- Returns:
- the list of extensions (no dot)
-
loadAnnotations
protected Report loadAnnotations(ImagePanel panel, File file)
Loads the report associated with the image.- Parameters:
panel- the context panelfile- the image file- Returns:
- the report, null if failed to load report data or none available
-
createPreview
public PreviewPanel createPreview(File file)
Creates the actual view.- Specified by:
createPreviewin interfaceContentHandler- Specified by:
createPreviewin 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:
reusePreviewin interfaceContentHandler- Overrides:
reusePreviewin classAbstractContentHandler- Parameters:
file- the file to create the view for- Returns:
- the view
-
-