Beispiel #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();
            }
          });
    }
  }
Beispiel #2
0
  public void revertLayout() {
    SOverlayUtils.genericOverlay();
    FView.SINGLETON_INSTANCE.getPnlContent().removeAll();

    FThreads.invokeInEdtLater(
        new Runnable() {
          @Override
          public void run() {
            SLayoutIO.loadLayout(null);
            SOverlayUtils.hideOverlay();
          }
        });
  }