adams.gui.visualization.stats.scatterplot
Class Matrix

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by adams.gui.core.BasePanel
                      extended by adams.gui.visualization.stats.scatterplot.Matrix
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class Matrix
extends BasePanel

Displays a grid of scatter plots with each attribute plotted against each of the other attributes, also can choose overlays etc.

Version:
$Revision: 5340 $
Author:
msf8
See Also:
Serialized Form

Nested Class Summary
 class Matrix.action
          Listener for when the update button is pressed
 class Matrix.prop
          Updates the progress bar using the "progress" of the swing worker
 
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
protected  ArrayList<AbstractScatterPlotOverlay> m_Array
          Overlays to be displayed
protected  JProgressBar m_Bar
          Progress bar for displaying update progress
protected  JPanel m_Centre
          Panel for displaying the scatter plots
protected  AbstractScatterPlotPaintlet m_Def
          Default paintlet for GOEpanel
protected  AbstractScatterPlotOverlay[] m_Default
          for default value for overlays
protected  HashSet<String> m_DeleteOverlay
          Commandline strings of overlays to be deleted
protected  boolean m_NeedUpdate
          Whether an update is required, if an option has been changed
protected  HashSet<String> m_NewOverlay
          Commandline strings of new overlays to be added
protected  HashSet<String> m_OldHash
          Commandline strings of overlays before new overlays chosen
protected  ParameterPanel m_OptionPanel
          Panel containing the matrix options
protected  GenericArrayEditorPanel m_PanelOverlay
          Displays a GAE for choosing overlays for the scatter plots
protected  GenericObjectEditorPanel m_PanelPaintlet
          Displas a GOE for choosing the paintlet for the scatterplots
protected  ArrayList<JPanel> m_Panels
          panels displaying names of attributes
protected  int m_Percent
          Percentage of sample to use for sum-sample
protected  JPanel m_Progress
          Panel for displaying the progress bar
protected  ArrayList<ScatterPlotSimple> m_ScatterPlots
          array list contatining all of the scatter plots displayed in this matrix plot
protected  JSpinner m_Spin
          for choosing the size of each scatter plot
protected  JSpinner m_SpinPercent
          Spinner for choosing percent of data to sample
protected  JButton m_Stop
          Button to stop the thread updating the overlays
protected  AbstractScatterPlotPaintlet m_Val
          Paintlet for plotting, chosen using GOE
protected  adams.gui.visualization.stats.scatterplot.Matrix.progressWorker m_Work
          Swing worker for displaying gui during update
 
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
Matrix()
           
 
Method Summary
 void initGUI()
           
protected  void initialize()
           
 void paint(Graphics g)
           
 void redoPaintlets()
          Change the paintlet for each scatterplot
 void reset()
          Called by the class that creates this matrix panel once all he fields have been set
 void setInstances(Instances inst)
          Set the instances to be displayed
 void setOverlays(AbstractScatterPlotOverlay[] val)
          Set the overlays to be applied to each of the scatter plots
 void setPaintlet(AbstractScatterPlotPaintlet val)
          Set the paintlet used for plotting the data on each scatter plot
 void setPercent(int val)
          Set the value to use for the percent subsample
 void setPlotSize(int val)
          Set the size of each of the scatter plots
 void updateOverlays()
          Updates the display.
 
Methods inherited from class adams.gui.core.BasePanel
afterHide, afterShow, beforeHide, beforeShow, closeParent, finishInit, getParentChild, getParentDialog, getParentFrame, getParentInternalFrame, getParentTitle, main, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, 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, 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, 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, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, 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, 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_Centre

protected JPanel m_Centre
Panel for displaying the scatter plots


m_Spin

protected JSpinner m_Spin
for choosing the size of each scatter plot


m_Default

protected AbstractScatterPlotOverlay[] m_Default
for default value for overlays


m_PanelOverlay

protected GenericArrayEditorPanel m_PanelOverlay
Displays a GAE for choosing overlays for the scatter plots


m_PanelPaintlet

protected GenericObjectEditorPanel m_PanelPaintlet
Displas a GOE for choosing the paintlet for the scatterplots


m_Val

protected AbstractScatterPlotPaintlet m_Val
Paintlet for plotting, chosen using GOE


m_ScatterPlots

protected ArrayList<ScatterPlotSimple> m_ScatterPlots
array list contatining all of the scatter plots displayed in this matrix plot


m_Array

protected ArrayList<AbstractScatterPlotOverlay> m_Array
Overlays to be displayed


m_OldHash

protected HashSet<String> m_OldHash
Commandline strings of overlays before new overlays chosen


m_Def

protected AbstractScatterPlotPaintlet m_Def
Default paintlet for GOEpanel


m_Panels

protected ArrayList<JPanel> m_Panels
panels displaying names of attributes


m_Percent

protected int m_Percent
Percentage of sample to use for sum-sample


m_SpinPercent

protected JSpinner m_SpinPercent
Spinner for choosing percent of data to sample


m_DeleteOverlay

protected HashSet<String> m_DeleteOverlay
Commandline strings of overlays to be deleted


m_NewOverlay

protected HashSet<String> m_NewOverlay
Commandline strings of new overlays to be added


m_Bar

protected JProgressBar m_Bar
Progress bar for displaying update progress


m_Work

protected adams.gui.visualization.stats.scatterplot.Matrix.progressWorker m_Work
Swing worker for displaying gui during update


m_Progress

protected JPanel m_Progress
Panel for displaying the progress bar


m_NeedUpdate

protected boolean m_NeedUpdate
Whether an update is required, if an option has been changed


m_Stop

protected JButton m_Stop
Button to stop the thread updating the overlays


m_OptionPanel

protected ParameterPanel m_OptionPanel
Panel containing the matrix options

Constructor Detail

Matrix

public Matrix()
Method Detail

initialize

protected void initialize()
Overrides:
initialize in class BasePanel

setInstances

public void setInstances(Instances inst)
Set the instances to be displayed

Parameters:
inst - Instances containing the data

updateOverlays

public void updateOverlays()
Updates the display. Uses the swing worker and shows a progress bar during updating


redoPaintlets

public void redoPaintlets()
Change the paintlet for each scatterplot


initGUI

public void initGUI()
Overrides:
initGUI in class BasePanel

reset

public void reset()
Called by the class that creates this matrix panel once all he fields have been set


setPaintlet

public void setPaintlet(AbstractScatterPlotPaintlet val)
Set the paintlet used for plotting the data on each scatter plot

Parameters:
val - Paintlet used

setOverlays

public void setOverlays(AbstractScatterPlotOverlay[] val)
Set the overlays to be applied to each of the scatter plots

Parameters:
val - Array of overlays to be applied

setPlotSize

public void setPlotSize(int val)
Set the size of each of the scatter plots

Parameters:
val - Size in pixels

paint

public void paint(Graphics g)
Overrides:
paint in class JComponent

setPercent

public void setPercent(int val)
Set the value to use for the percent subsample

Parameters:
val - Percent of original sample


Copyright © 2013 University of Waikato, Hamilton, NZ. All Rights Reserved.