Package weka.gui

Examples of weka.gui.ListSelectorDialog


      setTTester();
    }
  }

  public void setTestBaseFromDialog() {
    ListSelectorDialog jd = new ListSelectorDialog(null, m_TestsList);

    // Open the dialog
    jd.showDialog();
  }
View Full Code Here


    // Open the dialog
    jd.showDialog();
  }

  public void setDisplayedFromDialog() {
    ListSelectorDialog jd = new ListSelectorDialog(null, m_DisplayedList);

    // Open the dialog
    jd.showDialog();
  }
View Full Code Here

      }
    }
  }

  private void setIgnoreColumns() {
    ListSelectorDialog jd = new ListSelectorDialog(null, m_ignoreKeyList);

    // Open the dialog
    int result = jd.showDialog();
   
    if (result != ListSelectorDialog.APPROVE_OPTION) {
      // clear selected indices
      m_ignoreKeyList.clearSelection();
    }
View Full Code Here

  /**
   * displays some properties of the instances
   */
  public void showProperties() {
    ArffPanel             panel;
    ListSelectorDialog    dialog;
    Vector                props;
    Instances             inst;
   
    panel = getCurrentPanel();
    if (panel == null)
      return;
   
    inst  = panel.getInstances();
    if (inst == null)
      return;
    if (inst.classIndex() < 0)
      inst.setClassIndex(inst.numAttributes() - 1);
   
    // get some data
    props = new Vector();
    props.add("Filename: " + panel.getFilename());
    props.add("Relation name: " + inst.relationName());
    props.add("# of instances: " + inst.numInstances());
    props.add("# of attributes: " + inst.numAttributes());
    props.add("Class attribute: " + inst.classAttribute().name());
    props.add("# of class labels: " + inst.numClasses());
   
    dialog = new ListSelectorDialog(getParentFrame(), new JList(props));
    dialog.showDialog();
  }
View Full Code Here

   *
   * @return    the name of the selected attribute
   */
  public String showAttributes() {
    ArffSortedTableModel     model;
    ListSelectorDialog  dialog;
    int                 i;
    JList               list;
    String              name;
    int                 result;
   
    if (!isPanelSelected())
      return null;
   
    list   = new JList(getCurrentPanel().getAttributes());
    dialog = new ListSelectorDialog(getParentFrame(), list);
    result = dialog.showDialog();
   
    if (result == ListSelectorDialog.APPROVE_OPTION) {
      model = (ArffSortedTableModel) getCurrentPanel().getTable().getModel();
      name  = list.getSelectedValue().toString();
      i     = model.getAttributeColumn(name);
View Full Code Here

    ArffSortedTableModel       model;
    ArffTable             table;
    HashSet               values;
    Vector                items;
    Iterator              iter;
    ListSelectorDialog    dialog;
    int                   i;
    int                   col;
   
    // choose attribute to retrieve values for
    attribute = showAttributes();
    if (attribute == null)
      return;
   
    table  = (ArffTable) getCurrentPanel().getTable();
    model  = (ArffSortedTableModel) table.getModel();
   
    // get column index
    col    = -1;
    for (i = 0; i < table.getColumnCount(); i++) {
      if (table.getPlainColumnName(i).equals(attribute)) {
        col = i;
        break;
      }
    }
    // not found?
    if (col == -1)
      return;
   
    // get values
    values = new HashSet();
    items  = new Vector();
    for (i = 0; i < model.getRowCount(); i++)
      values.add(model.getValueAt(i, col).toString());
    if (values.isEmpty())
      return;
    iter = values.iterator();
    while (iter.hasNext())
      items.add(iter.next());
    Collections.sort(items);
   
    dialog = new ListSelectorDialog(getParentFrame(), new JList(items));
    dialog.showDialog();
  }
View Full Code Here

      JList jl = new JList(lm);
      jl.setSelectedIndex(0);
      int result;
      // display dialog only if there's not just one result!
      if (jl.getModel().getSize() != 1) {
        ListSelectorDialog jd = new ListSelectorDialog(null, jl);
        result = jd.showDialog();
      }
      else {
        result = ListSelectorDialog.APPROVE_OPTION;
      }
      if (result != ListSelectorDialog.APPROVE_OPTION) {
View Full Code Here

  }

 
  public void setResultKeyFromDialog() {

    ListSelectorDialog jd = new ListSelectorDialog(null, m_ResultKeyList);

    // Open the dialog
    int result = jd.showDialog();
 
    // If accepted, update the ttester
    if (result == ListSelectorDialog.APPROVE_OPTION) {
      int [] selected = m_ResultKeyList.getSelectedIndices();
      String selectedList = "";
View Full Code Here

    }
  }
 
  public void setDatasetKeyFromDialog() {

    ListSelectorDialog jd = new ListSelectorDialog(null, m_DatasetKeyList);

    // Open the dialog
    int result = jd.showDialog();
   
    // If accepted, update the ttester
    if (result == ListSelectorDialog.APPROVE_OPTION) {
      int [] selected = m_DatasetKeyList.getSelectedIndices();
      String selectedList = "";
View Full Code Here

    m_TTester.setResultsetKeyColumns(tmpRange);
    setTTester();
  }
 
  public void setTestBaseFromDialog() {
    ListSelectorDialog jd = new ListSelectorDialog(null, m_TestsList);

    // Open the dialog
    jd.showDialog();
  }
View Full Code Here

TOP

Related Classes of weka.gui.ListSelectorDialog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.