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:
CleanUpHandler,StatusMessageHandler,MenuBarProvider,ImageObserver,MenuContainer,Serializable,Accessible
public class InstanceComparePanel extends BasePanel implements StatusMessageHandler, CleanUpHandler, 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 classInstanceComparePanel.DatasetIndexerHelper class for indexing the rows of a dataset.static classInstanceComparePanel.DatasetPanelSpecialized 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 StringFILENAMEthe name of the props file.protected JLabelm_LabelRowsthe label for the combobox.protected BaseListm_ListRowsthe JLiast with the rows.protected DefaultListModelm_ListRowsModelthe model for the combobox with the rows.protected JMenuBarm_MenuBarthe menu bar.protected JMenuItemm_MenuItemLoadRecent1the recent file menu item (first file).protected JMenuItemm_MenuItemLoadRecent2the recent file menu item (second file).protected JMenuItemm_MenuItemReloadthe reload menu item.protected JMenuItemm_MenuItemViewAntiAliasingthe toggle anti-aliasing menu item.protected JMenum_MenuViewthe menu item for view related stuff.protected InstancePanelm_PanelComparisonthe panel for displaying the two instances.protected InstanceComparePanel.DatasetPanelm_PanelDataset1the panel for the first dataset.protected InstanceComparePanel.DatasetPanelm_PanelDataset2the panel for the second dataset.protected InstancePanelm_PanelDifferencethe panel with the difference.protected static Propertiesm_Propertiesthe properties.protected RecentFilesHandler<JMenu>m_RecentFilesHandler1the recent files handler.protected RecentFilesHandler<JMenu>m_RecentFilesHandler2the recent files handler.protected ReportFactory.Tablem_ReportTablethe table with the report.protected List<String>m_RowIndexthe internal index.protected BaseStatusBarm_StatusBarfor displaying error messages.static StringSESSION_FILE_1the file to store the recent files in (first file).static StringSESSION_FILE_2the file to store the recent files in (second file).-
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 InstanceComparePanel()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanUp()Cleans up data structures, frees up memory.voidclose()closes the dialog/frame.StringgetFirstAttributeRange()Returns the first attribute range.FilegetFirstDataset()Returns the first dataset.StringgetFirstRowIndex()Returns the first row index.JMenuBargetMenuBar()Creates a menu bar (singleton per panel object).static PropertiesgetProperties()Returns the properties that define the editor.StringgetSecondAttributeRange()Returns the second attribute range.FilegetSecondDataset()Returns the second dataset.StringgetSecondRowIndex()Returns the second row index.protected voidinitGUI()Initializes the widgets.protected voidinitialize()Initializes the members.protected voidperformComparison()Performs the comparison between the rows from the two datasets.voidreload()Reloads the datasets.voidsetFirstAttributeRange(String value)Sets the first attribute range ('first' and 'last' can be used as well).voidsetFirstDataset(File value)Sets the first dataset.voidsetFirstRowIndex(String value)Sets the first row index ('first' and 'last' can be used as well).voidsetSecondAttributeRange(String value)Sets the second attribute range ('second' and 'last' can be used as well).voidsetSecondDataset(File value)Sets the second dataset.voidsetSecondRowIndex(String value)Sets the second row index ('second' and 'last' can be used as well).voidshowStatus(String msg)Displays a message.protected List<String>trimIDs(List<String> list)Removes the leading 0s.protected voidupdateMenu()updates the enabled state of the menu items.protected voidupdateRows()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 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 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 ReportFactory.Table m_ReportTable
the table with the report.
-
m_StatusBar
protected 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 RecentFilesHandler<JMenu> m_RecentFilesHandler1
the recent files handler.
-
m_RecentFilesHandler2
protected RecentFilesHandler<JMenu> m_RecentFilesHandler2
the recent files handler.
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initializein 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 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:
showStatusin interfaceStatusMessageHandler- 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:
cleanUpin interfaceCleanUpHandler
-
getProperties
public static Properties getProperties()
Returns the properties that define the editor.- Returns:
- the properties
-
-