public void setOptions(BeautiOptions options) {

    this.options = options;

    resetPanel();

    settingOptions = true;

    int selRow = partitionTable.getSelectedRow();
    partitionTableModel.fireTableDataChanged();
    if (options.getDataPartitions().size() > 0) {
      if (selRow < 0) {
        selRow = 0;
      }
      partitionTable.getSelectionModel().setSelectionInterval(selRow, selRow);

      setCurrentPartition(options.getDataPartitions().get(selRow));
    }

    AncestralStatesOptionsPanel panel = optionsPanels.get(currentPartition);
    if (panel != null) {
      panel.setupPanel();
    }

    settingOptions = false;

    validate();
    repaint();
  }
  private void selectionChanged() {
    if (settingOptions) return;

    int selRow = partitionTable.getSelectedRow();

    if (selRow >= options.getDataPartitions().size()) {
      selRow = 0;
      partitionTable.getSelectionModel().setSelectionInterval(selRow, selRow);
    }

    if (selRow >= 0) {
      setCurrentPartition(options.getDataPartitions().get(selRow));
      //            frame.modelSelectionChanged(!isUsed(selRow));
    }
  }