Exemple #1
0
  public void putHsLayout(int id) {
    Hashtable hs = sshare.userInfo();
    if (hs == null) return;
    String key, name;
    JComponent obj;
    PushpinIF pobj;

    for (int i = 0; i < keys.size(); i++) {
      key = (String) keys.get(i);
      obj = (JComponent) panes.get(key);
      if (obj != null && (obj instanceof PushpinIF)) {
        pobj = (PushpinIF) obj;
        name = "tabTool." + id + "." + pobj.getName() + ".";
        hs.put(name + "refY", new Float(pobj.getRefY()));
        hs.put(name + "refX", new Float(pobj.getRefX()));
        hs.put(name + "refH", new Float(pobj.getRefH()));
        key = "open";
        if (pobj.isHide()) key = "hide";
        else if (pobj.isClose()) key = "close";
        hs.put(name + "status", key);
      }
    }
    /*
    name = "tabTool."+id+".TabPanel.";
    key = pinPanel.getLastName();
    if (key != null)
       hs.put(name+"lastName", key);
    key = "open";
    if (pinPanel.isHide())
       key = "hide";
    else if (pinPanel.isClose())
       key = "close";
    hs.put(name+"status", key);
     */
  }
Exemple #2
0
  public VTabbedToolPanel(SessionShare sshare, AppIF appIF) {
    // super( new BorderLayout() );
    this.sshare = sshare;
    this.appIF = appIF;
    this.tabbedToolPanel = new JPanel();
    this.pinPanel = this;
    this.selectedTabName = null;
    setPinObj(this.tabbedToolPanel);
    this.tabbedToolPanel.setLayout(new BorderLayout());
    this.tabbedPane = new JTabbedPane();
    panelName = "Tab Panel";
    setTitle(panelName);
    setName(panelName);

    tabbedPane.addChangeListener(
        new ChangeListener() {
          public void stateChanged(ChangeEvent e) {
            tabChanged();
            /**
             * ** the following was moved to tabChanged() if(tabbedPane.getTabCount() > 1 &&
             * Util.getRQPanel() != null) { int ind = tabbedPane.getSelectedIndex(); if(ind >= 0 &&
             * ind < tabbedPane.getTabCount())
             * Util.getRQPanel().updatePopup(tabbedPane.getTitleAt(ind)); } *********
             */
          }
        });

    // Add Mouse Listener for CSH
    MouseAdapter ml = new CSHMouseAdapter();
    tabbedPane.addMouseListener(ml);

    Object obj = sshare.userInfo().get("canvasnum");
    if (obj != null) {
      Dimension dim = (Dimension) obj;
      nviews = (dim.height) * (dim.width);
    } else nviews = 1;

    for (int i = 0; i < nviews; i++) tp_paneInfo[i] = new Hashtable();

    /*
    obj = sshare.userInfo().get("activeWin");
    if(obj != null) {
               vpId = ((Integer)obj).intValue();
    } else vpId = 0;
            */

    // System.out.println("VToolPanel nviews vpId "+nviews+" "+vpId);

    fillHashtable();
    Util.setVTabbedToolPanel(this);
    ParamInfo.addEditListener(this);
  }
Exemple #3
0
  public void saveUiLayout() {

    for (int i = 0; i < toolList.size(); i++) ((VToolPanel) toolList.get(i)).saveUiLayout();

    Hashtable hs = sshare.userInfo();
    /*
    if (hs == null || tabbedPane == null || tabbedPane.getTabCount() <= 0)
        return;
     */
    if (hs == null || tabbedPane == null) return;
    if (tabbedPane.getTabCount() > 0) {
      Integer hashValue = new Integer(tabbedPane.getSelectedIndex());
      hs.put("tabbedToolPanel", hashValue);
    }
    putHsLayout(vpId);
  }
Exemple #4
0
  public void initUiLayout() {

    getHsLayout(vpId);
    for (int i = 0; i < toolList.size(); i++) ((VToolPanel) toolList.get(i)).initUiLayout();

    initPanel();
    updatePinTabs();

    Hashtable hs = sshare.userInfo();
    if (hs == null || tabbedPane == null || tabbedPane.getTabCount() <= 0) return;
    Object obj = hs.get("tabbedToolPanel");
    if (obj == null) return;
    int indx = ((Integer) obj).intValue();
    if (indx < 0) return;
    // if(indx >= 0 && indx < tabbedPane.getTabCount())
    // tabbedPane.setSelectedIndex(indx);
    setSelectedTab(tp_selectedTab, null);
  }
Exemple #5
0
  public void getHsLayout(int id) {
    Hashtable hs = sshare.userInfo();
    if (hs == null) return;
    String key, name, status;
    Float fstr;
    float fv;

    for (int j = 0; j < keys.size(); j++) {
      key = (String) keys.get(j);
      JComponent obj = (JComponent) panes.get(key);
      if (obj instanceof PushpinIF) {
        PushpinIF pobj = (PushpinIF) obj;
        name = "tabTool." + id + "." + pobj.getName() + ".";
        fstr = (Float) hs.get(name + "refY");
        if (fstr != null) pobj.setRefY(fstr.floatValue());
        fstr = (Float) hs.get(name + "refX");
        if (fstr != null) pobj.setRefX(fstr.floatValue());
        fstr = (Float) hs.get(name + "refH");
        if (fstr != null) pobj.setRefH(fstr.floatValue());
        status = (String) hs.get(name + "status");
        if (status != null) pobj.setStatus(status);
      }
    }
  }