Class SpectrumExplorer

  • All Implemented Interfaces:
    adams.core.CleanUpHandler, adams.core.StatusMessageHandler, adams.db.DatabaseConnectionHandler, adams.db.DatabaseConnectionProvider, adams.db.DatabaseConnectionUser, adams.event.DatabaseConnectionChangeListener, adams.gui.core.MenuBarProvider, adams.gui.core.UndoHandler, adams.gui.core.UndoHandlerWithQuickAccess, adams.gui.event.DataChangeListener, adams.gui.event.FilterListener<Spectrum>, adams.gui.event.UndoListener, adams.gui.scripting.ScriptingEngineHandler, adams.gui.sendto.SendToActionSupporter, adams.gui.visualization.container.ContainerListManager<SpectrumContainerManager>, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

    public class SpectrumExplorer
    extends adams.gui.core.UndoPanel
    implements adams.gui.core.MenuBarProvider, adams.core.StatusMessageHandler, adams.gui.visualization.container.ContainerListManager<SpectrumContainerManager>, adams.event.DatabaseConnectionChangeListener, adams.db.DatabaseConnectionHandler, adams.gui.event.DataChangeListener, adams.gui.scripting.ScriptingEngineHandler, adams.core.CleanUpHandler, adams.gui.event.FilterListener<Spectrum>, adams.gui.sendto.SendToActionSupporter, adams.gui.core.UndoHandlerWithQuickAccess
    A panel for exploring Spectrums, manipulating them with filters, etc.
    Version:
    $Revision: 2246 $
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_PanelSpectrum

        protected SpectrumPanel m_PanelSpectrum
        the panel for displaying.
      • m_StatusBar

        protected adams.gui.core.BaseStatusBar m_StatusBar
        the status bar.
      • m_MenuBar

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

        protected JMenuItem m_MenuItemClearData
        the clear data menu item.
      • m_MenuItemEnableUndo

        protected JCheckBoxMenuItem m_MenuItemEnableUndo
        the toggle undo menu item.
      • m_MenuItemUndo

        protected JMenuItem m_MenuItemUndo
        the undo menu item.
      • m_MenuItemRedo

        protected JMenuItem m_MenuItemRedo
        the redo menu item.
      • m_MenuItemProcessFilter

        protected JMenuItem m_MenuItemProcessFilter
        the filter menu item.
      • m_MenuItemProcessICA

        protected JMenuItem m_MenuItemProcessICA
        the ica menu item.
      • m_MenuItemProcessPCA

        protected JMenuItem m_MenuItemProcessPCA
        the pca menu item.
      • m_MenuItemProcessPLS

        protected JMenuItem m_MenuItemProcessPLS
        the pls menu item.
      • m_MenuScripts

        protected JMenu m_MenuScripts
        the menu item for scripts.
      • m_MenuItemStopExecution

        protected JMenuItem m_MenuItemStopExecution
        the stop execution menu item.
      • m_MenuItemStartRecording

        protected JMenuItem m_MenuItemStartRecording
        the start recording menu item.
      • m_MenuItemStopRecording

        protected JMenuItem m_MenuItemStopRecording
        the stop recording menu item.
      • m_MenuItemOverlayFlowOutput

        protected JMenuItem m_MenuItemOverlayFlowOutput
        the overlay flow output menu item.
      • m_MenuItemRefreshScripts

        protected JMenuItem m_MenuItemRefreshScripts
        the refresh scripts menu item.
      • m_MenuView

        protected JMenu m_MenuView
        the menu item for view related stuff.
      • m_MenuItemViewSelectedWaveNumber

        protected JMenuItem m_MenuItemViewSelectedWaveNumber
        the toggle selected GC point menu item.
      • m_MenuItemViewZoomOverview

        protected JMenuItem m_MenuItemViewZoomOverview
        the toggle zoom overview menu item.
      • m_MenuItemViewAntiAliasing

        protected JMenuItem m_MenuItemViewAntiAliasing
        the toggle anti-aliasing menu item.
      • m_MenuItemViewColorProvider

        protected JMenuItem m_MenuItemViewColorProvider
        the color provider menu item.
      • m_MenuItemViewPaintlet

        protected JMenuItem m_MenuItemViewPaintlet
        the paintlet menu item.
      • m_MenuWindow

        protected JMenu m_MenuWindow
        the menu item for window related stuff.
      • m_MenuItemWindowNew

        protected JMenuItem m_MenuItemWindowNew
        the menuitem for creating a new window.
      • m_MenuItemWindowDuplicate

        protected JMenuItem m_MenuItemWindowDuplicate
        the menuitem for duplicating theew window.
      • m_CurrentFilter

        protected adams.data.filter.Filter<Spectrum> m_CurrentFilter
        the current filter.
      • m_CurrentPCA

        protected PCA m_CurrentPCA
        the current PCA analysis.
      • m_CurrentICA

        protected FastICA m_CurrentICA
        the current ICA analysis.
      • m_CurrentPLS

        protected PLS m_CurrentPLS
        the current PLS analysis.
      • m_FilterOverlayOriginalData

        protected boolean m_FilterOverlayOriginalData
        indicates whether the filtered data was overlayed over the original.
      • m_DialogFilter

        protected adams.gui.visualization.container.FilterDialog m_DialogFilter
        the filter dialog.
      • m_DialogPCA

        protected adams.gui.goe.GenericObjectEditorDialog m_DialogPCA
        the PCA dialog.
      • m_DialogICA

        protected adams.gui.goe.GenericObjectEditorDialog m_DialogICA
        the ICA dialog.
      • m_DialogPLS

        protected adams.gui.goe.GenericObjectEditorDialog m_DialogPLS
        the PLS dialog.
      • m_SpectrumFileChooser

        protected SpectrumFileChooser m_SpectrumFileChooser
        the file chooser for importing data.
      • m_ScriptingDialog

        protected adams.gui.scripting.ScriptingDialog m_ScriptingDialog
        the dialog for managing scripts.
      • m_TabbedPane

        protected adams.gui.core.BaseTabbedPane m_TabbedPane
        the tabbed pane for the data to display.
      • m_SearchPanel

        protected adams.gui.core.SearchPanel m_SearchPanel
        for searching the fields in the reports.
      • m_DatabaseConnection

        protected adams.db.AbstractDatabaseConnection m_DatabaseConnection
        the database connection.
      • m_DialogColorProvider

        protected adams.gui.goe.GenericObjectEditorDialog m_DialogColorProvider
        the dialog for selecting the color provider.
      • m_DialogPaintlet

        protected adams.gui.goe.GenericObjectEditorDialog m_DialogPaintlet
        the dialog for selecting the paintlet.
      • m_RecentFilesHandler

        protected adams.gui.core.RecentFilesHandlerWithCommandline<JMenu> m_RecentFilesHandler
        the recent files handler.
    • Constructor Detail

      • SpectrumExplorer

        public SpectrumExplorer()
        default constructor.
    • Method Detail

      • initialize

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

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

        public SpectrumPanel getSpectrumPanel()
        Returns the panel for painting the spectrums.
        Returns:
        the panel
      • showStatus

        public void showStatus​(String msg)
        Displays a message.
        Specified by:
        showStatus in interface adams.core.StatusMessageHandler
        Parameters:
        msg - the message to display
      • dataChanged

        public void dataChanged​(adams.gui.event.DataChangeEvent e)
        Gets called if the data of the spectrum panel has changed.
        Specified by:
        dataChanged in interface adams.gui.event.DataChangeListener
        Parameters:
        e - the event that the spectrum panel sent
      • getScriptingEngine

        public adams.gui.scripting.AbstractScriptingEngine getScriptingEngine()
        Returns the current scripting engine, can be null.
        Specified by:
        getScriptingEngine in interface adams.gui.scripting.ScriptingEngineHandler
        Returns:
        the current engine
      • databaseConnectionStateChanged

        public void databaseConnectionStateChanged​(adams.event.DatabaseConnectionChangeEvent e)
        A change in the database connection occurred. Clears the undo cache.
        Specified by:
        databaseConnectionStateChanged in interface adams.event.DatabaseConnectionChangeListener
        Parameters:
        e - the event
      • undoOccurred

        public void undoOccurred​(adams.gui.event.UndoEvent e)
        An undo event occurred.
        Specified by:
        undoOccurred in interface adams.gui.event.UndoListener
        Parameters:
        e - the event
      • getContainerManager

        public SpectrumContainerManager getContainerManager()
        Returns the current container manager.
        Specified by:
        getContainerManager in interface adams.gui.visualization.container.ContainerListManager<SpectrumContainerManager>
        Returns:
        the manager
      • setContainerManager

        public void setContainerManager​(SpectrumContainerManager value)
        Sets the manager for handling the containers.
        Specified by:
        setContainerManager in interface adams.gui.visualization.container.ContainerListManager<SpectrumContainerManager>
        Parameters:
        value - the manager
      • updateMenu

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

        public void refreshScripts()
        re-builds the "Scripts" menu.
      • manageScripts

        public void manageScripts()
        Executes a script.
      • startRecording

        public void startRecording()
        Starts the recording of commands.
      • stopRecording

        public void stopRecording()
        Stops the recording of commands.
      • getMenuBar

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

        public void clearData()
        Removes all the data.
      • loadData

        public void loadData()
        pops up the dialog for loading the data from a database.
      • loadDataFromDisk

        public void loadDataFromDisk()
        pops up file chooser dialog for spectrum readers.
      • close

        public void close()
        closes the dialog/frame.
      • undo

        public void undo()
        performs an undo if possible.
        Specified by:
        undo in interface adams.gui.core.UndoHandlerWithQuickAccess
      • redo

        public void redo()
        performs a redo if possible.
        Specified by:
        redo in interface adams.gui.core.UndoHandlerWithQuickAccess
      • addUndoPoint

        public void addUndoPoint​(String comment)
        Adds an undo point with the given comment.
        Specified by:
        addUndoPoint in interface adams.gui.core.UndoHandlerWithQuickAccess
        Parameters:
        comment - the comment for the undo point
      • filter

        public void filter()
        pops up GOE dialog for filter.
      • filter

        public void filter​(adams.gui.event.FilterEvent<Spectrum> e)
        Filters the data.
        Specified by:
        filter in interface adams.gui.event.FilterListener<Spectrum>
        Parameters:
        e - the event
      • ica

        public void ica()
        Performs ICA on the visible spectra.
      • pca

        public void pca()
        Performs PCA on the visible spectra.
      • pls

        public void pls()
        Performs PLS on the visible spectra.
      • setZoomOverviewPanelVisible

        public void setZoomOverviewPanelVisible​(boolean value)
        Sets the zoom overview panel visible or not.
        Parameters:
        value - if true then the panel is visible
      • isZoomOverviewPanelVisible

        public boolean isZoomOverviewPanelVisible()
        Returns whether the zoom overview panel is visible or not.
        Returns:
        true if visible
      • selectColorProvider

        protected void selectColorProvider()
        Lets the user select a new color provider.
      • selectPaintlet

        protected void selectPaintlet()
        Lets the user select a new paintlet.
      • getDatabaseConnection

        public adams.db.AbstractDatabaseConnection getDatabaseConnection()
        Returns the currently used database connection object, can be null.
        Specified by:
        getDatabaseConnection in interface adams.db.DatabaseConnectionProvider
        Returns:
        the current object
      • setDatabaseConnection

        public void setDatabaseConnection​(adams.db.AbstractDatabaseConnection value)
        Sets the database connection object to use.
        Specified by:
        setDatabaseConnection in interface adams.db.DatabaseConnectionHandler
        Parameters:
        value - the object to use
      • getSendToClasses

        public Class[] getSendToClasses()
        Returns the classes that the supporter generates.
        Specified by:
        getSendToClasses in interface adams.gui.sendto.SendToActionSupporter
        Returns:
        the classes
      • hasSendToItem

        public boolean hasSendToItem​(Class[] cls)
        Checks whether something to send is available.
        Specified by:
        hasSendToItem in interface adams.gui.sendto.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 adams.gui.sendto.SendToActionSupporter
        Parameters:
        cls - the classes to retrieve the item for
        Returns:
        the item to send
      • newWindow

        protected SpectrumExplorer newWindow​(boolean visible)
        Opens a new window.
        Parameters:
        visible - whether to make the window visible
      • duplicateWindow

        protected SpectrumExplorer duplicateWindow​(boolean visible)
        Opens a new window with the same content/setup.
        Parameters:
        visible - whether to make the window visible
      • cleanUp

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