Class PixelSelectorPanel

    • Field Detail

      • CANCEL_OPTION

        public static final int CANCEL_OPTION
        the CANCEL option.
        See Also:
        Constant Field Values
      • APPROVE_OPTION

        public static final int APPROVE_OPTION
        the APPROVE option.
        See Also:
        Constant Field Values
      • m_SplitPane

        protected BaseSplitPane m_SplitPane
        the split pane.
      • m_ImagePanel

        protected ImagePanel m_ImagePanel
        the image panel.
      • m_ButtonOK

        protected BaseButton m_ButtonOK
        the OK button.
      • m_ButtonCancel

        protected BaseButton m_ButtonCancel
        the Cancel button.
      • m_Result

        protected int m_Result
        the result (ok or cancel).
      • m_MenuBar

        protected JMenuBar m_MenuBar
        the menu bar.
      • m_LastActionResult

        protected Hashtable<Class,​Object> m_LastActionResult
        the last action result for a selector action.
    • Constructor Detail

      • PixelSelectorPanel

        public PixelSelectorPanel()
    • 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
      • setSplitterPosition

        public void setSplitterPosition​(int value)
        Sets the location of the splitter/divider.
        Parameters:
        value - the position in pixels
      • getSplitterPosition

        public int getSplitterPosition()
        Returns the current location of the splitter/divider.
        Returns:
        the position in pixels
      • setActions

        public void setActions​(AbstractPixelSelectorAction[] value)
        Sets the available popup actions.
        Parameters:
        value - the actions
      • setImage

        public void setImage​(AbstractImageContainer value)
        Sets the image.
        Parameters:
        value - the image
      • hasImage

        public boolean hasImage()
        Checks whether an image is currently displayed.
        Returns:
        true if an image is available
      • getImage

        public AbstractImageContainer getImage()
        Returns the current image.
        Returns:
        the image, null if none set
      • addActionListener

        public void addActionListener​(ActionListener l)
        Adds a listener for button actions.
        Parameters:
        l - the lister to add
      • removeActionListener

        public void removeActionListener​(ActionListener l)
        Removes a listener for button actions.
        Parameters:
        l - the lister to remove
      • notifyActionListeners

        protected void notifyActionListeners​(int button)
        Notifies all the action listeners.
        Parameters:
        button - the button that triggered this event (OK/Cancel)
      • clearImageOverlays

        public void clearImageOverlays()
        Removes all image overlays.
      • addImageOverlay

        public void addImageOverlay​(ImageOverlay io)
        Adds the image overlay.
        Parameters:
        io - the image overlay to add
      • removeImageOverlay

        public void removeImageOverlay​(ImageOverlay io)
        Removes the image overlay.
        Parameters:
        io - the image overlay to remove
      • imageOverlays

        public Iterator<ImageOverlay> imageOverlays()
        Returns an iterator over all the image overlays.
        Returns:
        iterator on image overlays
      • closeDialog

        protected void closeDialog​(int result)
        Closes the dialog.
        Parameters:
        result - whether successful or not
        See Also:
        APPROVE_OPTION, CANCEL_OPTION
      • editOverlays

        protected void editOverlays()
        Edits the current overlays.
      • hasLastActionResult

        public boolean hasLastActionResult​(Class cls)
        Checks for the specified action whether a previous result is available.
        Parameters:
        cls - the action class to check
        Returns:
        true if a previous result is available
      • setLastActionResult

        public void setLastActionResult​(Class cls,
                                        Object value)
        Stores the result for the specified action.
        Parameters:
        cls - the action class to store the result for
        value - the action result, null removes the association
      • getLastActionResult

        public Object getLastActionResult​(Class cls)
        Retrieves the previous result for the specified action if available.
        Parameters:
        cls - the action class to get the result for
        Returns:
        the result or null if not available
      • getMenuBar

        public JMenuBar getMenuBar()
        Creates a menu bar (singleton per panel object). Can be used in frames.
        Specified by:
        getMenuBar in interface MenuBarProvider
        Returns:
        the menu bar
      • updateReport

        public void updateReport()
        Updates the report.
      • updateImage

        public void updateImage()
        Updates the image.
      • update

        public void update()
        Updates the report/image.
      • cleanUp

        public void cleanUp()
        Cleans up data structures, frees up memory.
        Specified by:
        cleanUp in interface CleanUpHandler