Class KNNClassifierPanel

All Implemented Interfaces:
ActionListener, KeyListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants

public class KNNClassifierPanel extends ParameterPanel
This java class is used to create and show a panel for the parameter settings of the k-nearest neighbours classifier.
Author:
Sina Tabakhi
See Also:
  • Constructor Details

    • KNNClassifierPanel

      public KNNClassifierPanel()
      Creates new form KNNClassifierPanel. This method is called from within the constructor to initialize the form.
  • Method Details

    • keyReleased

      public void keyReleased(KeyEvent e)
      The listener method for receiving keyboard events (keystrokes). Invoked when a key has been released.
      Specified by:
      keyReleased in interface KeyListener
      Specified by:
      keyReleased in class ParameterPanel
      Parameters:
      e - an action event
    • btn_okActionPerformed

      protected void btn_okActionPerformed(ActionEvent e)
      This method sets an action for the btn_ok button.
      Overrides:
      btn_okActionPerformed in class ParameterPanel
      Parameters:
      e - an action event
    • getKNNValue

      public int getKNNValue()
      This method returns the number of neighbours to use.
      Returns:
      the kNNValue parameter
    • setKNNValue

      public void setKNNValue(int kNNValue)
      This method sets the number of neighbours to use.
      Parameters:
      kNNValue - the number of neighbours to use
    • setDefaultValue

      public void setDefaultValue()
      Sets the default values of the k-nearest neighbours parameters
    • setUserValue

      public void setUserValue(int kNNValue)
      Sets the last values of the k-nearest neighbours parameters entered by user
      Parameters:
      kNNValue - the number of neighbours to use