Class 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 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_Prefix

        protected String m_Prefix
        the prefix 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.
    • Constructor Detail

      • ObjectAnnotationsHandler

        public ObjectAnnotationsHandler()
    • Method Detail

      • 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:
        setPrefix in interface ObjectPrefixHandler
        Parameters:
        value - the field prefix
      • prefixTipText

        public String prefixTipText()
        Returns the tip text for this property.
        Specified by:
        prefixTipText in interface ObjectPrefixHandler
        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:
        getExtensions in interface ContentHandler
        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 panel
        file - the image file
        Returns:
        the report, null if failed to load report data or none available