|
||||||||||
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.PreferenceStructureVisualizer
public class PreferenceStructureVisualizer
PreferenceStructureVisualizer. This class draws the preference structure given a classifier and a query instance.
Date created: 08/07/2008
JPanel
,
Serialized FormNested Class Summary | |
---|---|
private class |
PreferenceStructureVisualizer.AxisPanel
Inner class to handle rendering the axis Date created: 08/07/2008 |
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 javax.swing.JButton |
chooseButton
|
protected java.awt.Dimension |
COMBO_SIZE
|
protected javax.swing.JLabel |
dataFileLabel
|
protected weka.gui.ExtensionFileFilter |
m_arffFileFilter
|
protected PreferenceStructurePanel |
m_boundaryPanel
the plotting panel |
protected javax.swing.JComboBox |
m_classAttBox
|
private weka.classifiers.Classifier |
m_classifier
the classifier to use |
protected weka.gui.GenericObjectEditor |
m_classifierEditor
|
protected weka.gui.PropertyPanel |
m_ClassifierPanel
|
protected weka.gui.visualize.ClassPanel |
m_classPanel
|
protected javax.swing.JPanel |
m_controlPanel
|
protected javax.swing.JButton |
m_copyToClipboardBtn
|
protected static boolean |
m_ExitIfNoWindowsOpen
whether the exit if there are no more windows open |
protected javax.swing.JFileChooser |
m_FileChooser
The file chooser for selecting arff files |
protected javax.swing.JButton |
m_GrayscaleBtn
|
protected javax.swing.JComboBox |
m_LooBox
|
protected int |
m_plotAreaHeight
|
protected int |
m_plotAreaWidth
|
protected javax.swing.JButton |
m_startBut
|
private weka.core.Instances |
m_trainingInstances
the training instances |
protected static int |
m_WindowCount
the number of visualizer windows we have open. |
private PreferenceStructureVisualizer.AxisPanel |
m_xAxisPanel
|
private PreferenceStructureVisualizer.AxisPanel |
m_yAxisPanel
|
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 | |
---|---|
PreferenceStructureVisualizer()
Creates a new PreferenceStructureVisualizer instance. |
Method Summary | |
---|---|
private void |
computeBounds()
Sets up the bounds on our x and y axes to fit the dataset. |
private void |
configureForClassAttribute()
Set up the class values combo boxes |
static void |
createNewVisualizerWindow(weka.classifiers.Classifier classifier,
weka.core.Instances instances)
Creates a new GUI window with all of the PreferenceStructureVisualizer trappings, |
void |
fillFrame(java.awt.Component frame)
Fills the frame with life, like adding components, window listeners, setting size, location, etc. |
java.awt.event.ActionListener |
getActionListener(javax.swing.JFrame owner)
If the extension has a custom ActionListener for the menu item, then it must be returned here. |
static boolean |
getExitIfNoWindowsOpen()
Gets whether System.exit gets called after the last window gets closed |
weka.core.Instances |
getInstances()
Get the training instances |
java.lang.String |
getMenuTitle()
Returns the name of the menu item. |
java.lang.String |
getSubmenuTitle()
Returns the name of the submenu. |
void |
plotTrainingData()
Plots the training data on-screen. |
void |
setClassifier(weka.classifiers.Classifier newClassifier)
Set a classifier to use |
private void |
setControlEnabledStatus(boolean status)
Set the enabled status of the controls |
static void |
setExitIfNoWindowsOpen(boolean value)
Sets whether System.exit gets called when no more windows are open. |
void |
setInstances(weka.core.Instances inst)
Set the training instances |
void |
setInstancesFromFileQ()
Queries the user for a file to load instances from, then loads the instances in a background process. |
int |
setUpBoundaryPanel()
Sets up the BoundaryPanel object so that it is ready for plotting. |
void |
stopPlotting()
Stops the plotting thread. |
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, 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 |
---|
private static final long serialVersionUID
protected static int m_WindowCount
protected static boolean m_ExitIfNoWindowsOpen
private weka.core.Instances m_trainingInstances
private weka.classifiers.Classifier m_classifier
protected int m_plotAreaWidth
protected int m_plotAreaHeight
protected PreferenceStructurePanel m_boundaryPanel
protected javax.swing.JComboBox m_classAttBox
protected javax.swing.JComboBox m_LooBox
protected java.awt.Dimension COMBO_SIZE
protected javax.swing.JButton m_startBut
protected javax.swing.JButton m_GrayscaleBtn
protected javax.swing.JButton m_copyToClipboardBtn
protected javax.swing.JPanel m_controlPanel
protected weka.gui.visualize.ClassPanel m_classPanel
private PreferenceStructureVisualizer.AxisPanel m_xAxisPanel
private PreferenceStructureVisualizer.AxisPanel m_yAxisPanel
protected weka.gui.GenericObjectEditor m_classifierEditor
protected weka.gui.PropertyPanel m_ClassifierPanel
protected javax.swing.JFileChooser m_FileChooser
protected weka.gui.ExtensionFileFilter m_arffFileFilter
protected javax.swing.JLabel dataFileLabel
protected javax.swing.JButton chooseButton
Constructor Detail |
---|
public PreferenceStructureVisualizer()
PreferenceStructureVisualizer
instance.
Method Detail |
---|
private void setControlEnabledStatus(boolean status)
status
- a boolean
valuepublic void setClassifier(weka.classifiers.Classifier newClassifier) throws java.lang.Exception
newClassifier
- the classifier to use
java.lang.Exception
- if an error occursprivate void computeBounds()
public weka.core.Instances getInstances()
public void setInstances(weka.core.Instances inst) throws java.lang.Exception
inst
- the instances to use
java.lang.Exception
private void configureForClassAttribute()
public void setInstancesFromFileQ()
public int setUpBoundaryPanel() throws java.lang.Exception
java.lang.Exception
public void plotTrainingData() throws java.lang.Exception
java.lang.Exception
public void stopPlotting()
public static void setExitIfNoWindowsOpen(boolean value)
value
- if TRUE then a System.exit call is ossued after the last
window gets closed.public static boolean getExitIfNoWindowsOpen()
public static void createNewVisualizerWindow(weka.classifiers.Classifier classifier, weka.core.Instances instances) throws java.lang.Exception
classifier
- The classifier to use in the new window. May be null.instances
- The dataset to visualize on in the new window. May be null.
java.lang.Exception
public void fillFrame(java.awt.Component frame)
weka.gui.MainMenuExtension
JFrame
or from JInternalFrame
. This method is
only called in case getActionListener()
returns null.
fillFrame
in interface weka.gui.MainMenuExtension
frame
- the frame object to embed components, etc.MainMenuExtension.getActionListener(JFrame)
,
JFrame
,
JInternalFrame
public java.awt.event.ActionListener getActionListener(javax.swing.JFrame owner)
weka.gui.MainMenuExtension
ActionListener
also
means that the component handles any frame by itself.
getActionListener
in interface weka.gui.MainMenuExtension
owner
- the owner of potential dialogs
MainMenuExtension.fillFrame(Component)
public java.lang.String getMenuTitle()
weka.gui.MainMenuExtension
getMenuTitle
in interface weka.gui.MainMenuExtension
public java.lang.String getSubmenuTitle()
weka.gui.MainMenuExtension
getSubmenuTitle
in interface weka.gui.MainMenuExtension
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |