Esempio n. 1
0
  private void initialize(ProgressMonitor parentProgress) {
    ProgressMonitor progress = parentProgress.startTask(I18N.tr("Loading the main window"), 100);
    makeMainFrame();
    progress.endTask();
    progress.setTaskName(I18N.tr("Loading docking system and frames"));
    // Initiate the docking management system
    DockingManagerImpl dockManagerImpl = new DockingManagerImpl(mainFrame);
    dockManager = dockManagerImpl;
    mainFrame.setDockingManager(dockManager);
    // Initiate the docking panel tracker
    singleFrameTracker =
        new DockingPanelTracker(pluginFramework.getHostBundleContext(), dockManager);
    singleFrameTracker.open();
    toolBarTracker =
        new MenuItemServiceTracker<MainWindow, ToolBarAction>(
            pluginFramework.getHostBundleContext(),
            ToolBarAction.class,
            dockManagerImpl,
            mainFrame);
    toolBarTracker.open();
    progress.endTask();

    // Load the log panels
    makeLoggingPanels();
    progress.endTask();

    // Load the editor factories manager
    makeEditorManager(dockManager);
    progress.endTask();

    // Load the GeoCatalog
    makeGeoCatalogPanel();
    progress.endTask();

    // Load Built-ins Editors
    loadEditorFactories();
    progress.endTask();

    progress.setTaskName(I18N.tr("Restore the former layout.."));
    // Load the docking layout and editors opened in last OrbisGis instance
    File savedDockingLayout = new File(viewWorkspace.getDockingLayoutPath());
    if (!savedDockingLayout.exists()) {
      // Copy the default docking layout
      // First OrbisGIS start
      copyDefaultDockingLayout(savedDockingLayout);
    }
    dockManager.setDockingLayoutPersistanceFilePath(viewWorkspace.getDockingLayoutPath());
    progress.endTask();
    addCoreMenu();
  }
Esempio n. 2
0
 private void saveSIFState() {
   // Load SIF properties
   try {
     UIFactory.saveState(new File(viewWorkspace.getSIFPath()));
   } catch (IOException ex) {
     LOGGER.error(I18N.tr("Error while saving dialogs informations."), ex);
   }
 }
Esempio n. 3
0
 /** Init the SIF ui factory */
 private void initSIF() {
   UIFactory.setDefaultImageIcon(OrbisGISIcon.getIcon("orbisgis")); // Load SIF properties
   try {
     UIFactory.loadState(new File(viewWorkspace.getSIFPath()));
   } catch (IOException ex) {
     LOGGER.error(I18N.tr("Error while loading dialogs informations."), ex);
   }
 }
Esempio n. 4
0
 /** Find the workspace folder or addDockingPanel a dialog to select one */
 private void initMainContext(
     boolean debugMode, CoreWorkspaceImpl coreWorkspace, LoadingFrame splashScreen)
     throws InterruptedException, InvocationTargetException, RuntimeException {
   String workspaceFolder = coreWorkspace.getWorkspaceFolder();
   if (workspaceFolder == null) {
     File defaultWorkspace = coreWorkspace.readDefaultWorkspacePath();
     if (defaultWorkspace == null || !ViewWorkspace.isWorkspaceValid(defaultWorkspace)) {
       try {
         PromptUserForSelectingWorkspace dial =
             new PromptUserForSelectingWorkspace(coreWorkspace, splashScreen);
         SwingUtilities.invokeAndWait(dial);
         if (!dial.isOk()) {
           throw new InterruptedException("Canceled by user.");
         }
       } catch (InvocationTargetException ex) {
         mainFrame.dispose();
         throw ex;
       }
     } else {
       coreWorkspace.setWorkspaceFolder(defaultWorkspace.getAbsolutePath());
     }
   }
   this.mainContext = new MainContext(debugMode, coreWorkspace, true);
 }