Class ImageViewerPanel

    • Field Detail

      • m_Properties

        protected static Properties m_Properties
        the properties.
      • m_FileChooser

        protected ImageFileChooser m_FileChooser
        the file chooser for the pictures.
      • m_PopupMenuCustomizer

        protected PopupMenuCustomizer m_PopupMenuCustomizer
        an optional customizer for the right-click popup.
      • m_MenuBar

        protected JMenuBar m_MenuBar
        the menu bar, if used.
      • m_MenuItemFileLoadRecent

        protected JMenu m_MenuItemFileLoadRecent
        the "load recent" submenu.
      • m_MenuItemFileSaveAs

        protected JMenuItem m_MenuItemFileSaveAs
        the menu item "save as".
      • m_MenuItemFileClose

        protected JMenuItem m_MenuItemFileClose
        the menu item "close".
      • m_MenuItemEditEnableUndo

        protected JCheckBoxMenuItem m_MenuItemEditEnableUndo
        the menu item "enable undo".
      • m_MenuItemEditUndo

        protected JMenuItem m_MenuItemEditUndo
        the menu item "undo".
      • m_MenuItemEditRedo

        protected JMenuItem m_MenuItemEditRedo
        the menu item "redo".
      • m_MenuItemEditCopy

        protected JMenuItem m_MenuItemEditCopy
        the menu item "copy".
      • m_MenuItemImageRotateLeft

        protected JMenuItem m_MenuItemImageRotateLeft
        the menu item "rotate left".
      • m_MenuItemImageRotateRight

        protected JMenuItem m_MenuItemImageRotateRight
        the menu item "rotate right".
      • m_MenuItemImageFlipHorizontally

        protected JMenuItem m_MenuItemImageFlipHorizontally
        the menu item "flip horizontally".
      • m_MenuItemImageFlipVertically

        protected JMenuItem m_MenuItemImageFlipVertically
        the menu item "flip vertically".
      • m_MenuItemImagePickColor

        protected JMenuItem m_MenuItemImagePickColor
        the menu item "pick color".
      • m_MenuViewZoom

        protected JMenu m_MenuViewZoom
        the menu "zoom".
      • m_MenuItemViewZoomIn

        protected JMenuItem m_MenuItemViewZoomIn
        the menu item "zoom in".
      • m_MenuItemViewZoomOut

        protected JMenuItem m_MenuItemViewZoomOut
        the menu item "zoom out".
      • m_MenuItemViewRemoveOverlays

        protected JMenuItem m_MenuItemViewRemoveOverlays
        the menu item "remove overlays".
      • m_MenuItemViewBackgroundColor

        protected JMenuItem m_MenuItemViewBackgroundColor
        the menu item "background color".
      • m_MenuItemViewShowProperties

        protected JMenuItem m_MenuItemViewShowProperties
        the menu item "show properties".
      • m_MenuItemViewShowLog

        protected JMenuItem m_MenuItemViewShowLog
        the menu item "show log".
      • m_MultiPagePane

        protected ImageMultiPagePane m_MultiPagePane
        the tabbed pane with the images.
      • m_TitleGenerator

        protected TitleGenerator m_TitleGenerator
        for generating the title.
      • m_ImagingModulePresent

        protected boolean m_ImagingModulePresent
        whether adams-imaging is present.
      • m_DialogColorPicker

        protected ColorPickerDialog m_DialogColorPicker
        the color picker dialog.
    • Constructor Detail

      • ImageViewerPanel

        public ImageViewerPanel()
    • 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
      • update

        protected void update()
        Updates the title and menu.
      • getTitleGenerator

        public TitleGenerator getTitleGenerator()
        Returns the title generator in use.
        Returns:
        the generator
      • updateTitle

        protected void updateTitle()
        Updats the title of the dialog/frame if applicable.
      • updateMenu

        protected void updateMenu()
        updates the enabled state of the menu items.
      • getPanelAt

        public ImagePanel getPanelAt​(int index)
        Returns the image panel of the specified tab.
        Parameters:
        index - the tab index
        Returns:
        the image panel, null if none available
      • getAllPanels

        public ImagePanel[] getAllPanels()
        Returns all the image panels.
        Returns:
        the image panels
      • getCurrentImage

        public BufferedImage getCurrentImage()
        Returns the underlying image.
        Returns:
        the current image, can be null
      • getImageAt

        public BufferedImage getImageAt​(int index)
        Returns the underlying image.
        Parameters:
        index - the tab index
        Returns:
        the current image, can be null
      • getCurrentFile

        public File getCurrentFile()
        Returns the current filename.
        Returns:
        the current filename, can be null
      • getFileAt

        public File getFileAt​(int index)
        Returns the current filename.
        Parameters:
        index - the tab index
        Returns:
        the current filename, can be null
      • 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
      • open

        protected void open()
        Opens an image.
      • load

        public void load​(File file)
        Loads the specified file in a new panel.
        Parameters:
        file - the file to load
      • load

        public void load​(File file,
                         ImageReader reader)
        Loads the specified file in a new panel.
        Parameters:
        file - the file to load
        reader - the reader to use, null for auto-detection
      • saveAs

        protected void saveAs()
        Saves the current image under a new name.
      • close

        protected void close()
        Closes the current image.
      • exit

        protected void exit()
        Exits the viewer.
      • copy

        protected void copy()
        Copies the current image to the clipboard.
      • applyJAITransformer

        protected void applyJAITransformer​(String cmd,
                                           String operation)
        Applies a JAI transformer. Transformer gets applied to the current image, replacing it in the process.
        Parameters:
        cmd - the transformer commandline
        operation - the name of the operation, to be used in error message
      • rotate

        protected void rotate​(boolean left)
        Rotates the image.
        Parameters:
        left - whether to rotate 90 degrees left
      • flip

        protected void flip​(boolean horizontal)
        Flips the image.
        Parameters:
        horizontal - whether to flip horizontally
      • pickColor

        protected void pickColor()
        Allows the user to pick a color.
      • zoom

        protected void zoom​(int zoom)
        Zooms in/out.
        Parameters:
        zoom - the zoom (in percent)
      • removeOverlays

        protected void removeOverlays()
        Removes all image overlays.
      • chooseBackgroundColor

        protected void chooseBackgroundColor()
        Lets the user select the background color for the image.
      • setPopupMenuCustomizer

        public void setPopupMenuCustomizer​(PopupMenuCustomizer value)
        Sets the class to customize the right-click popup menu.
        Parameters:
        value - the customizer
      • getPopupMenuCustomizer

        public PopupMenuCustomizer getPopupMenuCustomizer()
        Returns the current customizer, can be null.
        Returns:
        the customizer
      • hasSendToItem

        public boolean hasSendToItem​(Class[] cls)
        Checks whether something to send is available.
        Specified by:
        hasSendToItem in interface SendToActionSupporter
        Parameters:
        cls - the classes to retrieve an item for
        Returns:
        true if an object is available for sending
      • getSendToItem

        public Object getSendToItem​(Class[] cls)
        Returns the object to send.
        Specified by:
        getSendToItem in interface SendToActionSupporter
        Parameters:
        cls - the classes to retrieve the item for
        Returns:
        the item to send
      • undo

        public void undo()
        peforms an undo if possible.
      • redo

        public void redo()
        peforms a redo if possible.
      • getProperties

        public static Properties getProperties()
        Returns the properties that define the editor.
        Returns:
        the properties