Beispiel #1
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();
  }
Beispiel #2
0
  /** Update the toolbar GUI. */
  public void buildToolbarGui() {
    if (toolbarContainer != null) {
      toolbarContainer.buildGui();
      toolbarContainer.updateHelpText();

      if (isVisible() && isOpenInFrame()) {
        frame.validate();
      }
    }
  }
Beispiel #3
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();
    }
  }
Beispiel #4
0
 /**
  * Change the toolbar mode for panels open in a separate frame.
  *
  * @param mode
  */
 public void setToolbarMode(int mode) {
   if (toolbarContainer != null && isVisible() && isOpenInFrame() && hasToolbar()) {
     toolbarContainer.setMode(mode);
   }
 }
Beispiel #5
0
 /** Update the toolbar of this dock panel if it's open in its own toolbar container. */
 public void updateToolbar() {
   if (isVisible() && isOpenInFrame() && hasToolbar()) {
     toolbarContainer.updateToolbarPanel();
   }
 }