Пример #1
0
  public void switchLayout(int newId, boolean bLayout) {

    if (layoutId == newId) return;
    if (newId >= nviews) updateVpInfo(newId + 1);

    if (bSwitching) {
      return;
    }

    bSwitching = true;
    int oldId = layoutId;
    vpId = newId;
    layoutId = newId;

    recordCurrentLayout();
    VpLayoutInfo vInfo = Util.getViewArea().getLayoutInfo(oldId);
    if (vInfo != null) { // save current layout info
      vInfo.tp_selectedTab = tp_selectedTab;
      vInfo.setVerticalTabName(selectedTabName);
      // copyCurrentLayout(vInfo);
    }

    vInfo = Util.getViewArea().getLayoutInfo(newId);

    putHsLayout(oldId);
    if (bLayout) getHsLayout(vpId);

    for (int i = 0; i < toolList.size(); i++)
      ((VToolPanel) toolList.get(i)).switchLayout(newId, bLayout);

    if (bLayout) setCurrentLayout();
    /*
    if(comparePanelLayout(oldId, newId)) {
    setCurrentLayout();
           }
           if ((vInfo != null) && vInfo.bAvailable &&
    compareCurrentLayout(vInfo)) {
                  setCurrentLayout(vInfo);
           }

    for(int i=0; i< toolList.size(); i++)
        ((VToolPanel) toolList.get(i)).switchLayout(newId);
           */

    // setViewPort(newId);

    if (bLayout) setCurrentLayout(vInfo);

    updateValue();

    if (bLayout) {
      if (pinPanel.isOpen()) {
        if (!pinPanel.isVisible()) pinPanel.setVisible(true);
      } else pinPanel.setVisible(false);
    }
    validate();
    repaint();

    bSwitching = false;
  }
Пример #2
0
  public void setViewPort(int id) {
    if (pane == null) return;

    // ButtonIF vif = Util.getViewArea().getActiveVp();
    ButtonIF vif = Util.getViewArea().getExp(id);

    if (vif == null) return;

    int nums = pane.getComponentCount();

    for (int i = 0; i < nums; i++) {
      Component comp = pane.getComponent(i);
      if (comp instanceof VObjIF) {
        VObjIF obj = (VObjIF) comp;
        obj.setVnmrIF(vif);
      }
    }
  }
Пример #3
0
  public XMLToolPanel(SessionShare ss, String pname, String fname) {

    this.vnmrIf = (ButtonIF) Util.getViewArea().getDefaultExp();
    this.sshare = ss;
    this.pname = pname;
    this.fname = fname;

    pane = new ParamPanel();
    pane.setPanelFile(fname);
    pane.setPanelName(pname);
    pane.setType(ParamInfo.TOOLPANEL);
    pane.setLayoutName("toolPanels");
    pane.setAttributes(null);

    paramsLayout = new VRubberPanLayout();
    if (!Util.isImagingUser()) paramsLayout.setSquish(1.0);

    DisplayOptions.addChangeListener(this);
    ExpPanel.addStatusListener(this);
    // ExpPanel.addExpListener(this);

    setLayout(new xpPanelLayout());
  } // constructor