예제 #1
0
  /**
   * displays the given instances, i.e. creates a tab with the title TAB_INSTANCES. if one already
   * exists it closes it.<br>
   * if a different instances object is used here, don't forget to clear the undo-history by calling
   * <code>clearUndo()</code>
   *
   * @param data the instances to display
   * @see #TAB_INSTANCES
   * @see #clearUndo()
   */
  public void setInstances(Instances data) {
    ArffSortedTableModel model;

    m_Filename = TAB_INSTANCES;

    createTitle();
    model = new ArffSortedTableModel(data);
    model.setShowAttributeIndex(m_ShowAttributeIndex);

    m_TableArff.setModel(model);
    clearUndo();
    setChanged(false);
    createName();
  }
예제 #2
0
  /**
   * loads the specified file into the table
   *
   * @param filename the file to load
   */
  private void loadFile(String filename) {
    ArffSortedTableModel model;

    this.m_Filename = filename;

    createTitle();

    if (filename.equals("")) {
      model = null;
    } else {
      model = new ArffSortedTableModel(filename);
      model.setShowAttributeIndex(getShowAttributeIndex());
    }

    m_TableArff.setModel(model);
    setChanged(false);
    createName();
  }