Пример #1
0
  @Override
  protected void initializeSwing() {
    super.initializeSwing();
    JDesktopPane swingDesktop = new JDesktopPane();
    setSwingField(swingDesktop);
    //
    swingDesktop.setDesktopManager(new MultiSplitDesktopManager());
    IMultiSplitStrategy columnSplitStrategy = createMultiSplitStrategy();
    MultiSplitLayout layout = new MultiSplitLayout(columnSplitStrategy);
    swingDesktop.setLayout(layout);
    swingDesktop.setOpaque(true);
    // cursor
    swingDesktop.setCursor(null);

    // focus root
    swingDesktop.setFocusCycleRoot(false);
    swingDesktop.setFocusTraversalPolicy(null);
    // AWE: this could be integrated in new ui (was forgotton in metal laf)
    swingDesktop
        .getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
        .put(SwingUtility.createKeystroke("shift ctrl TAB"), "selectPreviousFrame");
    // register ctrl-TAB and ctrl-shift-TAB actions according to ui
    swingDesktop.getActionMap().put("selectNextFrame", new P_SwingTabFrameAction(1));
    swingDesktop.getActionMap().put("selectPreviousFrame", new P_SwingTabFrameAction(-1));
    // development shortcuts
    SwingUtility.installDevelopmentShortcuts(getSwingDesktopPane());
  }
 protected void installDesktopManager() {
   desktopManager = desktop.getDesktopManager();
   if (desktopManager == null) {
     desktopManager = new BasicDesktopManager();
     desktop.setDesktopManager(desktopManager);
   }
 }
  /** Constructs a new desktop. */
  public TetradDesktop() {
    setBackground(new Color(204, 204, 204));
    sessionNodeKeys = new ArrayList();
    // Create the desktop pane.
    this.desktopPane = new JDesktopPane();

    // Do layout.
    setLayout(new BorderLayout());
    desktopPane.setDesktopManager(new DefaultDesktopManager());
    desktopPane.setBorder(new BevelBorder(BevelBorder.LOWERED));
    desktopPane.addPropertyChangeListener(this);

    this.setupDesktop();
    TetradLogger.getInstance().addTetradLoggerListener(new LoggerListener());
  }
 protected void uninstallDesktopManager() {
   if (desktop.getDesktopManager() instanceof UIResource) {
     desktop.setDesktopManager(null);
   }
   desktopManager = null;
 }