|
|||||||||
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.Plot2D
This class plots datasets in two dimensions. It can also plot classifier errors and clusterer predictions.
Field Summary | |
static int |
CONST_AUTOMATIC_SHAPE
|
static int |
DEFAULT_SHAPE_SIZE
|
static int |
DIAMOND_SHAPE
|
static int |
ERROR_SHAPE
|
static int |
MAX_SHAPES
|
static int |
MISSING_SHAPE
|
static int |
PLUS_SHAPE
|
static int |
TRIANGLEDOWN_SHAPE
|
static int |
TRIANGLEUP_SHAPE
|
static int |
X_SHAPE
|
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 | |
Plot2D()
Constructor |
Method Summary | |
void |
addPlot(PlotData2D newPlot)
Add a plot to the list of plots to display |
double |
convertToAttribX(double scx)
convert a Panel x coordinate to a raw x value. |
double |
convertToAttribY(double scy)
convert a Panel y coordinate to a raw y value. |
double |
convertToPanelX(double xval)
Convert an raw x value to Panel x coordinate. |
double |
convertToPanelY(double yval)
Convert an raw y value to Panel y coordinate. |
void |
determineBounds()
Determine the min and max values for axis and colouring attributes |
PlotData2D |
getMasterPlot()
Get the master plot |
double |
getMaxC()
Return the current max value of the colouring attribute |
double |
getMaxX()
Return the current max value of the attribute plotted on the x axis |
double |
getMaxY()
Return the current max value of the attribute plotted on the y axis |
double |
getMinC()
Return the current min value of the colouring attribute |
double |
getMinX()
Return the current min value of the attribute plotted on the x axis |
double |
getMinY()
Return the current min value of the attribute plotted on the y axis |
FastVector |
getPlots()
Return the list of plots |
static void |
main(java.lang.String[] args)
Main method for testing this class |
void |
paintComponent(java.awt.Graphics gx)
Renders this component |
void |
removeAllPlots()
Clears all plots |
void |
searchPoints(int x,
int y,
boolean newFrame)
Pops up a window displaying attribute information on any instances at a point+-plotting_point_size (in panel coordinates) |
void |
setCindex(int c)
Set the index of the attribute to use for colouring |
void |
setColours(FastVector cols)
Set a list of colours to use when colouring points according to class values or cluster numbers |
void |
setInstances(Instances inst)
Sets the master plot from a set of instances |
void |
setJitter(int j)
Set level of jitter and repaint the plot using the new jitter value |
void |
setMasterPlot(PlotData2D master)
Set the master plot. |
void |
setPlotCompanion(Plot2DCompanion p)
Set a companion class. |
void |
setXindex(int x)
Set the index of the attribute to go on the x axis |
void |
setYindex(int y)
Set the index of the attribute to go on 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, 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, 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 |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int MAX_SHAPES
public static final int ERROR_SHAPE
public static final int MISSING_SHAPE
public static final int CONST_AUTOMATIC_SHAPE
public static final int X_SHAPE
public static final int PLUS_SHAPE
public static final int DIAMOND_SHAPE
public static final int TRIANGLEUP_SHAPE
public static final int TRIANGLEDOWN_SHAPE
public static final int DEFAULT_SHAPE_SIZE
Constructor Detail |
public Plot2D()
Method Detail |
public void setPlotCompanion(Plot2DCompanion p)
p
- a companion classpublic void setJitter(int j)
j
- the level of jitterpublic void setColours(FastVector cols)
cols
- the list of colours to usepublic void setXindex(int x)
x
- the index of the attribute to use on the x axispublic void setYindex(int y)
y
- the index of the attribute to use on the y axispublic void setCindex(int c)
c
- the index of the attribute to use for colouringpublic FastVector getPlots()
public PlotData2D getMasterPlot()
public double getMaxX()
public double getMaxY()
public double getMinX()
public double getMinY()
public double getMaxC()
public double getMinC()
public void setInstances(Instances inst) throws java.lang.Exception
inst
- the instances
exception
- Exception if instances could not be set
java.lang.Exception
public void setMasterPlot(PlotData2D master) throws java.lang.Exception
master
- the plot to make the master plot
java.lang.Exception
- if the plot could not be set.public void removeAllPlots()
public void addPlot(PlotData2D newPlot) throws java.lang.Exception
newPlot
- the new plot to add
java.lang.Exception
- if the plot could not be addedpublic void searchPoints(int x, int y, boolean newFrame)
x
- the x value of the clicked pointy
- the y value of the clicked pointnewFrame
- true if instance info is to be displayed in a
new frame.public void determineBounds()
public double convertToAttribX(double scx)
scx
- The Panel x coordinate
public double convertToAttribY(double scy)
scy
- The Panel y coordinate
public double convertToPanelX(double xval)
xval
- the raw x value
public double convertToPanelY(double yval)
yval
- the raw y value
public void paintComponent(java.awt.Graphics gx)
paintComponent
in class javax.swing.JComponent
gx
- the graphics contextpublic static void main(java.lang.String[] args)
args
- arguments
|
|||||||||
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