Class InstancesSortPanel

    • Field Detail

      • m_Data

        protected weka.core.Instances m_Data
        the instances that forms the basis for the sorting.
      • m_Layout

        protected GridLayout m_Layout
        the gridlayout in use.
      • m_PanelDefinitions

        protected BasePanel m_PanelDefinitions
        the panel holding the defintion panels.
      • m_PanelButtons

        protected BasePanel m_PanelButtons
        the panel for the buttons.
      • m_ButtonReset

        protected BaseButton m_ButtonReset
        the button for resetting the definitions.
      • m_ButtonAdd

        protected BaseButton m_ButtonAdd
        the button for a new sort definition.
      • m_ColumnNames

        protected List<String> m_ColumnNames
        the column names.
    • Constructor Detail

      • InstancesSortPanel

        public InstancesSortPanel()
    • Method Detail

      • initialize

        protected void initialize()
        Initializes the members.
        Overrides:
        initialize in class BasePanel
      • initGUI

        protected void initGUI()
        Initializes the widgets.
        Overrides:
        initGUI in class BasePanel
      • finishInit

        protected void finishInit()
        Finishes the initialization.
        Overrides:
        finishInit in class BasePanel
      • setInstances

        public boolean setInstances​(weka.core.Instances value)
        Sets the Instances to use.
        Parameters:
        value - the Instances to use
        Returns:
        true if the panel was reset
      • getInstances

        public weka.core.Instances getInstances()
        Returns the Instances to use.
        Returns:
        the Instances in use, null if none set
      • getColumnNames

        public List<String> getColumnNames()
        Returns the column names in use.
        Returns:
        the column names
      • resetDefinitions

        public void resetDefinitions()
        Resets the definitions.
      • addDefinition

        public void addDefinition()
        Adds a new definition.
      • removeDefinition

        public void removeDefinition​(InstancesSortDefinitionPanel panel)
        Removes the panel from the list of sort definitions.
        Parameters:
        panel - the panel to remove
      • reset

        public void reset()
        Removes all sort definition panels.
      • isFirstDefinition

        public boolean isFirstDefinition​(InstancesSortDefinitionPanel panel)
        Checks whether the panel is the first one.
        Parameters:
        panel - the panel to check
        Returns:
        true if the first one
      • isLastDefinition

        public boolean isLastDefinition​(InstancesSortDefinitionPanel panel)
        Checks whether the panel is the last one.
        Parameters:
        panel - the panel to check
        Returns:
        true if the last one
      • moveDefinition

        public boolean moveDefinition​(InstancesSortDefinitionPanel panel,
                                      boolean up)
        Moves the panel up/down.
        Parameters:
        panel - the panel to move
        up - if true, gets moved up, otherwise down
        Returns:
        true if successfully moved
      • update

        protected void update()
        Updates the display.
      • isValidSetup

        public boolean isValidSetup()
        Checks whether the setup is valid, i.e., no name used twice, at least one sorting definition.
        Returns:
        true if valid
      • getComparator

        public InstanceComparator getComparator()
        Returns a comparator for sorting the Instances.
        Returns:
        the comparator, null if not valid setup
      • addInstancesSortSetupListener

        public void addInstancesSortSetupListener​(InstancesSortSetupListener l)
        Adds the specified listener.
        Parameters:
        l - the listener to add
      • removeInstancesSortSetupListener

        public void removeInstancesSortSetupListener​(InstancesSortSetupListener l)
        Removes the specified listener.
        Parameters:
        l - the listener to remove
      • notifyInstancesSortSetupListeners

        public void notifyInstancesSortSetupListeners​(InstancesSortSetupEvent e)
        Notifies all listeners with the specified event.
        Parameters:
        e - the event to send