milk.visualize
Class MIPlot2D

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--weka.gui.visualize.Plot2D
                                |
                                +--milk.visualize.MIPlot2D
All Implemented Interfaces:
javax.accessibility.Accessible, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.Serializable

public class MIPlot2D
extends weka.gui.visualize.Plot2D
implements java.beans.PropertyChangeListener

This class is similar to the Plot2D class except that it also draws the ID of exemplar on each instance point.

It sets up one PlotData2D for each exemplar and plots all the PlotData2D stored.

See Also:
Serialized Form

Field Summary
protected  Exemplars plotExemplars
          The instances to be plotted
protected  Axis x
          The x and y axis, max and min values are of all the exemplars
protected  Axis y
          The x and y axis, max and min values are of all the exemplars
 
Fields inherited from class weka.gui.visualize.Plot2D
CONST_AUTOMATIC_SHAPE, DEFAULT_SHAPE_SIZE, DIAMOND_SHAPE, ERROR_SHAPE, m_axisChanged, m_axisColour, m_axisPad, m_backgroundColour, m_cIndex, m_colorList, m_DefaultColors, m_drawnPoints, m_InstanceInfo, m_InstanceInfoText, m_JitterVal, m_JRand, m_labelFont, m_labelMetrics, m_masterName, m_masterPlot, m_maxC, m_maxX, m_maxY, m_minC, m_minX, m_minY, m_plotCompanion, m_plotInstances, m_plotResize, m_plots, m_pointLookup, m_sIndex, m_tickSize, m_XaxisEnd, m_XaxisStart, m_xIndex, m_YaxisEnd, m_YaxisStart, m_yIndex, MAX_SHAPES, MISSING_SHAPE, PLUS_SHAPE, TRIANGLEDOWN_SHAPE, TRIANGLEUP_SHAPE, X_SHAPE
 
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
MIPlot2D()
          Constructor
 
Method Summary
 void paintComponent(java.awt.Graphics gx)
          Renders this component
 void propertyChange(java.beans.PropertyChangeEvent pce)
          The handler function when property changes are informed.
 void setMaxC(double maxc)
          Set the max color if the class is numeric
Before it's stored in m_maxC, it's stored in the tempory variable maxC.
 void setMinC(double minc)
          Set the min color if the class is numeric
Before it's stored in m_minC, it's stored in the tempory variable minC.
 void setPlotExemplars(Exemplars added)
          Sets the plot vectors from a set of exemplars
 void setX(Axis anx)
          Set the index and value of the attribute to go on the x axis
Before it's stored in m_xIndex, m_maxX and m_minX, it's stored in the tempory variable x.
 void setY(Axis ay)
          Set the index and value of the attribute to go on the y axis
Before it's stored in m_yIndex, m_maxY and m_minY, it's stored in the tempory variable y.
 
Methods inherited from class weka.gui.visualize.Plot2D
addPlot, convertToAttribX, convertToAttribY, convertToPanelX, convertToPanelY, determineBounds, drawDataPoint, drawDataPoint, getMasterPlot, getMaxC, getMaxX, getMaxY, getMinC, getMinX, getMinY, getPlots, main, removeAllPlots, searchPoints, setCindex, setColours, setInstances, setJitter, setMasterPlot, setPlotCompanion, setXindex, setYindex
 
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, 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

plotExemplars

protected Exemplars plotExemplars
The instances to be plotted


x

protected Axis x
The x and y axis, max and min values are of all the exemplars


y

protected Axis y
The x and y axis, max and min values are of all the exemplars

Constructor Detail

MIPlot2D

public MIPlot2D()
Constructor

Method Detail

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent pce)
The handler function when property changes are informed. there are lots of properties can be listened by this class: the exemplars to be plotted, the colors from the ClassPanel, x and y axis value and index. Only all these parameters are set can the geometric display be plotted

Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Parameters:
pce - the property change event

setX

public void setX(Axis anx)
Set the index and value of the attribute to go on the x axis
Before it's stored in m_xIndex, m_maxX and m_minX, it's stored in the tempory variable x. This treatment is to walk around the super.determineBounds() function, which will incorrectly set up the bounds in this context.

Parameters:
anx - the index of the attribute to use on the x axis

setY

public void setY(Axis ay)
Set the index and value of the attribute to go on the y axis
Before it's stored in m_yIndex, m_maxY and m_minY, it's stored in the tempory variable y. This treatment is to walk around the super.determineBounds() function, which will incorrectly set up the bounds in this context.

Parameters:
ay - the index of the attribute to use on the y axis

setMaxC

public void setMaxC(double maxc)
Set the max color if the class is numeric
Before it's stored in m_maxC, it's stored in the tempory variable maxC. This treatment is to walk around the super.determineBounds() function, which will incorrectly set up the bounds in this context.

Parameters:
maxc - max bound of color

setMinC

public void setMinC(double minc)
Set the min color if the class is numeric
Before it's stored in m_minC, it's stored in the tempory variable minC. This treatment is to walk around the super.determineBounds() function, which will incorrectly set up the bounds in this context.

Parameters:
minc - min bound of color

setPlotExemplars

public void setPlotExemplars(Exemplars added)
                      throws java.lang.Exception
Sets the plot vectors from a set of exemplars

Parameters:
added - the exemplars
Throws:
exception - Exception if plots could not be set
java.lang.Exception

paintComponent

public void paintComponent(java.awt.Graphics gx)
Renders this component

Overrides:
paintComponent in class weka.gui.visualize.Plot2D
Parameters:
gx - the graphics context