|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
weka.gui.extensions.PreferenceStructurePanel
public class PreferenceStructurePanel
PreferenceStructurePanel. A class to generate a visualization of a fuzzy preference structure. Date created: 08/07/2008
JPanel
,
Serialized FormNested Class Summary | |
---|---|
private class |
PreferenceStructurePanel.PlotPanel
small inner class for rendering the bitmap on to |
protected class |
PreferenceStructurePanel.PlotThread
|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected weka.classifiers.Classifier |
m_classifier
distribution classifier to use |
protected boolean |
m_classifierWasBuilt
Flag marking that a classifier was built |
protected boolean |
m_Grayscale
Switch between colored and grayscale output |
protected weka.core.Instance |
m_Instance
The instance for which the preference structure shall be visualized |
protected java.lang.String |
m_latexCode
|
private java.util.Vector |
m_listeners
listeners to be notified when plot is complete |
protected weka.core.Instances |
m_LOOData
The whole dataset without one instance which preference structure shall be visualized |
protected double |
m_maxX
|
protected double |
m_maxY
|
protected double |
m_minX
|
protected double |
m_minY
|
protected java.awt.Image |
m_osi
used for offscreen drawing |
protected double |
m_pixHeight
|
protected double |
m_pixWidth
|
private PreferenceStructurePanel.PlotPanel |
m_plotPanel
the actual plotting area |
private java.lang.Thread |
m_plotThread
thread for running the plotting operation in |
protected boolean |
m_plotTrainingData
plot the training data |
protected boolean |
m_stopPlotting
Stop the plotting thread |
protected boolean |
m_stopReplotting
Stop any replotting threads |
protected weka.core.Instances |
m_trainingData
training data |
protected int |
m_xAttribute
|
protected int |
m_yAttribute
|
private static long |
serialVersionUID
for serialization |
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 | |
---|---|
PreferenceStructurePanel(int panelWidth,
int panelHeight)
Creates a new PreferenceStructurePanel instance. |
Method Summary | |
---|---|
void |
addActionListener(java.awt.event.ActionListener newListener)
Register a listener to be notified when plotting completes |
void |
addMouseListener(java.awt.event.MouseListener l)
Adds a mouse listener. |
boolean |
getPlotTrainingData()
Returns true if training data is to be superimposed |
protected void |
initialize()
Set up the off screen bitmap for rendering to |
void |
plotTrainingData()
Render the training points on-screen. |
void |
removeActionListener(java.awt.event.ActionListener removeListener)
Remove a listener |
void |
replot()
Quickly replot the display using cached probability estimates |
protected void |
saveImage(java.lang.String fileName)
|
void |
setClassifier(weka.classifiers.Classifier classifier)
Set the classifier to use. |
void |
setPlotTrainingData(boolean pg)
Set whether to superimpose the training data plot |
void |
setTrainingData(weka.core.Instances trainingData)
Set the training data to use |
void |
setXAttribute(int xatt)
Set the x attribute index |
void |
setYAttribute(int yatt)
Set the y attribute index |
void |
start()
Start the plotting thread |
void |
startPlotThread()
Starts the plotting thread. |
void |
stopPlotting()
Stop the plotting thread |
private void |
update()
Update the rendered image. |
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, 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, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, 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, setVisible, 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, 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 |
---|
private static final long serialVersionUID
protected weka.core.Instances m_trainingData
protected weka.core.Instances m_LOOData
protected weka.core.Instance m_Instance
protected weka.classifiers.Classifier m_classifier
protected boolean m_classifierWasBuilt
protected boolean m_Grayscale
protected int m_xAttribute
protected int m_yAttribute
protected double m_minX
protected double m_minY
protected double m_maxX
protected double m_maxY
protected java.lang.String m_latexCode
protected double m_pixHeight
protected double m_pixWidth
protected java.awt.Image m_osi
private java.util.Vector m_listeners
private PreferenceStructurePanel.PlotPanel m_plotPanel
private java.lang.Thread m_plotThread
protected boolean m_stopPlotting
protected boolean m_stopReplotting
protected boolean m_plotTrainingData
Constructor Detail |
---|
public PreferenceStructurePanel(int panelWidth, int panelHeight)
PreferenceStructurePanel
instance.
panelWidth
- the width in pixels of the panelpanelHeight
- the height in pixels of the panelMethod Detail |
---|
protected void initialize()
public void stopPlotting()
public void start() throws java.lang.Exception
java.lang.Exception
- if an error occurspublic void plotTrainingData()
private void update()
public void setTrainingData(weka.core.Instances trainingData) throws java.lang.Exception
trainingData
- the training data
java.lang.Exception
- if an error occurspublic void addActionListener(java.awt.event.ActionListener newListener)
newListener
- the listener to addpublic void removeActionListener(java.awt.event.ActionListener removeListener)
removeListener
- the listener to removepublic void setClassifier(weka.classifiers.Classifier classifier)
classifier
- the classifier to usepublic void setXAttribute(int xatt) throws java.lang.Exception
xatt
- index of the attribute to use on the x axis
java.lang.Exception
- if an error occurspublic void setYAttribute(int yatt) throws java.lang.Exception
yatt
- index of the attribute to use on the y axis
java.lang.Exception
- if an error occurspublic void setPlotTrainingData(boolean pg)
pg
- a boolean
valuepublic boolean getPlotTrainingData()
boolean
valuepublic void replot()
protected void saveImage(java.lang.String fileName)
public void startPlotThread()
public void addMouseListener(java.awt.event.MouseListener l)
addMouseListener
in class java.awt.Component
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |