Пример #1
0
  public void openLayout() {
    SOverlayUtils.genericOverlay();

    final SaveOpenDialog dlgOpen = new SaveOpenDialog();
    final FileLocation layoutFile = Singletons.getControl().getCurrentScreen().getLayoutFile();
    final File defFile = layoutFile != null ? new File(layoutFile.userPrefLoc) : null;
    final File loadFile = dlgOpen.OpenDialog(defFile, Filetypes.LAYOUT);

    if (loadFile != null) {
      FView.SINGLETON_INSTANCE.getPnlContent().removeAll();
      // let it redraw everything first

      FThreads.invokeInEdtLater(
          new Runnable() {
            @Override
            public void run() {
              if (loadFile != null) {
                SLayoutIO.loadLayout(loadFile);
                SLayoutIO.saveLayout(null);
              }
              SOverlayUtils.hideOverlay();
            }
          });
    }
  }
Пример #2
0
 public void saveLayout() {
   final SaveOpenDialog dlgSave = new SaveOpenDialog();
   final FileLocation layoutFile = Singletons.getControl().getCurrentScreen().getLayoutFile();
   final File defFile = layoutFile != null ? new File(layoutFile.userPrefLoc) : null;
   final File saveFile = dlgSave.SaveDialog(defFile, Filetypes.LAYOUT);
   if (saveFile != null) {
     SLayoutIO.saveLayout(saveFile);
   }
 }