private DockablePane createDockablePane(String name, int index, ImageIcon icon, TableModel tableModel) { JTable table = new JTable(tableModel); table.setCellSelectionEnabled(false); table.setColumnSelectionAllowed(false); table.setRowSelectionAllowed(true); table.setTableHeader(null); table.removeEditor(); JScrollPane scrollPane = new JScrollPane(table, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); scrollPane.setBorder(null); scrollPane.setViewportBorder(null); final DockingManager dockingManager = app.getMainFrame().getDockingManager(); final FloatingComponentFactory componentFactory = FloatingDockableFrame.getFactory(dockingManager); return new DockablePane(name, icon, scrollPane, index, true, componentFactory); }
/** * Overrides the base class version in order to create and configure the VISAT's main pane. */ @Override protected JComponent createMainPane() { final JMenuBar menuBar = getMainFrame().getJMenuBar(); JMenu windowMenu = null; for (int i = 0; i < menuBar.getComponentCount(); i++) { final Component component = menuBar.getComponent(i); if (component instanceof JMenu && "window".equals(component.getName())) { windowMenu = (JMenu) menuBar.getComponent(i); } } desktopPane.setWindowMenu(windowMenu); return desktopPane; }
pm.beginTask(message, view.isRGB() ? 4 : 3); visatApp.setStatusBarMessage(message); visatApp.getMainFrame().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); final Dimension dimension = new Dimension(view.getProduct().getSceneRasterWidth(), view.getProduct().getSceneRasterHeight()); visatApp.handleUnknownException(e); } finally { visatApp.getMainFrame().setCursor(Cursor.getDefaultCursor()); visatApp.clearStatusBarMessage(); pm.done();
getMainFrame().getLayoutPersistence().loadLayoutData(); // </JIDE> clearStatusBarMessage(); pm.worked(1); getMainFrame().setVisible(true); updateState(); } finally {
getMainFrame().getDockingManager().setHideFloatingFramesOnSwitchOutOfApplication(true); getMainFrame().getDockingManager().setHideFloatingFramesWhenDeactivate(false); getCommandManager(), new DefaultSelectionManager(this), getMainFrame().getDockingManager(), desktopPane);
pm.beginTask(message, 1); visatApp.setStatusBarMessage(message); visatApp.getMainFrame().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); RenderedImage image = createImage(imageFormat, view); visatApp.handleUnknownException(e); } finally { visatApp.getMainFrame().setCursor(Cursor.getDefaultCursor()); visatApp.clearStatusBarMessage(); pm.done();
layersToolBar.getContext().setInitSide(DockableBarContext.DOCK_SIDE_NORTH); layersToolBar.getContext().setInitIndex(2); getMainFrame().getDockableBarManager().addDockableBar(layersToolBar); pm.worked(1); analysisToolBar.getContext().setInitSide(DockableBarContext.DOCK_SIDE_NORTH); analysisToolBar.getContext().setInitIndex(2); getMainFrame().getDockableBarManager().addDockableBar(analysisToolBar); pm.worked(1); toolsToolBar.getContext().setInitSide(DockableBarContext.DOCK_SIDE_EAST); toolsToolBar.getContext().setInitIndex(1); getMainFrame().getDockableBarManager().addDockableBar(toolsToolBar); pm.worked(1); viewToolBar.getContext().setInitIndex(1); getMainFrame().getDockableBarManager().addDockableBar(viewToolBar);
/** * Called by the <code>exit</code> method. The default implementation first saves the user preferences. * You should not call this method directly. If you override this method, make sure to call the base * class version as well. * * @see #savePreferences() */ protected void handleImminentExit() { Debug.trace(getAppName() + ": handleImminentExit entered"); if (!unexpectedShutdown) { // fix BEAM-712 (nf 2007.11.02) Debug.trace("(1)"); LayoutPersistence layoutPersistence = getMainFrame().getLayoutPersistence(); if (layoutPersistence != null) { layoutPersistence.saveLayoutData(); // produces a dead lock, method is certainly not threadsafe! } } Debug.trace("(2)"); savePreferences(); Debug.trace("(3)"); HelpSys.dispose(); // todo - disposing the HelpSystem should be done in the BeamUiActivator.stop() method Debug.trace(getAppName() + ": handleImminentExit exited"); }
private void openProductImpl(final File file) { File[] selectedFiles; FileFilter selectedFileFilter = null; if (file == null || !file.exists()) { JFileChooser fileChooser = showOpenFileDialog(); if (fileChooser == null) { return; } selectedFiles = fileChooser.getSelectedFiles(); selectedFileFilter = fileChooser.getFileFilter(); } else { selectedFiles = new File[]{file}; } Cursor oldCursor = getMainFrame().getCursor(); String formatName = null; if (selectedFileFilter instanceof BeamFileFilter) { formatName = ((BeamFileFilter) selectedFileFilter).getFormatName(); } UIUtils.setRootFrameWaitCursor(getMainFrame()); SwingWorker openProductSwingWorker = new OpenProductSwingWorker(selectedFiles, formatName, oldCursor); openProductSwingWorker.execute(); }
public final void handleUnknownException(Throwable e) { Debug.trace(e); String message; if (e == null) { message = "An unknown error occurred."; /*I18N*/ } else if (e.getMessage() == null) { message = "An exception occurred:\n" + " Type: " + e.getClass().getName() + "\n" + " No message text available."; /*I18N*/ } else { message = "An exception occurred:\n" + " Type: " + e.getClass().getName() + "\n" + " Message: " + e.getMessage(); /*I18N*/ } getMainFrame().setCursor(Cursor.getDefaultCursor()); setStatusBarMessage("Error."); logger.log(Level.SEVERE, message, e); showErrorDialog("Error", message); clearStatusBarMessage(); }
private Product readProductNodes(final File file) { Product product = null; VisatApp visatApp = VisatApp.getApp(); try { visatApp.setStatusBarMessage("Reading from '" + file + "'..."); /*I18N*/ visatApp.getMainFrame().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); if (readerPlugIn.getDecodeQualification(file) != DecodeQualification.UNABLE) { final ProductReader reader = readerPlugIn.createReaderInstance(); product = reader.readProductNodes(file, null); } else { visatApp.showWarningDialog("Cannot decode the selected product file\n" + "'" + file.getPath() + "'"); } visatApp.getMainFrame().setCursor(Cursor.getDefaultCursor()); visatApp.clearStatusBarMessage(); } catch (Exception e) { visatApp.handleUnknownException(e); } return product; }
private void configureDockingManager() { getMainFrame().getDockingManager().setProfileKey(getAppName()); getMainFrame().getDockingManager().setInitBounds(new Rectangle(0, 0, 960, 800)); getMainFrame().getDockingManager().setInitSplitPriority(DefaultDockingManager.SPLIT_SOUTH_NORTH_EAST_WEST); getMainFrame().getDockingManager().setInitDelay(100); getMainFrame().getDockingManager().setSteps(1); getMainFrame().getDockingManager().setStepDelay(0); getMainFrame().getDockingManager().setUndoLimit(0); getMainFrame().getDockingManager().setFloatable(true); getMainFrame().getDockingManager().setShowGripper(false); getMainFrame().getDockingManager().setDragGripperOnly(false); getMainFrame().getDockingManager().setContinuousLayout(true); getMainFrame().getDockingManager().setAutoDockingAsDefault(false); getMainFrame().getDockingManager().setHideFloatingFramesWhenDeactivate(true); getMainFrame().getDockingManager().setHideFloatingFramesOnSwitchOutOfApplication(true); // getMainFrame().getDockingManager().setOutlineMode(DockingManager.PARTIAL_OUTLINE_MODE); // getMainFrame().getDockingManager().setOutlineMode(DockingManager.MIX_OUTLINE_MODE); getMainFrame().getDockingManager().setOutlineMode(DockingManager.FULL_OUTLINE_MODE); }
@Override protected void done() { visatApp.getMainFrame().setCursor(Cursor.getDefaultCursor()); try { ProductSceneView productSceneView = new ProductSceneView(get()); productSceneView.setLayerProperties(visatApp.getPreferences()); openInternalFrame(productSceneView); } catch (OutOfMemoryError e) { visatApp.showOutOfMemoryErrorDialog("The RGB image view could not be created."); /*I18N*/ return; } catch (Exception e) { visatApp.handleUnknownException(e); return; } visatApp.clearStatusBarMessage(); } };
/** * Exits the application. <p>The base class implementation calls <code>setShuttingDown(true)</code>, calls * {@link #handleImminentExit()} and disposes the main frame. * <p/> * <p> When this method is overridden, this base class's implementation should always be called last. However, the * preferred way to change the shutdown behaviour is to override the {@link #handleImminentExit()} method. */ public void shutDown() { setShuttingDown(true); handleImminentExit(); getMainFrame().dispose(); System.exit(0); }
@Override public void actionPerformed(CommandEvent event) { final LayoutPersistence layoutPersistence = VisatApp.getApp().getMainFrame().getLayoutPersistence(); layoutPersistence.resetToDefault(); }
@Override public void actionPerformed(CommandEvent event) { final LayoutPersistence layoutPersistence = VisatApp.getApp().getMainFrame().getLayoutPersistence(); layoutPersistence.saveLayoutDataAs("user"); }
private void initMainPane() { JComponent mainPane = createMainPane(); if (mainPane != null) { getMainFrame().getDockingManager().getWorkspace().setLayout(new BorderLayout()); getMainFrame().getDockingManager().getWorkspace().add(mainPane, BorderLayout.CENTER); getMainFrame().getDockingManager().setDefaultFocusComponent(mainPane); } }