Package moa.gui.featureanalysis
Class VisualizeFeaturesPanel
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- weka.gui.AbstractPerspective
-
- moa.gui.featureanalysis.VisualizeFeaturesPanel
-
- All Implemented Interfaces:
ImageObserver
,MenuContainer
,Serializable
,Accessible
,weka.gui.Perspective
public class VisualizeFeaturesPanel extends weka.gui.AbstractPerspective
This is VisualizeFeatures tab main panel which loads data stream and shows other sub panels. This panel refers to weka.gui.explorer.PreprocessPanel.- Author:
- Richard Kirkby (rkirkby@cs.waikato.ac.nz), Len Trigg (trigg@cs.waikato.ac.nz), Yongheng Ma (2560653665@qq.com)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VisualizeFeaturesPanel.PreprocessDefaults
-
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
-
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
-
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
-
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
-
Field Summary
Fields Modifier and Type Field Description protected FeatureImportancePanel
fip
This is the FeatureImportance Tab panelprotected AttributeSelectionPanel
m_AttPanel
Panel to let the user toggle attributesprotected AttributeSummaryPanel
m_AttSummaryPanel
Displays summary stats on the selected attributeprotected AttributeVisualizationPanel
m_AttVisualizePanel
The visualization of the attribute valuesprotected JLabel
m_endIndex
The start instance index label to prompt user to input end index numberprotected JFormattedTextField
m_endInstanceInput
Format m_intEndIndexprotected JComboBox
m_featureRangeBox
Set feature range shown in a popup window In default, Nine plots is shown in every popup window at most.protected weka.gui.ConverterFileChooser
m_FileChooser
The file chooser for selecting data filesprotected LineAndScatterPanel
m_graphPanel
This panel is used to draw line graphs or scatter diagramsprotected Instances
m_Instances
The working instancesprotected InstancesSummaryPanel
m_InstSummaryPanel
Displays simple stats on the working instancesprotected int
m_intEndIndex
The end instance index of x axis for line graph or scatter diagramprotected int
m_intStartIndex
The start instance index of x axis for line graph or scatter diagramprotected Thread
m_IOThread
A thread for loading/saving instances from a file or URLprotected weka.gui.Logger
m_Log
The message loggerprotected JButton
m_OpenFileBut
Click to load base instances from a fileprotected JButton
m_plotAmplify
Click to amplify line graph or scatter diagram so that user can see plot more clearlyprotected JComboBox
m_plotTypeBox
plot type drop list: "plot type: Line graph" "plot type: Scatter diagram" "No plot type"protected JButton
m_RemoveButton
Button for removing attributesprotected SamoaToWekaInstanceConverter
m_samoaToWekaInstanceConverter
Instance converter from Samoa instance to Weak Instanceprotected JButton
m_SaveBut
Click to apply filters and save the resultsprotected int
m_selectedPlotTypeIndex
The index of the selected plot type indexprotected JMenu
m_sendToPerspective
For sending instances to various perspectives/tabsprotected JLabel
m_startIndex
The start instance index label to prompt user to input start index numberprotected JFormattedTextField
m_startInstanceInput
Format m_intStartIndexprotected PropertyChangeSupport
m_Support
Manages sending notifications to people when we change the set of working instances.protected JButton
m_visAllGraphBut
Visualize all line graphs or scatter diagrams, not histograms or bar chartsprotected WekaToSamoaInstanceConverter
m_wekaToSamoaInstanceConverter
Instance converter from Weak instance to Samoa Instance-
Fields inherited from class weka.gui.AbstractPerspective
m_isActive, m_isLoaded, m_log, m_mainApplication, m_perspectiveIcon, m_perspectiveID, m_perspectiveTipText, m_perspectiveTitle
-
Fields inherited from class javax.swing.JComponent
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
accessibleContext, 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
Constructors Constructor Description VisualizeFeaturesPanel()
Creates the instances panel with no initial instances.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPropertyChangeListener(PropertyChangeListener l)
Adds a PropertyChangeListener who will be notified of value changes.protected void
applyFilter(weka.filters.Filter filter)
Passes the dataset through the filter that has been configured for use.boolean
endIndexValidation(int endIndex)
void
featureRangeBoxSet(int numAttributes, int maxFeaturesInOneScreen)
Instances
getInstances()
Gets the working set of instances.void
instantiationComplete()
We've been instantiated and now have access to the main application and PerspectiveManagerstatic void
main(String[] args)
Tests out the instance-preprocessing panel from the command line.void
removePropertyChangeListener(PropertyChangeListener l)
Removes a PropertyChangeListener.void
saveInstancesToFile(weka.core.converters.AbstractFileSaver saver, weka.core.Instances inst)
saves the data with the specified savervoid
saveWorkingInstancesToFileQ()
Queries the user for a file to save instances as, then saves the instances in a background process.void
setInstances(Instances inst)
Tells the panel to use a new base set of instances.void
setInstancesFromFile2(String selectedFile)
void
setInstancesFromFileQ()
Queries the user for a file to load instances from, then loads the instances in a background process.void
setLog(weka.gui.Logger newLog)
Sets the Logger to receive informational messagesboolean
startIndexValidation(int startIndex)
-
Methods inherited from class weka.gui.AbstractPerspective
acceptsInstances, getDefaultSettings, getMainApplication, getMenus, getPerspectiveIcon, getPerspectiveID, getPerspectiveTipText, getPerspectiveTitle, okToBeActive, requiresLog, setActive, setInstances, setLoaded, setMainApplication, settingsChanged, terminate, toString
-
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, getBaseline, getBaselineResizeBehavior, 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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, 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, 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, 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, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, 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, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
m_InstSummaryPanel
protected InstancesSummaryPanel m_InstSummaryPanel
Displays simple stats on the working instances
-
m_OpenFileBut
protected JButton m_OpenFileBut
Click to load base instances from a file
-
m_AttPanel
protected AttributeSelectionPanel m_AttPanel
Panel to let the user toggle attributes
-
m_RemoveButton
protected JButton m_RemoveButton
Button for removing attributes
-
m_SaveBut
protected JButton m_SaveBut
Click to apply filters and save the results
-
m_plotAmplify
protected JButton m_plotAmplify
Click to amplify line graph or scatter diagram so that user can see plot more clearly
-
m_startIndex
protected JLabel m_startIndex
The start instance index label to prompt user to input start index number
-
m_endIndex
protected JLabel m_endIndex
The start instance index label to prompt user to input end index number
-
m_intStartIndex
protected int m_intStartIndex
The start instance index of x axis for line graph or scatter diagram
-
m_intEndIndex
protected int m_intEndIndex
The end instance index of x axis for line graph or scatter diagram
-
m_visAllGraphBut
protected JButton m_visAllGraphBut
Visualize all line graphs or scatter diagrams, not histograms or bar charts
-
m_startInstanceInput
protected JFormattedTextField m_startInstanceInput
Format m_intStartIndex
-
m_endInstanceInput
protected JFormattedTextField m_endInstanceInput
Format m_intEndIndex
-
m_AttSummaryPanel
protected AttributeSummaryPanel m_AttSummaryPanel
Displays summary stats on the selected attribute
-
m_FileChooser
protected weka.gui.ConverterFileChooser m_FileChooser
The file chooser for selecting data files
-
m_Instances
protected Instances m_Instances
The working instances
-
m_AttVisualizePanel
protected AttributeVisualizationPanel m_AttVisualizePanel
The visualization of the attribute values
-
m_Support
protected PropertyChangeSupport m_Support
Manages sending notifications to people when we change the set of working instances.
-
m_IOThread
protected Thread m_IOThread
A thread for loading/saving instances from a file or URL
-
m_Log
protected weka.gui.Logger m_Log
The message logger
-
m_samoaToWekaInstanceConverter
protected SamoaToWekaInstanceConverter m_samoaToWekaInstanceConverter
Instance converter from Samoa instance to Weak Instance
-
m_wekaToSamoaInstanceConverter
protected WekaToSamoaInstanceConverter m_wekaToSamoaInstanceConverter
Instance converter from Weak instance to Samoa Instance
-
m_plotTypeBox
protected JComboBox m_plotTypeBox
plot type drop list: "plot type: Line graph" "plot type: Scatter diagram" "No plot type"
-
m_selectedPlotTypeIndex
protected int m_selectedPlotTypeIndex
The index of the selected plot type index
-
m_featureRangeBox
protected JComboBox m_featureRangeBox
Set feature range shown in a popup window In default, Nine plots is shown in every popup window at most.
-
m_graphPanel
protected LineAndScatterPanel m_graphPanel
This panel is used to draw line graphs or scatter diagrams
-
fip
protected FeatureImportancePanel fip
This is the FeatureImportance Tab panel
-
m_sendToPerspective
protected JMenu m_sendToPerspective
For sending instances to various perspectives/tabs
-
-
Method Detail
-
startIndexValidation
public boolean startIndexValidation(int startIndex)
-
endIndexValidation
public boolean endIndexValidation(int endIndex)
-
setLog
public void setLog(weka.gui.Logger newLog)
Sets the Logger to receive informational messages- Specified by:
setLog
in interfaceweka.gui.Perspective
- Overrides:
setLog
in classweka.gui.AbstractPerspective
- Parameters:
newLog
- the Logger that will now get info messages
-
setInstances
public void setInstances(Instances inst)
Tells the panel to use a new base set of instances.- Parameters:
inst
- a set of Instances
-
featureRangeBoxSet
public void featureRangeBoxSet(int numAttributes, int maxFeaturesInOneScreen)
-
getInstances
public Instances getInstances()
Gets the working set of instances.- Returns:
- the working instances
-
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener l)
Adds a PropertyChangeListener who will be notified of value changes.- Overrides:
addPropertyChangeListener
in classContainer
- Parameters:
l
- a value of type 'PropertyChangeListener'
-
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener l)
Removes a PropertyChangeListener.- Overrides:
removePropertyChangeListener
in classComponent
- Parameters:
l
- a value of type 'PropertyChangeListener'
-
applyFilter
protected void applyFilter(weka.filters.Filter filter)
Passes the dataset through the filter that has been configured for use.- Parameters:
filter
- the filter to apply
-
setInstancesFromFileQ
public void setInstancesFromFileQ()
Queries the user for a file to load instances from, then loads the instances in a background process. This is done in the IO thread, and an error message is popped up if the IO thread is busy.
-
setInstancesFromFile2
public void setInstancesFromFile2(String selectedFile)
-
saveWorkingInstancesToFileQ
public void saveWorkingInstancesToFileQ()
Queries the user for a file to save instances as, then saves the instances in a background process. This is done in the IO thread, and an error message is popped up if the IO thread is busy.
-
saveInstancesToFile
public void saveInstancesToFile(weka.core.converters.AbstractFileSaver saver, weka.core.Instances inst)
saves the data with the specified saver- Parameters:
saver
- the saver to use for storing the datainst
- the data to save
-
instantiationComplete
public void instantiationComplete()
We've been instantiated and now have access to the main application and PerspectiveManager- Specified by:
instantiationComplete
in interfaceweka.gui.Perspective
- Overrides:
instantiationComplete
in classweka.gui.AbstractPerspective
-
main
public static void main(String[] args)
Tests out the instance-preprocessing panel from the command line.- Parameters:
args
- ignored
-
-