Package adams.gui.tools
Class SpreadSheetProcessorPanel
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- adams.gui.core.BasePanel
-
- adams.gui.tools.SpreadSheetProcessorPanel
-
- All Implemented Interfaces:
CleanUpHandler,MenuBarProvider,SpreadSheetProcessorListener,ImageObserver,MenuContainer,Serializable,Accessible
public class SpreadSheetProcessorPanel extends BasePanel implements MenuBarProvider, SpreadSheetProcessorListener, CleanUpHandler
The main panel for processing spreadsheets.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSpreadSheetProcessorPanel.WidgetPanelEncapsulates combobox to select a widget and the selected widget.-
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 static StringKEY_PROCESSOR_DATAstatic StringKEY_PROCESSOR_NAMEstatic StringKEY_SOURCE_DATAstatic StringKEY_SOURCE_NAMEstatic StringKEY_TARGET_DATAstatic StringKEY_TARGET_NAMEprotected SpreadSheetm_DataProcessorthe processed data.protected SpreadSheetm_DataSourcethe source data.protected SerializationFileChooserm_FileChooserConfigurationfilechooser for load/save configurations.protected List<Actor>m_GeneratedFlowsthe generated flows (eg charts).protected JMenuBarm_MenuBarthe menu bar, if used.protected SpreadSheetProcessorPanel.WidgetPanelm_PanelProcessorthe widget panel for the processor.protected SpreadSheetProcessorPanel.WidgetPanelm_PanelSourcethe widget panel for the source.protected SpreadSheetProcessorPanel.WidgetPanelm_PanelTargetthe widget panel for the target.protected BaseSplitPanem_SplitPanelCenterthe center split pane.protected BaseSplitPanem_SplitPanelLeftthe left split pane.protected BaseSplitPanem_SplitPanelRightthe right split pane.protected BaseSplitPanem_SplitPanelVert1the 1st vertical split pane.protected BaseSplitPanem_SplitPanelVert2the 2nd vertical split pane.protected BaseStatusBarm_StatusBarthe status bar.protected SpreadSheetTableModelm_TableModelProcessorthe spreadsheet model.protected SpreadSheetTableModelm_TableModelSourcethe spreadsheet model.protected SpreadSheetTableWithSearchm_TableProcessorthe table for displaying the processed spreadsheet.protected SpreadSheetTableWithSearchm_TableSourcethe table for displaying the spreadsheet.-
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 SpreadSheetProcessorPanel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddGeneratedFlow(Actor flow)Adds the flow to the list of flows to clean up.voidcleanUp()Cleans up data structures, frees up memory.protected voidfinishInit()Finishes the initialization.JMenuBargetMenuBar()Creates a menu bar (singleton per panel object).SpreadSheetgetProcessorData()Returns the processed data.AbstractProcessorgetProcessorWidget()Returns the processor widget.SpreadSheetgetSourceData()Returns the source data.AbstractSourcegetSourceWidget()Returns the source widget.AbstractTargetgetTargetWidget()Returns the target widget.protected voidinitGUI()For initializing the GUI.protected voidinitialize()Initializes the members.SpreadSheetProcessorPanelnewWindow()Displays a new preview window/frame.protected voidopenConfiguration()Allows the user to load a previously saved configuration.voidprocessorStateChanged(SpreadSheetProcessorEvent e)Gets triggered whenever the processor changes state.protected voidsaveConfiguration()Alles the user to save the currrent configuration.booleanselectProcessorWidget(String name)Selects the processor widget based on name.booleanselectSourceWidget(String name)Selects the source widget based on name.booleanselectTargetWidget(String name)Selects the target widget based on name.voidsetProcessorWidget(AbstractProcessor value)Sets the processor widget.voidsetSourceWidget(AbstractSource value)Sets the source widget.voidsetTargetWidget(AbstractTarget value)Sets the target widget.protected voidupdateMenu()Updates the menu.-
Methods inherited from class adams.gui.core.BasePanel
afterHide, afterShow, beforeHide, beforeShow, closeParent, 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
-
-
-
-
Field Detail
-
KEY_SOURCE_DATA
public static final String KEY_SOURCE_DATA
- See Also:
- Constant Field Values
-
KEY_PROCESSOR_DATA
public static final String KEY_PROCESSOR_DATA
- See Also:
- Constant Field Values
-
KEY_TARGET_DATA
public static final String KEY_TARGET_DATA
- See Also:
- Constant Field Values
-
KEY_SOURCE_NAME
public static final String KEY_SOURCE_NAME
- See Also:
- Constant Field Values
-
KEY_PROCESSOR_NAME
public static final String KEY_PROCESSOR_NAME
- See Also:
- Constant Field Values
-
KEY_TARGET_NAME
public static final String KEY_TARGET_NAME
- See Also:
- Constant Field Values
-
m_SplitPanelVert1
protected BaseSplitPane m_SplitPanelVert1
the 1st vertical split pane.
-
m_SplitPanelVert2
protected BaseSplitPane m_SplitPanelVert2
the 2nd vertical split pane.
-
m_SplitPanelLeft
protected BaseSplitPane m_SplitPanelLeft
the left split pane.
-
m_SplitPanelCenter
protected BaseSplitPane m_SplitPanelCenter
the center split pane.
-
m_SplitPanelRight
protected BaseSplitPane m_SplitPanelRight
the right split pane.
-
m_PanelSource
protected SpreadSheetProcessorPanel.WidgetPanel m_PanelSource
the widget panel for the source.
-
m_TableSource
protected SpreadSheetTableWithSearch m_TableSource
the table for displaying the spreadsheet.
-
m_TableModelSource
protected SpreadSheetTableModel m_TableModelSource
the spreadsheet model.
-
m_PanelProcessor
protected SpreadSheetProcessorPanel.WidgetPanel m_PanelProcessor
the widget panel for the processor.
-
m_TableProcessor
protected SpreadSheetTableWithSearch m_TableProcessor
the table for displaying the processed spreadsheet.
-
m_TableModelProcessor
protected SpreadSheetTableModel m_TableModelProcessor
the spreadsheet model.
-
m_PanelTarget
protected SpreadSheetProcessorPanel.WidgetPanel m_PanelTarget
the widget panel for the target.
-
m_MenuBar
protected JMenuBar m_MenuBar
the menu bar, if used.
-
m_StatusBar
protected BaseStatusBar m_StatusBar
the status bar.
-
m_DataSource
protected SpreadSheet m_DataSource
the source data.
-
m_DataProcessor
protected SpreadSheet m_DataProcessor
the processed data.
-
m_FileChooserConfiguration
protected SerializationFileChooser m_FileChooserConfiguration
filechooser for load/save configurations.
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initializein classBasePanel
-
finishInit
protected void finishInit()
Finishes the initialization.- Overrides:
finishInitin classBasePanel
-
getMenuBar
public JMenuBar getMenuBar()
Creates a menu bar (singleton per panel object). Can be used in frames.- Specified by:
getMenuBarin interfaceMenuBarProvider- Returns:
- the menu bar
-
updateMenu
protected void updateMenu()
Updates the menu.
-
openConfiguration
protected void openConfiguration()
Allows the user to load a previously saved configuration.
-
saveConfiguration
protected void saveConfiguration()
Alles the user to save the currrent configuration.
-
selectSourceWidget
public boolean selectSourceWidget(String name)
Selects the source widget based on name.- Parameters:
name- the name of the widget- Returns:
- true if successfully set
-
setSourceWidget
public void setSourceWidget(AbstractSource value)
Sets the source widget.- Parameters:
value- the source
-
getSourceWidget
public AbstractSource getSourceWidget()
Returns the source widget.- Returns:
- the source
-
selectProcessorWidget
public boolean selectProcessorWidget(String name)
Selects the processor widget based on name.- Parameters:
name- the name of the widget- Returns:
- true if successfully set
-
setProcessorWidget
public void setProcessorWidget(AbstractProcessor value)
Sets the processor widget.- Parameters:
value- the processor
-
getProcessorWidget
public AbstractProcessor getProcessorWidget()
Returns the processor widget.- Returns:
- the process
-
selectTargetWidget
public boolean selectTargetWidget(String name)
Selects the target widget based on name.- Parameters:
name- the name of the widget- Returns:
- true if successfully set
-
setTargetWidget
public void setTargetWidget(AbstractTarget value)
Sets the target widget.- Parameters:
value- the target
-
getTargetWidget
public AbstractTarget getTargetWidget()
Returns the target widget.- Returns:
- the target
-
getSourceData
public SpreadSheet getSourceData()
Returns the source data.- Returns:
- the data, null if not available
-
getProcessorData
public SpreadSheet getProcessorData()
Returns the processed data.- Returns:
- the data, null if not available
-
newWindow
public SpreadSheetProcessorPanel newWindow()
Displays a new preview window/frame.- Returns:
- the new panel
-
processorStateChanged
public void processorStateChanged(SpreadSheetProcessorEvent e)
Gets triggered whenever the processor changes state.- Specified by:
processorStateChangedin interfaceSpreadSheetProcessorListener- Parameters:
e- the event
-
addGeneratedFlow
public void addGeneratedFlow(Actor flow)
Adds the flow to the list of flows to clean up.- Parameters:
flow- the flow to clean up
-
cleanUp
public void cleanUp()
Cleans up data structures, frees up memory.- Specified by:
cleanUpin interfaceCleanUpHandler
-
-