Class TimeseriesExplorer
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- adams.gui.core.BasePanel
-
- adams.gui.core.UndoPanel
-
- adams.gui.visualization.timeseries.TimeseriesExplorer
-
- All Implemented Interfaces:
CleanUpHandler
,StatusMessageHandler
,DatabaseConnectionHandler
,DatabaseConnectionProvider
,DatabaseConnectionUser
,DatabaseConnectionChangeListener
,MenuBarProvider
,UndoHandler
,UndoHandlerWithQuickAccess
,DataChangeListener
,FilterListener<Timeseries>
,UndoListener
,ScriptingEngineHandler
,SendToActionSupporter
,ContainerListManager<TimeseriesContainerManager>
,ImageObserver
,MenuContainer
,Serializable
,EventListener
,Accessible
public class TimeseriesExplorer extends UndoPanel implements MenuBarProvider, StatusMessageHandler, ContainerListManager<TimeseriesContainerManager>, DataChangeListener, ScriptingEngineHandler, CleanUpHandler, FilterListener<Timeseries>, SendToActionSupporter, DatabaseConnectionHandler, DatabaseConnectionChangeListener, UndoHandlerWithQuickAccess
A panel for exploring Timeseries, manipulating them with filters, etc.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
-
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
-
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
-
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
-
Field Summary
Fields Modifier and Type Field Description protected Filter<Timeseries>
m_CurrentFilter
the current filter.protected AbstractDatabaseConnection
m_DatabaseConnection
the database connection.protected GenericObjectEditorDialog
m_DialogColorProvider
the dialog for selecting the color provider.protected FilterDialog
m_DialogFilter
the filter dialog.protected GenericObjectEditorDialog
m_DialogPaintlet
the dialog for selecting the paintlet.protected TimeseriesImportDatabaseDialog
m_DialogSQL
the dialog for loading timeseries using custom SQL statements.protected boolean
m_FilterOverlayOriginalData
indicates whether the filtered data was overlayed over the original.protected JMenuBar
m_MenuBar
the menu bar, if used.protected JMenuItem
m_MenuItemClearData
the clear data menu item.protected JCheckBoxMenuItem
m_MenuItemEnableUndo
the toggle undo menu item.protected JMenuItem
m_MenuItemFilter
the filter menu item.protected JMenuItem
m_MenuItemOverlayFlowOutput
the overlay flow output menu item.protected JMenuItem
m_MenuItemRedo
the redo menu item.protected JMenuItem
m_MenuItemRefreshScripts
the refresh scripts menu item.protected JMenuItem
m_MenuItemStartRecording
the start recording menu item.protected JMenuItem
m_MenuItemStopRecording
the stop recording menu item.protected JMenuItem
m_MenuItemUndo
the undo menu item.protected JMenuItem
m_MenuItemViewAntiAliasing
the toggle anti-aliasing menu item.protected JMenuItem
m_MenuItemViewColorProvider
the color provider menu item.protected JMenuItem
m_MenuItemViewPaintlet
the paintlet menu item.protected JMenu
m_MenuItemViewPeriodicity
the periodicity submenu.protected JMenuItem
m_MenuItemViewSelectedTimestamp
the toggle selected timestamp menu item.protected JMenuItem
m_MenuItemViewZoomOverview
the toggle zoom overview menu item.protected JMenu
m_MenuScripts
the menu item for scripts.protected JMenu
m_MenuView
the menu item for view related stuff.protected TimeseriesPanel
m_PanelTimeseries
the panel for displaying.protected RecentFilesHandlerWithCommandline<JMenu>
m_RecentFilesHandler
the recent files handler.protected ReportFactory.Panel
m_Reports
the sample data reports.protected ScriptingDialog
m_ScriptingDialog
the dialog for managing scripts.protected SearchPanel
m_SearchPanel
for searching the fields in the reports.protected BaseStatusBar
m_StatusBar
the status bar.protected BaseTabbedPane
m_TabbedPane
the tabbed pane for the data to display.protected TimeseriesFileChooser
m_TimeseriesFileChooser
the file chooser for importing data.static String
SESSION_FILE
the file to store the recent files in.-
Fields inherited from class adams.gui.core.BasePanel
m_FileChooser
-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
-
Constructor Summary
Constructors Constructor Description TimeseriesExplorer()
default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addUndoPoint(String comment)
Adds an undo point with the given comment.void
cleanUp()
Cleans up data structures, frees up memory.void
clearData()
Removes all the data.void
close()
closes the dialog/frame.void
databaseConnectionStateChanged(DatabaseConnectionChangeEvent e)
A change in the database connection occurred.void
dataChanged(DataChangeEvent e)
Gets called if the data of the timeseries panel has changed.void
filter()
pops up GOE dialog for filter.void
filter(FilterEvent<Timeseries> e)
Filters the data.TimeseriesContainerManager
getContainerManager()
Returns the current container manager.AbstractDatabaseConnection
getDatabaseConnection()
Returns the currently used database connection object, can be null.protected AbstractDatabaseConnection
getDefaultDatabaseConnection()
Returns the default database connection.JMenuBar
getMenuBar()
Creates a menu bar (singleton per panel object).AbstractScriptingEngine
getScriptingEngine()
Returns the current scripting engine, can be null.Class[]
getSendToClasses()
Returns the classes that the supporter generates.Object
getSendToItem(Class[] cls)
Returns the object to send.TimeseriesPanel
getTimeseriesPanel()
Returns the panel for painting the timeseries.boolean
hasSendToItem(Class[] cls)
Checks whether something to send is available.protected void
initGUI()
Initializes the widgets.protected void
initialize()
Initializes the members.boolean
isZoomOverviewPanelVisible()
Returns whether the zoom overview panel is visible or not.void
loadDataFromDatabase()
pops up dialog for SQL statement.void
loadDataFromDisk()
pops up file chooser dialog for timeseries readers.void
manageScripts()
Executes a script.void
redo()
performs a redo if possible.void
refreshScripts()
re-builds the "Scripts" menu.protected void
selectColorProvider()
Lets the user select a new color provider.protected void
selectPaintlet()
Lets the user select a new paintlet.void
setContainerManager(TimeseriesContainerManager value)
Sets the manager for handling the containers.void
setDatabaseConnection(AbstractDatabaseConnection value)
Sets the database connection object to use.void
setZoomOverviewPanelVisible(boolean value)
Sets the zoom overview panel visible or not.void
showStatus(String msg)
Displays a message.void
startRecording()
Starts the recording of commands.void
stopRecording()
Stops the recording of commands.void
undo()
performs an undo if possible.void
undoOccurred(UndoEvent e)
An undo event occurred.protected void
updateMenu()
updates the enabled state of the menu items.-
Methods inherited from class adams.gui.core.UndoPanel
getUndo, isUndoSupported, setUndo
-
Methods inherited from class adams.gui.core.BasePanel
afterHide, afterShow, beforeHide, beforeShow, closeParent, finishInit, getParentChild, getParentDialog, getParentFrame, getParentInternalFrame, getParentTitle, initFileChooser, main, printErrorMessage, printException, saveComponent, setEnabledCascade, setEnabledCascade, setParentTitle, setVisible
-
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.gui.core.UndoHandler
getUndo, isUndoSupported, setUndo
-
-
-
-
Field Detail
-
SESSION_FILE
public static final String SESSION_FILE
the file to store the recent files in.- See Also:
- Constant Field Values
-
m_PanelTimeseries
protected TimeseriesPanel m_PanelTimeseries
the panel for displaying.
-
m_StatusBar
protected 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_MenuItemFilter
protected JMenuItem m_MenuItemFilter
the filter menu item.
-
m_MenuScripts
protected JMenu m_MenuScripts
the menu item for scripts.
-
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_MenuItemViewSelectedTimestamp
protected JMenuItem m_MenuItemViewSelectedTimestamp
the toggle selected timestamp 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_MenuItemViewPeriodicity
protected JMenu m_MenuItemViewPeriodicity
the periodicity submenu.
-
m_MenuItemViewColorProvider
protected JMenuItem m_MenuItemViewColorProvider
the color provider menu item.
-
m_MenuItemViewPaintlet
protected JMenuItem m_MenuItemViewPaintlet
the paintlet menu item.
-
m_CurrentFilter
protected Filter<Timeseries> m_CurrentFilter
the current filter.
-
m_FilterOverlayOriginalData
protected boolean m_FilterOverlayOriginalData
indicates whether the filtered data was overlayed over the original.
-
m_DialogFilter
protected FilterDialog m_DialogFilter
the filter dialog.
-
m_TimeseriesFileChooser
protected TimeseriesFileChooser m_TimeseriesFileChooser
the file chooser for importing data.
-
m_ScriptingDialog
protected ScriptingDialog m_ScriptingDialog
the dialog for managing scripts.
-
m_TabbedPane
protected BaseTabbedPane m_TabbedPane
the tabbed pane for the data to display.
-
m_Reports
protected ReportFactory.Panel m_Reports
the sample data reports.
-
m_SearchPanel
protected SearchPanel m_SearchPanel
for searching the fields in the reports.
-
m_DatabaseConnection
protected AbstractDatabaseConnection m_DatabaseConnection
the database connection.
-
m_DialogSQL
protected TimeseriesImportDatabaseDialog m_DialogSQL
the dialog for loading timeseries using custom SQL statements.
-
m_DialogColorProvider
protected GenericObjectEditorDialog m_DialogColorProvider
the dialog for selecting the color provider.
-
m_DialogPaintlet
protected GenericObjectEditorDialog m_DialogPaintlet
the dialog for selecting the paintlet.
-
m_RecentFilesHandler
protected RecentFilesHandlerWithCommandline<JMenu> m_RecentFilesHandler
the recent files handler.
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classUndoPanel
-
getDefaultDatabaseConnection
protected AbstractDatabaseConnection getDefaultDatabaseConnection()
Returns the default database connection.- Returns:
- the default connection
-
getTimeseriesPanel
public TimeseriesPanel getTimeseriesPanel()
Returns the panel for painting the timeseries.- Returns:
- the panel
-
showStatus
public void showStatus(String msg)
Displays a message.- Specified by:
showStatus
in interfaceStatusMessageHandler
- Parameters:
msg
- the message to display
-
dataChanged
public void dataChanged(DataChangeEvent e)
Gets called if the data of the timeseries panel has changed.- Specified by:
dataChanged
in interfaceDataChangeListener
- Parameters:
e
- the event that the timeseries panel sent
-
getScriptingEngine
public AbstractScriptingEngine getScriptingEngine()
Returns the current scripting engine, can be null.- Specified by:
getScriptingEngine
in interfaceScriptingEngineHandler
- Returns:
- the current engine
-
undoOccurred
public void undoOccurred(UndoEvent e)
An undo event occurred.- Specified by:
undoOccurred
in interfaceUndoListener
- Parameters:
e
- the event
-
getContainerManager
public TimeseriesContainerManager getContainerManager()
Returns the current container manager.- Specified by:
getContainerManager
in interfaceContainerListManager<TimeseriesContainerManager>
- Returns:
- the manager
-
setContainerManager
public void setContainerManager(TimeseriesContainerManager value)
Sets the manager for handling the containers.- Specified by:
setContainerManager
in interfaceContainerListManager<TimeseriesContainerManager>
- 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 interfaceMenuBarProvider
- Returns:
- the menu bar
-
clearData
public void clearData()
Removes all the data.
-
loadDataFromDisk
public void loadDataFromDisk()
pops up file chooser dialog for timeseries readers.
-
loadDataFromDatabase
public void loadDataFromDatabase()
pops up dialog for SQL statement.
-
close
public void close()
closes the dialog/frame.
-
undo
public void undo()
performs an undo if possible.- Specified by:
undo
in interfaceUndoHandlerWithQuickAccess
-
redo
public void redo()
performs a redo if possible.- Specified by:
redo
in interfaceUndoHandlerWithQuickAccess
-
addUndoPoint
public void addUndoPoint(String comment)
Adds an undo point with the given comment.- Specified by:
addUndoPoint
in interfaceUndoHandlerWithQuickAccess
- Parameters:
comment
- the comment for the undo point
-
filter
public void filter()
pops up GOE dialog for filter.
-
filter
public void filter(FilterEvent<Timeseries> e)
Filters the data.- Specified by:
filter
in interfaceFilterListener<Timeseries>
- Parameters:
e
- the event
-
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.
-
getSendToClasses
public Class[] getSendToClasses()
Returns the classes that the supporter generates.- Specified by:
getSendToClasses
in interfaceSendToActionSupporter
- Returns:
- the classes
-
hasSendToItem
public boolean hasSendToItem(Class[] cls)
Checks whether something to send is available.- Specified by:
hasSendToItem
in interfaceSendToActionSupporter
- 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 interfaceSendToActionSupporter
- Parameters:
cls
- the classes to retrieve the item for- Returns:
- the item to send
-
getDatabaseConnection
public AbstractDatabaseConnection getDatabaseConnection()
Returns the currently used database connection object, can be null.- Specified by:
getDatabaseConnection
in interfaceDatabaseConnectionProvider
- Returns:
- the current object
-
setDatabaseConnection
public void setDatabaseConnection(AbstractDatabaseConnection value)
Sets the database connection object to use.- Specified by:
setDatabaseConnection
in interfaceDatabaseConnectionHandler
- Parameters:
value
- the object to use
-
databaseConnectionStateChanged
public void databaseConnectionStateChanged(DatabaseConnectionChangeEvent e)
A change in the database connection occurred.- Specified by:
databaseConnectionStateChanged
in interfaceDatabaseConnectionChangeListener
- Parameters:
e
- the event
-
cleanUp
public void cleanUp()
Cleans up data structures, frees up memory.- Specified by:
cleanUp
in interfaceCleanUpHandler
-
-