Class MultiSpectrumPanel

  • All Implemented Interfaces:
    adams.gui.core.MenuBarProvider, ImageObserver, MenuContainer, Serializable, Accessible

    public class MultiSpectrumPanel
    extends adams.gui.core.BasePanel
    implements adams.gui.core.MenuBarProvider
    A panel for viewing spectra in pages.
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_FileChooser

        protected SpectrumFileChooser m_FileChooser
        the file chooser to use for loading files.
      • m_MultiPagePane

        protected adams.gui.core.MultiPagePane m_MultiPagePane
        for displaying the spectra in tabs.
      • m_GOEDialog

        protected adams.gui.goe.GenericObjectEditorDialog m_GOEDialog
        for choosing an appropriate reader.
      • m_MenuBar

        protected JMenuBar m_MenuBar
        the menu bar.
      • m_MenuItemFileOpen

        protected JMenuItem m_MenuItemFileOpen
        the "open" file menu item.
      • m_MenuItemFileSaveAs

        protected JMenuItem m_MenuItemFileSaveAs
        the "save as" file menu item.
      • m_MenuItemFileExit

        protected JMenuItem m_MenuItemFileExit
        the "exit" file menu item.
      • m_MenuItemViewNewTab

        protected JMenuItem m_MenuItemViewNewTab
        the "new tab" view menu item.
      • m_MenuItemViewCloseTab

        protected JMenuItem m_MenuItemViewCloseTab
        the "close tab" view menu item.
      • m_TabCounter

        protected int m_TabCounter
        the counter for the tabs.
    • Constructor Detail

      • MultiSpectrumPanel

        public MultiSpectrumPanel()
    • Method Detail

      • initialize

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

        protected void initGUI()
        Initializes the widgets.
        Overrides:
        initGUI in class adams.gui.core.BasePanel
      • getGOEDialog

        protected adams.gui.goe.GenericObjectEditorDialog getGOEDialog()
        Returns the GOE dialog.
        Returns:
        the dialog
      • getMenuBar

        public JMenuBar getMenuBar()
        Initializes the menubar.
        Specified by:
        getMenuBar in interface adams.gui.core.MenuBarProvider
      • load

        protected void load()
        Displays a dialog for opening a spectrum file.
      • load

        public void load​(adams.core.io.PlaceholderFile file,
                         boolean openNewTab)
        Loads the spectra from the file.
        Parameters:
        file - the file to load the spectra from
        openNewTab - whether to open a new tab
      • load

        protected void load​(AbstractSpectrumReader reader)
        Loads the spectra using the configured reader.
        Parameters:
        reader - the configured reader to use
      • saveAs

        protected void saveAs()
        Displays a dialog for saving a spectrum to a file.
      • newTab

        protected void newTab()
        Adds a new tab.
      • closeTab

        protected void closeTab()
        Closes the current tab.
      • closeWindow

        protected void closeWindow()
        Closes the frame/window.
      • getSelectedPanel

        protected SpectrumPanel getSelectedPanel()
        Returns the currently selected spectrum panel.
        Returns:
        the spectrum panel
      • updateMenu

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