Class AttributeSelectionPanel

  • All Implemented Interfaces:
    ImageObserver, MenuContainer, Serializable, Accessible

    public class AttributeSelectionPanel
    extends JPanel
    A sub panel in visualizeFeatures tab. It shows all the attributes in a data stream so that a user selects to show the attribute's statistical information, graphs. This panel refers to weka.gui.AttributeSelectionPanel.
    Author:
    Len Trigg (trigg@cs.waikato.ac.nz), FracPete (fracpete at waikato dot ac dot nz), Yongheng Ma (2560653665@qq.com)
    See Also:
    Serialized Form
    • Field Detail

      • m_IncludeAll

        protected JButton m_IncludeAll
        Press to select all attributes
      • m_RemoveAll

        protected JButton m_RemoveAll
        Press to deselect all attributes
      • m_Invert

        protected JButton m_Invert
        Press to invert the current selection
      • m_Pattern

        protected JButton m_Pattern
        Press to enter a perl regular expression for selection
      • m_Table

        protected JTable m_Table
        The table displaying attribute names and selection status
      • m_Model

        protected moa.gui.featureanalysis.AttributeSelectionPanel.AttributeTableModel m_Model
        The table model containing attribute names and selection status
      • m_PatternRegEx

        protected String m_PatternRegEx
        The current regular expression.
    • Constructor Detail

      • AttributeSelectionPanel

        public AttributeSelectionPanel()
        Creates the attribute selection panel with no initial instances.
      • AttributeSelectionPanel

        public AttributeSelectionPanel​(boolean include,
                                       boolean remove,
                                       boolean invert,
                                       boolean pattern)
        Creates the attribute selection panel with no initial instances.
        Parameters:
        include - true if the include button is to be shown
        remove - true if the remove button is to be shown
        invert - true if the invert button is to be shown
        pattern - true if the pattern button is to be shown
    • Method Detail

      • getPreferredScrollableViewportSize

        public Dimension getPreferredScrollableViewportSize()
      • setPreferredScrollableViewportSize

        public void setPreferredScrollableViewportSize​(Dimension d)
      • popupCopyRangeMenu

        protected void popupCopyRangeMenu​(int x,
                                          int y)
      • setInstances

        public void setInstances​(Instances newInstances)
        Sets the instances who's attribute names will be displayed.
        Parameters:
        newInstances - the new set of instances
      • getSelectedAttributes

        public int[] getSelectedAttributes()
        Gets an array containing the indices of all selected attributes.
        Returns:
        the array of selected indices.
      • setSelectedAttributes

        public void setSelectedAttributes​(boolean[] selected)
                                   throws Exception
        Set the selected attributes in the widget. Note that setInstances() must have been called first.
        Parameters:
        selected - an array of boolean indicating which attributes are to have their check boxes selected.
        Throws:
        Exception - if the supplied array of booleans does not have the same number of elements as there are attributes.
      • getTableModel

        public TableModel getTableModel()
        Get the table model in use (or null if no instances have been set yet).
        Returns:
        the table model in use or null if no instances have been seen yet.
      • getSelectionModel

        public ListSelectionModel getSelectionModel()
        Gets the selection model used by the table.
        Returns:
        a value of type 'ListSelectionModel'
      • main

        public static void main​(String[] args)
        Tests the attribute selection panel from the command line.
        Parameters:
        args - must contain the name of an arff file to load.