weka.gui.visualize
Class MatrixPanel

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended byweka.gui.visualize.MatrixPanel
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class MatrixPanel
extends javax.swing.JPanel

This panel displays a plot matrix of the user selected attributes of a given data set. The datapoints are coloured using a discrete colouring set if the user has selected a nominal attribute for colouring. If the user has selected a numeric attribute then the datapoints are coloured using a colour spectrum ranging from blue to red (low values to high). Datapoints missing a class value are displayed in black.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  javax.swing.JSplitPane jp
          Split pane for splitting the matrix and the buttons and bars
protected  javax.swing.JList m_attribList
          The list for selecting the attributes to display the plot matrix
protected  javax.swing.JSlider m_cellSize
          The slider to adjust the size of the cells in the matrix
protected  javax.swing.JComboBox m_classAttrib
          The combo box to allow user to select the colouring attribute
protected  ClassPanel m_cp
          The panel that displays the legend of the colouring attribute
protected  Instances m_data
          The dataset for which this panel will display the plot matrix for
protected  javax.swing.JSlider m_jitter
          The slider to add jitter to the plots
protected  javax.swing.JScrollPane m_js
          The scroll pane to scrolling the matrix
protected  javax.swing.JButton m_resampleBt
          The label for resample percentage
protected  javax.swing.JTextField m_resamplePercent
          The text area for percentage to resample data
protected  javax.swing.JTextField m_rseed
          Random seed for random subsample
protected  javax.swing.JButton m_selAttrib
          The button to display a window to select attributes
protected  javax.swing.JButton m_updateBt
          The button that updates the display to reflect the changes made by the user.
protected  javax.swing.JPanel optionsPanel
          The panel that contains all the buttons and tools, i.e.
protected  javax.swing.JRadioButton origDist
          For selecting same class distribution in the subsample as in the input
protected  javax.swing.JRadioButton unifDist
          For selecting uniform class distribution in the subsample
 
Fields inherited from class javax.swing.JComponent
accessibleContext, 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
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
MatrixPanel()
          Constructor
 
Method Summary
 void initInternalFields()
          Initializes internal data fields, i.e.
static void main(java.lang.String[] args)
          Main method for testing this class
 void setInstances(Instances newInst)
          This method changes the Instances object of this class to a new one.
 void setPercent()
          Calculates the percentage to resample
 void setupAttribLists()
          Sets up the UI's attributes lists
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_cp

protected final ClassPanel m_cp
The panel that displays the legend of the colouring attribute


optionsPanel

protected javax.swing.JPanel optionsPanel
The panel that contains all the buttons and tools, i.e. resize, jitter bars and sub-sampling buttons etc on the bottom of the panel


jp

protected javax.swing.JSplitPane jp
Split pane for splitting the matrix and the buttons and bars


m_updateBt

protected javax.swing.JButton m_updateBt
The button that updates the display to reflect the changes made by the user. E.g. changed attribute set for the matrix


m_selAttrib

protected javax.swing.JButton m_selAttrib
The button to display a window to select attributes


m_data

protected Instances m_data
The dataset for which this panel will display the plot matrix for


m_attribList

protected javax.swing.JList m_attribList
The list for selecting the attributes to display the plot matrix


m_js

protected final javax.swing.JScrollPane m_js
The scroll pane to scrolling the matrix


m_classAttrib

protected javax.swing.JComboBox m_classAttrib
The combo box to allow user to select the colouring attribute


m_cellSize

protected javax.swing.JSlider m_cellSize
The slider to adjust the size of the cells in the matrix


m_jitter

protected javax.swing.JSlider m_jitter
The slider to add jitter to the plots


m_resamplePercent

protected javax.swing.JTextField m_resamplePercent
The text area for percentage to resample data


m_resampleBt

protected javax.swing.JButton m_resampleBt
The label for resample percentage


m_rseed

protected javax.swing.JTextField m_rseed
Random seed for random subsample


origDist

protected javax.swing.JRadioButton origDist
For selecting same class distribution in the subsample as in the input


unifDist

protected javax.swing.JRadioButton unifDist
For selecting uniform class distribution in the subsample

Constructor Detail

MatrixPanel

public MatrixPanel()
Constructor

Method Detail

initInternalFields

public void initInternalFields()
Initializes internal data fields, i.e. data values, type, missing and color cache arrays


setupAttribLists

public void setupAttribLists()
Sets up the UI's attributes lists


setPercent

public void setPercent()
Calculates the percentage to resample


setInstances

public void setInstances(Instances newInst)
This method changes the Instances object of this class to a new one. It also does all the necessary initializations for displaying the panel. This must be called before trying to display the panel.

Parameters:
newInst - The new set of Instances

main

public static void main(java.lang.String[] args)
Main method for testing this class