Class 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
    • 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".
    • Constructor Detail

      • LineAndScatterPanel

        public LineAndScatterPanel()
    • 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 class JComponent
      • 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.