Package moa.gui.featureanalysis
Class LineAndScatterPanel
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- moa.gui.featureanalysis.LineAndScatterPanel
-
- All Implemented Interfaces:
ImageObserver
,MenuContainer
,Serializable
,Accessible
public class LineAndScatterPanel extends JPanel
This is a sub panel in VisualizeFeatures tab. It is used to show a feature as a line graph or a scatter diagram, or to show an amplified line graph or scatter diagram, or to show all features' line graphs or scatter diagrams.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
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 List<double[]>
featureVectorList
Double list which store the feature dataprotected int
m_attributeIndex
The attribute index starting from 0protected String
m_attributeName
Attribute nameprotected Instances
m_data
This holds the current set of instancesprotected String
m_featureRange
The string of feature range.protected int
m_featureRangeEndIndex
The feature range end index.protected int
m_featureRangeStartIndex
The feature range start index.protected 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 int
m_selectedPlotTyeIndex
plot type drop list: "plot type: Line graph" "plot type: Scatter diagram" "No plot type" m_selectedPlotTyeIndex means the selected plot indexprotected String
m_selectedPlotTyeItem
The string of the the selected plot type such as "plot type: Line graph"protected org.math.plot.Plot2DPanel
plot
THe drawing tool provided by jmathplot.jar-
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 LineAndScatterPanel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getAttributeIndex()
String
getAttributeName()
int
getFeatureRangeEndIndex()
int
getFeatureRangeStartIndex()
int
getIntEndIndex()
int
getIntStartIndex()
Dimension
getScreenSize()
Get the screen size so that the amplified graph size is the same as the screen size.String
getSelectedPlotItem()
int
getSelectedPlotTyeIndex()
void
paintAmplifiedPlot()
This method is used to paint line graph or scatter diagram in popup window from VisualizeFeature Tab.void
paintComponent(Graphics g)
This override method is used to paint embedded line graph or scatter diagram in VisualizeFeature Tab.void
setAttributeIndex(int attributeIndex)
void
setAttributeName(String attributeName)
void
setFeatureRange(String featureRange)
Parse String to number.void
setFeatureRangeEndIndex(int featureRangeEndIndex)
void
setFeatureRangeStartIndex(int featureRangeStartIndex)
void
setInstances(Instances inst)
Set dataset which is the data source of line graph or scatter diagram.void
setIntEndIndex(int intEndIndex)
void
setIntStartIndex(int intStartIndex)
void
setSelectedPlotInfo(int selectedPlotTyeIndex, String selectedPlotItem, int attributeIndex, String attributeName)
User set plot related parameters in GUI such as plot type, selected attributevoid
setSelectedPlotItem(String SelectedPlotItem)
void
visualizeAll()
1.-
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, 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, 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, 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, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
m_data
protected Instances m_data
This holds the current set of instances
-
m_attributeIndex
protected int m_attributeIndex
The attribute index starting from 0
-
m_attributeName
protected String m_attributeName
Attribute name
-
m_selectedPlotTyeIndex
protected int m_selectedPlotTyeIndex
plot type drop list: "plot type: Line graph" "plot type: Scatter diagram" "No plot type" m_selectedPlotTyeIndex means the selected plot index
-
m_selectedPlotTyeItem
protected String m_selectedPlotTyeItem
The string of the the selected plot type such as "plot type: Line graph"
-
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
-
featureVectorList
protected List<double[]> featureVectorList
Double list which store the feature data
-
plot
protected org.math.plot.Plot2DPanel plot
THe drawing tool provided by jmathplot.jar
-
m_featureRangeStartIndex
protected int m_featureRangeStartIndex
The feature range start index. For example, if the feature range is from 1 to 9, then the start index is 1 and the end index is 9. The default plot number in a popup screen is 9 at most.
-
m_featureRangeEndIndex
protected int m_featureRangeEndIndex
The feature range end index. For example, if the feature range is from 1 to 9, then the start index is 1 and the end index is 9. The default plot number in a popup screen is 9 at most.
-
m_featureRange
protected String m_featureRange
The string of feature range. For example,"feature range: 1 -- 9".
-
-
Method Detail
-
getSelectedPlotTyeIndex
public int getSelectedPlotTyeIndex()
-
getSelectedPlotItem
public String getSelectedPlotItem()
-
setSelectedPlotItem
public void setSelectedPlotItem(String SelectedPlotItem)
-
getAttributeName
public String getAttributeName()
-
setAttributeName
public void setAttributeName(String attributeName)
-
getIntStartIndex
public int getIntStartIndex()
-
setIntStartIndex
public void setIntStartIndex(int intStartIndex)
-
getIntEndIndex
public int getIntEndIndex()
-
setIntEndIndex
public void setIntEndIndex(int intEndIndex)
-
getFeatureRangeStartIndex
public int getFeatureRangeStartIndex()
-
setFeatureRangeStartIndex
public void setFeatureRangeStartIndex(int featureRangeStartIndex)
-
getFeatureRangeEndIndex
public int getFeatureRangeEndIndex()
-
setFeatureRangeEndIndex
public void setFeatureRangeEndIndex(int featureRangeEndIndex)
-
setFeatureRange
public void setFeatureRange(String featureRange)
Parse String to number. For example, featureRange is "feature range: 1 -- 9", then is parsed into 0 and 8.
-
setInstances
public void setInstances(Instances inst)
Set dataset which is the data source of line graph or scatter diagram.
-
setAttributeIndex
public void setAttributeIndex(int attributeIndex)
-
getAttributeIndex
public int getAttributeIndex()
-
setSelectedPlotInfo
public void setSelectedPlotInfo(int selectedPlotTyeIndex, String selectedPlotItem, int attributeIndex, String attributeName)
User set plot related parameters in GUI such as plot type, selected attribute
-
paintComponent
public void paintComponent(Graphics g)
This override method is used to paint embedded line graph or scatter diagram in VisualizeFeature Tab.- Overrides:
paintComponent
in classJComponent
-
paintAmplifiedPlot
public void paintAmplifiedPlot()
This method is used to paint line graph or scatter diagram in popup window from VisualizeFeature Tab.
-
visualizeAll
public void visualizeAll()
1. For nominal feature, just display scatter diagrams in which the data range is from m_intStartIndex to m_intEndIndex 2. Fro numeric feature, show line graph or scatter diagram depending on user's plot type choice, in which the data range is from m_intStartIndex to m_intEndIndex
-
getScreenSize
public Dimension getScreenSize()
Get the screen size so that the amplified graph size is the same as the screen size.
-
-