예제 #1
0
  /** Save state to the PreferencesExt. */
  public void saveState(PreferencesExt store) {
    if (store == null) return;

    int ncols = table.getColumnCount();
    int[] size = new int[ncols];
    int[] modelIndex = new int[ncols];

    TableColumnModel tcm = table.getColumnModel();
    for (int i = 0; i < ncols; i++) {
      TableColumn tc = tcm.getColumn(i);
      size[i] = tc.getWidth();
      modelIndex[i] = tc.getModelIndex();
    }
    store.putBeanObject("ColumnWidths", size);
    store.putBeanObject("ColumnOrder", modelIndex);

    store.putInt("SortOnCol", model.getSortCol());
    store.putBoolean("SortReverse", model.getReverse());
    store.putBoolean("isThreadsOn", model.isThreadsOn());

    if (debug) {
      System.out.println(" store widths = ");
      for (int i = 0; i < size.length; i++) System.out.print(" " + size[i]);
      System.out.println();
    }
  }
예제 #2
0
파일: GridUI.java 프로젝트: nbald/thredds
  /** save all data in the PersistentStore */
  public void storePersistentData() {
    store.putInt("vertSplit", splitDraw.getDividerLocation());

    store.putBoolean(
        "navToolbarAction", ((Boolean) navToolbarAction.getValue(BAMutil.STATE)).booleanValue());
    store.putBoolean(
        "moveToolbarAction", ((Boolean) moveToolbarAction.getValue(BAMutil.STATE)).booleanValue());

    if (projManager != null) projManager.storePersistentData();
    /* if (csManager != null)
      csManager.storePersistentData();
    if (sysConfigDialog != null)
      sysConfigDialog.storePersistentData(); */

    dsTable.save();
    dsTable.getPrefs().putBeanObject("DialogBounds", dsDialog.getBounds());

    store.put(GEOTIFF_FILECHOOSER_DEFAULTDIR, geotiffFileChooser.getCurrentDirectory());

    controller.storePersistentData();
  }