Package adams.gui.visualization.instance
Class InstanceComparePanel
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- adams.gui.core.BasePanel
-
- adams.gui.visualization.instance.InstanceComparePanel
-
- All Implemented Interfaces:
adams.core.CleanUpHandler
,adams.core.StatusMessageHandler
,adams.gui.core.MenuBarProvider
,ImageObserver
,MenuContainer
,Serializable
,Accessible
public class InstanceComparePanel extends adams.gui.core.BasePanel implements adams.core.StatusMessageHandler, adams.core.CleanUpHandler, adams.gui.core.MenuBarProvider
A tool for comparing two datasets visually.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
InstanceComparePanel.DatasetIndexer
Helper class for indexing the rows of a dataset.static class
InstanceComparePanel.DatasetPanel
Specialized panel for loading dataset and setting various parameters.-
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 String
FILENAME
the name of the props file.protected JLabel
m_LabelRows
the label for the combobox.protected adams.gui.core.BaseList
m_ListRows
the JLiast with the rows.protected DefaultListModel
m_ListRowsModel
the model for the combobox with the rows.protected JMenuBar
m_MenuBar
the menu bar.protected JMenuItem
m_MenuItemLoadRecent1
the recent file menu item (first file).protected JMenuItem
m_MenuItemLoadRecent2
the recent file menu item (second file).protected JMenuItem
m_MenuItemReload
the reload menu item.protected JMenuItem
m_MenuItemViewAntiAliasing
the toggle anti-aliasing menu item.protected JMenu
m_MenuView
the menu item for view related stuff.protected InstancePanel
m_PanelComparison
the panel for displaying the two instances.protected InstanceComparePanel.DatasetPanel
m_PanelDataset1
the panel for the first dataset.protected InstanceComparePanel.DatasetPanel
m_PanelDataset2
the panel for the second dataset.protected InstancePanel
m_PanelDifference
the panel with the difference.protected static adams.core.Properties
m_Properties
the properties.protected adams.gui.core.RecentFilesHandler<JMenu>
m_RecentFilesHandler1
the recent files handler.protected adams.gui.core.RecentFilesHandler<JMenu>
m_RecentFilesHandler2
the recent files handler.protected adams.gui.visualization.report.ReportFactory.Table
m_ReportTable
the table with the report.protected List<String>
m_RowIndex
the internal index.protected adams.gui.core.BaseStatusBar
m_StatusBar
for displaying error messages.static String
SESSION_FILE_1
the file to store the recent files in (first file).static String
SESSION_FILE_2
the file to store the recent files in (second file).-
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 InstanceComparePanel()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cleanUp()
Cleans up data structures, frees up memory.void
close()
closes the dialog/frame.String
getFirstAttributeRange()
Returns the first attribute range.File
getFirstDataset()
Returns the first dataset.String
getFirstRowIndex()
Returns the first row index.JMenuBar
getMenuBar()
Creates a menu bar (singleton per panel object).static adams.core.Properties
getProperties()
Returns the properties that define the editor.String
getSecondAttributeRange()
Returns the second attribute range.File
getSecondDataset()
Returns the second dataset.String
getSecondRowIndex()
Returns the second row index.protected void
initGUI()
Initializes the widgets.protected void
initialize()
Initializes the members.protected void
performComparison()
Performs the comparison between the rows from the two datasets.void
reload()
Reloads the datasets.void
setFirstAttributeRange(String value)
Sets the first attribute range ('first' and 'last' can be used as well).void
setFirstDataset(File value)
Sets the first dataset.void
setFirstRowIndex(String value)
Sets the first row index ('first' and 'last' can be used as well).void
setSecondAttributeRange(String value)
Sets the second attribute range ('second' and 'last' can be used as well).void
setSecondDataset(File value)
Sets the second dataset.void
setSecondRowIndex(String value)
Sets the second row index ('second' and 'last' can be used as well).void
showStatus(String msg)
Displays a message.protected List<String>
trimIDs(List<String> list)
Removes the leading 0s.protected void
updateMenu()
updates the enabled state of the menu items.protected void
updateRows()
Updates the combobox with the rows.-
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
-
-
-
-
Field Detail
-
FILENAME
public static final String FILENAME
the name of the props file.- See Also:
- Constant Field Values
-
SESSION_FILE_1
public static final String SESSION_FILE_1
the file to store the recent files in (first file).- See Also:
- Constant Field Values
-
SESSION_FILE_2
public static final String SESSION_FILE_2
the file to store the recent files in (second file).- See Also:
- Constant Field Values
-
m_Properties
protected static adams.core.Properties m_Properties
the properties.
-
m_PanelDataset1
protected InstanceComparePanel.DatasetPanel m_PanelDataset1
the panel for the first dataset.
-
m_PanelDataset2
protected InstanceComparePanel.DatasetPanel m_PanelDataset2
the panel for the second dataset.
-
m_PanelComparison
protected InstancePanel m_PanelComparison
the panel for displaying the two instances.
-
m_PanelDifference
protected InstancePanel m_PanelDifference
the panel with the difference.
-
m_LabelRows
protected JLabel m_LabelRows
the label for the combobox.
-
m_ListRows
protected adams.gui.core.BaseList m_ListRows
the JLiast with the rows.
-
m_ListRowsModel
protected DefaultListModel m_ListRowsModel
the model for the combobox with the rows.
-
m_ReportTable
protected adams.gui.visualization.report.ReportFactory.Table m_ReportTable
the table with the report.
-
m_StatusBar
protected adams.gui.core.BaseStatusBar m_StatusBar
for displaying error messages.
-
m_MenuBar
protected JMenuBar m_MenuBar
the menu bar.
-
m_MenuItemReload
protected JMenuItem m_MenuItemReload
the reload menu item.
-
m_MenuItemLoadRecent1
protected JMenuItem m_MenuItemLoadRecent1
the recent file menu item (first file).
-
m_MenuItemLoadRecent2
protected JMenuItem m_MenuItemLoadRecent2
the recent file menu item (second file).
-
m_MenuView
protected JMenu m_MenuView
the menu item for view related stuff.
-
m_MenuItemViewAntiAliasing
protected JMenuItem m_MenuItemViewAntiAliasing
the toggle anti-aliasing menu item.
-
m_RecentFilesHandler1
protected adams.gui.core.RecentFilesHandler<JMenu> m_RecentFilesHandler1
the recent files handler.
-
m_RecentFilesHandler2
protected adams.gui.core.RecentFilesHandler<JMenu> m_RecentFilesHandler2
the recent files handler.
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classadams.gui.core.BasePanel
-
initGUI
protected void initGUI()
Initializes the widgets.- Overrides:
initGUI
in classadams.gui.core.BasePanel
-
getMenuBar
public JMenuBar getMenuBar()
Creates a menu bar (singleton per panel object). Can be used in frames.- Specified by:
getMenuBar
in interfaceadams.gui.core.MenuBarProvider
- Returns:
- the menu bar
-
updateMenu
protected void updateMenu()
updates the enabled state of the menu items.
-
reload
public void reload()
Reloads the datasets.
-
close
public void close()
closes the dialog/frame.
-
trimIDs
protected List<String> trimIDs(List<String> list)
Removes the leading 0s.- Parameters:
list
- the list to process- Returns:
- the processed list
-
updateRows
protected void updateRows()
Updates the combobox with the rows.
-
performComparison
protected void performComparison()
Performs the comparison between the rows from the two datasets.
-
showStatus
public void showStatus(String msg)
Displays a message.- Specified by:
showStatus
in interfaceadams.core.StatusMessageHandler
- Parameters:
msg
- the message to display
-
setFirstDataset
public void setFirstDataset(File value)
Sets the first dataset.- Parameters:
value
- the first dataset
-
getFirstDataset
public File getFirstDataset()
Returns the first dataset.- Returns:
- the first dataset
-
setFirstAttributeRange
public void setFirstAttributeRange(String value)
Sets the first attribute range ('first' and 'last' can be used as well).- Parameters:
value
- the attribute range
-
getFirstAttributeRange
public String getFirstAttributeRange()
Returns the first attribute range.- Returns:
- the attribute range
-
setFirstRowIndex
public void setFirstRowIndex(String value)
Sets the first row index ('first' and 'last' can be used as well).- Parameters:
value
- the index of the row attribute
-
getFirstRowIndex
public String getFirstRowIndex()
Returns the first row index.- Returns:
- the index of the row attribute (1-based, 'first', 'last')
-
setSecondDataset
public void setSecondDataset(File value)
Sets the second dataset.- Parameters:
value
- the second dataset
-
getSecondDataset
public File getSecondDataset()
Returns the second dataset.- Returns:
- the second dataset
-
setSecondAttributeRange
public void setSecondAttributeRange(String value)
Sets the second attribute range ('second' and 'last' can be used as well).- Parameters:
value
- the attribute range
-
getSecondAttributeRange
public String getSecondAttributeRange()
Returns the second attribute range.- Returns:
- the attribute range
-
setSecondRowIndex
public void setSecondRowIndex(String value)
Sets the second row index ('second' and 'last' can be used as well).- Parameters:
value
- the index of the row attribute
-
getSecondRowIndex
public String getSecondRowIndex()
Returns the second row index.- Returns:
- the index of the row attribute (2-based, 'second', 'last')
-
cleanUp
public void cleanUp()
Cleans up data structures, frees up memory.- Specified by:
cleanUp
in interfaceadams.core.CleanUpHandler
-
getProperties
public static adams.core.Properties getProperties()
Returns the properties that define the editor.- Returns:
- the properties
-
-