|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPanel | +--weka.gui.visualize.VisualizePanel
This panel allows the user to visualize a dataset (and if provided) a
classifier's/clusterer's predictions in two dimensions.
If the user selects a nominal attribute as the colouring attribute then
each point is drawn in a colour that corresponds to the discrete value
of that attribute for the instance. If the user selects a numeric
attribute to colour on, then the points are coloured using a spectrum
ranging from blue to red (low values to high).
When a classifier's predictions are supplied they are plotted in one
of two ways (depending on whether the class is nominal or numeric).
For nominal class: an error made by a classifier is plotted as a square
in the colour corresponding to the class it predicted.
For numeric class: predictions are plotted as varying sized x's, where
the size of the x is related to the magnitude of the error.
Field Summary |
Fields inherited from class javax.swing.JComponent |
TOOL_TIP_TEXT_KEY, 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 | |
VisualizePanel()
Constructor |
|
VisualizePanel(VisualizePanelListener ls)
This constructor allows a VisualizePanelListener to be set. |
Method Summary | |
void |
addActionListener(java.awt.event.ActionListener act)
Add a listener for this visualize panel |
void |
addPlot(PlotData2D newPlot)
Set a new plot to the visualize panel |
int |
getCIndex()
Get the index of the attribute selected for coloring |
Instances |
getInstances()
Get the master plot's instances |
java.lang.String |
getName()
Returns the name associated with this plot. |
int |
getSIndex()
Get the index of the shape selected for creating splits. |
int |
getXIndex()
Get the index of the attribute on the x axis |
int |
getYIndex()
Get the index of the attribute on the y axis |
static void |
main(java.lang.String[] args)
Main method for testing this class |
void |
setColourIndex(int index)
Sets the index used for colouring. |
void |
setInstances(Instances inst)
Tells the panel to use a new set of instances. |
void |
setLog(Logger newLog)
Sets the Logger to receive informational messages |
void |
setMasterPlot(PlotData2D newPlot)
Set the master plot for the visualize panel |
void |
setName(java.lang.String plotName)
Set a name for this plot |
void |
setShapes(FastVector l)
This will set the shapes for the instances. |
void |
setSIndex(int index)
Set the shape for creating splits. |
void |
setUpComboBoxes(Instances inst)
|
void |
setXIndex(int index)
Set the index of the attribute for the x axis |
void |
setYIndex(int index)
Set the index of the attribute for the y axis |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, 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, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, 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, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, 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, 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, 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, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public VisualizePanel(VisualizePanelListener ls)
public VisualizePanel()
Method Detail |
public void setLog(Logger newLog)
newLog
- the Logger that will now get info messagespublic void setColourIndex(int index)
index
- the index of the attribute to use for colouringpublic void setXIndex(int index) throws java.lang.Exception
index
- the index for the x axis
java.lang.Exception
- if index is out of range.public int getXIndex()
public void setYIndex(int index) throws java.lang.Exception
index
- the index for the y axis
java.lang.Exception
- if index is out of range.public int getYIndex()
public int getCIndex()
public int getSIndex()
public void setSIndex(int index) throws java.lang.Exception
index
- The index of the shape.
java.lang.Exception
- if index is out of range.public void addActionListener(java.awt.event.ActionListener act)
act
- an ActionListenerpublic void setName(java.lang.String plotName)
setName
in class java.awt.Component
plotName
- the name for the plotpublic java.lang.String getName()
getName
in class java.awt.Component
public Instances getInstances()
public void setShapes(FastVector l)
l
- A list of the shapes, providing that
the objects in the lists are non editable the data will be
kept intact.public void setInstances(Instances inst)
inst
- a set of Instancespublic void setUpComboBoxes(Instances inst)
public void setMasterPlot(PlotData2D newPlot) throws java.lang.Exception
newPlot
- the new master plot
java.lang.Exception
- if the master plot could not be setpublic void addPlot(PlotData2D newPlot) throws java.lang.Exception
newPlot
- the new plot to add
java.lang.Exception
- if the plot could not be addedpublic static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) 2003 David Lindsay, Computer Learning Research Centre, Dept. Computer Science, Royal Holloway, University of London