Class ImageAnnotator.AnnotatorPanel

    • Field Detail

      • m_Prefix

        protected String m_Prefix
        the prefix to use in the report.
      • m_Suffix

        protected String m_Suffix
        the suffix to use for the labels.
      • m_Labels

        protected BaseString[] m_Labels
        the labels.
      • m_SelectionProcessor

        protected SelectionProcessor m_SelectionProcessor
        the selection processor to apply.
      • m_SelectionShapePainter

        protected SelectionShapePainter m_SelectionShapePainter
        the painter for the selection shape.
      • m_Overlay

        protected ImageOverlay m_Overlay
        the overlay to use for highlighting the objects.
      • m_Zoom

        protected double m_Zoom
        the zoom level.
      • m_InteractionLoggingFilter

        protected InteractionLoggingFilter m_InteractionLoggingFilter
        the interaction logger to use.
      • m_ButtonLabels

        protected BaseToggleButton[] m_ButtonLabels
        the label buttons.
      • m_ButtonReset

        protected BaseButton m_ButtonReset
        the reset button.
      • m_ButtonGroup

        protected ButtonGroup m_ButtonGroup
        the button group.
      • m_PanelImage

        protected ImagePanel m_PanelImage
        the image panel.
      • m_CurrentLabel

        protected String m_CurrentLabel
        the current label.
      • m_ReportBackup

        protected Report m_ReportBackup
        the backup of the report.
      • m_Objects

        protected LocatedObjects m_Objects
        the rectangles of the located objects.
      • m_CurrentScale

        protected Double m_CurrentScale
        the current scale.
      • m_ActualSelectionProcessor

        protected SelectionProcessor m_ActualSelectionProcessor
        the actual selection processor.
      • m_ActualOverlay

        protected ImageOverlay m_ActualOverlay
        the actual overlay to use for highlighting the objects.
    • Constructor Detail

      • AnnotatorPanel

        public AnnotatorPanel​(String prefix,
                              String suffix,
                              BaseString[] labels,
                              SelectionProcessor selectionProcessor,
                              SelectionShapePainter selectionShapePainter,
                              ImageOverlay overlay,
                              double zoom,
                              InteractionLoggingFilter interactionLoggingFilter)
        Initializes the panel.
        Parameters:
        prefix - the prefix in the report
        suffix - the suffix in the report
        labels - the labels
        selectionProcessor - the selection process
        selectionShapePainter - the painter
        overlay - the overlay
        zoom - the zoom
        interactionLoggingFilter - the interaction logger
    • Method Detail

      • initialize

        protected void initialize()
        Initializes the members.
        Overrides:
        initialize in class BasePanel
      • initGUI

        protected void initGUI()
        Initializes the widgets.
        Overrides:
        initGUI in class BasePanel
      • finishInit

        protected void finishInit()
        finishes the initialization.
        Overrides:
        finishInit in class BasePanel
      • getImagePanel

        public ImagePanel getImagePanel()
        Returns the underlying image panel.
        Returns:
        the panel
      • updateLabelButtons

        protected void updateLabelButtons()
        Updates the colors of the label button.
      • setCurrentLabel

        protected void setCurrentLabel​(String label)
        Sets the label to use from now on.
        Parameters:
        label - the label, null if to unset
      • notifyLabelChange

        protected void notifyLabelChange​(String label)
        Sends notifications that the label has changed.
        Parameters:
        label - the new label
      • getCurrentLabel

        public String getCurrentLabel()
        Returns the currently used label.
        Returns:
        the label
      • resetLabels

        protected void resetLabels()
        Resets all the labels.
      • preselectLabel

        public void preselectLabel​(String label)
        Pre-selects the label.
        Parameters:
        label - the label to use, ignored if null
      • getMainDividerLocation

        public int getMainDividerLocation()
        Returns the divider location between image and properties.
        Returns:
        the position
      • setMainDividerLocation

        public void setMainDividerLocation​(int value)
        Sets the divider location between image and properties.
        Parameters:
        value - the position
      • setCurrentImage

        public void setCurrentImage​(AbstractImageContainer value)
        Sets the current image.
        Parameters:
        value - the image
      • setCurrentImage

        public void setCurrentImage​(AbstractImageContainer value,
                                    double zoom)
        Sets the current image.
        Parameters:
        value - the image
        zoom - the zoom to use
      • getCurrentImage

        public AbstractImageContainer getCurrentImage()
        Returns the current image.
        Returns:
        the image
      • getCurrentReport

        public Report getCurrentReport()
        Returns the current report.
        Returns:
        the report
      • updateObjects

        protected void updateObjects()
        Reads the object locations from the report.
      • logLabelClick

        protected void logLabelClick​(boolean add,
                                     LocatedObject object,
                                     String label)
        Logs the addition/removal of a label.
        Parameters:
        add - true if label added, false if removed
        object - the affected object
        label - the label, can be null
      • logObjectRemoval

        protected void logObjectRemoval​(LocatedObject object)
        Logs the removal of an object.
        Parameters:
        object - the removed object
      • clearInteractionLog

        public void clearInteractionLog()
        Clears the interaction log.
      • hasInteractionLog

        public boolean hasInteractionLog()
        Checks whether there have been any interactions recorded.
        Returns:
        true if interactions are available
      • getInteractionLog

        public List<InteractionEvent> getInteractionLog()
        Returns the interaction log.
        Returns:
        the log, null if nothing recorded