Ejemplo n.º 1
0
  /** Display this panel in an external window. */
  public void windowPanel() {

    // try to hide the panel
    if (dockManager.hide(this, false)) {

      // move the toolbar from the main window to the panel
      if (hasToolbar()) {
        if (toolbarContainer == null) {
          toolbarContainer = new ToolbarContainer(app, false);
        }

        toolbarContainer.addToolbar(toolbar);
        toolbarContainer.buildGui();
        toolbarContainer.setActiveToolbar(getViewId());
        toolbarPanel.add(toolbarContainer, BorderLayout.CENTER);

        ToolbarContainer mainContainer = ((GuiManagerD) app.getGuiManager()).getToolbarPanel();
        mainContainer.removeToolbar(toolbar);
        mainContainer.updateToolbarPanel();
      }

      setVisible(true);
      createFrame();
    }
  }
Ejemplo n.º 2
0
  /** Update the panel. */
  public void updatePanel() {

    // load content if panel was hidden till now
    if (component == null && isVisible()) {
      component = loadComponent();
      add(component, BorderLayout.CENTER);

      if (isStyleBarVisible()) {
        setStyleBar();
      }

      // load toolbar if this panel has one
      if (hasToolbar()) {
        toolbar = new ToolbarD(app, this);

        if (isOpenInFrame()) {
          toolbarContainer = new ToolbarContainer(app, false);
          toolbarContainer.addToolbar(toolbar);
          toolbarContainer.buildGui();
          toolbarContainer.setActiveToolbar(getViewId());
          toolbarPanel.add(toolbarContainer, BorderLayout.CENTER);
        }
      }

      // euclidian view uses the general toolbar
      if (this instanceof EuclidianDockPanelAbstract) {
        // TODO implement..
      }
    }

    // make panels visible if necessary
    if (isVisible()) {

      if (isStyleBarVisible()) {
        setStyleBar();
      }

      // display toolbar panel if the dock panel is open in a frame
      if (hasToolbar()) {
        toolbarPanel.setVisible(frame != null);
      }
    }

    // if this is the last dock panel don't display the title bar, otherwise
    // take the user's configuration into consideration

    titlePanel.setVisible(
        app.getSettings().getLayout().showTitleBar()
            && !(isAlone && !isMaximized())
            && !app.isApplet()
            && (!isOpenInFrame()));

    // update stylebar visibility
    setShowStyleBar(isStyleBarVisible());
    updateStyleBarVisibility();

    // update the title bar if necessary
    updateTitleBarIfNecessary();
  }