Package adams.gui.visualization.instance
Class InstanceComparePanel.DatasetPanel
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- adams.gui.core.BasePanel
-
- adams.gui.visualization.instance.InstanceComparePanel.DatasetPanel
-
- All Implemented Interfaces:
ImageObserver
,MenuContainer
,Serializable
,Accessible
- Enclosing class:
- InstanceComparePanel
public static class InstanceComparePanel.DatasetPanel extends BasePanel
Specialized panel for loading dataset and setting various parameters.- 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 String
m_BorderTitle
the border title.protected BaseButton
m_ButtonDisplay
the button for displaying the dataset.protected HashSet<ChangeListener>
m_ChangeListeners
the change listeners.protected BaseComboBox
m_ComboBoxRowAttribute
the combobox with the attribute names.protected DefaultComboBoxModel
m_ComboBoxRowAttributeModel
the underlying model for the comboxbox.protected String
m_ID
the ID to use for the returned instances.protected InstanceComparePanel.DatasetIndexer
m_Indexer
the currently loaded dataset.protected JLabel
m_LabelAttributeRange
the label for the range.protected JLabel
m_LabelRowAttribute
the label for the attribute names.protected DatasetFileChooserPanel
m_PanelDataset
the panel for loading the file.protected BaseTextField
m_TextAttributeRange
the edit field for the range.-
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 DatasetPanel(String title, String id)
Initializes the panel.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChangeListener(ChangeListener l)
Adds the change listener to the internal list.protected void
displayDataset()
Displays the dataset in a separate window.void
fireSetupChanged()
Fires a ChangeEvent that the setup has changed.String
getAttributeRange()
Returns the current range of attributes.String
getBorderTitle()
Returns the title of the border.File
getDataset()
Return the currently selected dataset.String
getID()
Returns the ID to use for the returned instances.Instance
getRow(String row)
Returns the row to display.String
getRowIndex()
Returns the currently selected.List<String>
getRows()
Returns a list of row IDs.boolean
hasDataset()
Checks whether an existing file has been set.protected void
initGUI()
Initializes the widgets.protected void
initialize()
Initializes the members.boolean
isString()
Returns whether the index values are nominal/string or numeric.protected void
loadDataset()
Loads the dataset, if possible.protected void
notifyChangeListeners(ChangeEvent e)
Sends the event to all change listeners.void
reload()
Reloads the currently loaded dataset.void
removeChangeListener(ChangeListener l)
Removes the change listener from the internal list.void
setAttributeRange(String value)
Sets the range of attributes.void
setBorderTitle(String value)
Sets the title of the border.void
setDataset(File value)
Sets the dataset to use.void
setID(String value)
Sets the ID to use for the returned instances.void
setRowIndex(String value)
Sets the index of the attribute to use for matching rows (only works if dataset already loaded).protected void
update()
Updates buttons, etc.-
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
-
m_Indexer
protected InstanceComparePanel.DatasetIndexer m_Indexer
the currently loaded dataset.
-
m_BorderTitle
protected String m_BorderTitle
the border title.
-
m_ID
protected String m_ID
the ID to use for the returned instances.
-
m_PanelDataset
protected DatasetFileChooserPanel m_PanelDataset
the panel for loading the file.
-
m_ButtonDisplay
protected BaseButton m_ButtonDisplay
the button for displaying the dataset.
-
m_TextAttributeRange
protected BaseTextField m_TextAttributeRange
the edit field for the range.
-
m_LabelAttributeRange
protected JLabel m_LabelAttributeRange
the label for the range.
-
m_ComboBoxRowAttribute
protected BaseComboBox m_ComboBoxRowAttribute
the combobox with the attribute names.
-
m_ComboBoxRowAttributeModel
protected DefaultComboBoxModel m_ComboBoxRowAttributeModel
the underlying model for the comboxbox.
-
m_LabelRowAttribute
protected JLabel m_LabelRowAttribute
the label for the attribute names.
-
m_ChangeListeners
protected HashSet<ChangeListener> m_ChangeListeners
the change listeners.
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classBasePanel
-
setBorderTitle
public void setBorderTitle(String value)
Sets the title of the border.- Parameters:
value
- the title
-
getBorderTitle
public String getBorderTitle()
Returns the title of the border.- Returns:
- the title
-
setID
public void setID(String value)
Sets the ID to use for the returned instances.- Parameters:
value
- the ID
-
getID
public String getID()
Returns the ID to use for the returned instances.- Returns:
- the ID
-
setDataset
public void setDataset(File value)
Sets the dataset to use.- Parameters:
value
- the dataset
-
getDataset
public File getDataset()
Return the currently selected dataset.- Returns:
- the dataset
-
hasDataset
public boolean hasDataset()
Checks whether an existing file has been set.- Returns:
- true if an existing file has been set
-
setAttributeRange
public void setAttributeRange(String value)
Sets the range of attributes.- Parameters:
value
- the range
-
getAttributeRange
public String getAttributeRange()
Returns the current range of attributes.- Returns:
- the range
-
setRowIndex
public void setRowIndex(String value)
Sets the index of the attribute to use for matching rows (only works if dataset already loaded).- Parameters:
value
- the index (1-based, first and last OK as well), use "" to not use a specific attribute.
-
getRowIndex
public String getRowIndex()
Returns the currently selected.- Returns:
- the range
-
update
protected void update()
Updates buttons, etc.
-
reload
public void reload()
Reloads the currently loaded dataset.
-
loadDataset
protected void loadDataset()
Loads the dataset, if possible.
-
displayDataset
protected void displayDataset()
Displays the dataset in a separate window.
-
getRow
public Instance getRow(String row)
Returns the row to display.- Parameters:
row
- the ID of the row to retrieve- Returns:
- the Instance, can be null
-
isString
public boolean isString()
Returns whether the index values are nominal/string or numeric.- Returns:
- true if index is nominal/string
-
addChangeListener
public void addChangeListener(ChangeListener l)
Adds the change listener to the internal list.- Parameters:
l
- the listener to add
-
removeChangeListener
public void removeChangeListener(ChangeListener l)
Removes the change listener from the internal list.- Parameters:
l
- the listener to remove
-
notifyChangeListeners
protected void notifyChangeListeners(ChangeEvent e)
Sends the event to all change listeners.- Parameters:
e
- the event to send
-
fireSetupChanged
public void fireSetupChanged()
Fires a ChangeEvent that the setup has changed.
-
-