Ejemplo n.º 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);
     */
  }
Ejemplo n.º 2
0
  public boolean openTool(String name, boolean bOpen, boolean bShowOnly) {
    if (!bOpen) return closeTool(name);

    JComponent obj = searchTool(name);
    if (obj == null) return false;
    if (obj instanceof VToolPanel) {
      if (!((VToolPanel) obj).openTool(name, bOpen, bShowOnly)) return false;
    } else {
      if (obj instanceof PushpinIF) {
        PushpinIF pobj = (PushpinIF) obj;
        if (bShowOnly) {
          if (!pobj.isClose()) return false; // no change
        }
        pobj.setStatus("open");
      }
    }
    recordCurrentLayout();
    bChangeTool = true;
    setCurrentLayout();
    if (!pinPanel.isOpen()) {
      pinPanel.setVisible(false);
      bChangeTool = false;
      return false;
    }
    if (!bShowOnly) displayTool((Component) obj);
    bChangeTool = false;
    if (!pinPanel.isVisible()) pinPanel.setVisible(true);
    if (bShowOnly) setSelectedTab(tp_selectedTab, selectedTabName);
    validate();
    repaint();

    return true;
  }
Ejemplo n.º 3
0
  public boolean closeTool(String name) {
    JComponent obj = searchTool(name);
    if (obj == null) return false;
    if (obj instanceof VToolPanel) {
      if (!((VToolPanel) obj).closeTool(name)) return false;
    } else {
      if (obj instanceof PushpinIF) {
        PushpinIF pobj = (PushpinIF) obj;
        if (pobj.isClose()) return false;
        pobj.setStatus("close");
      }
    }
    setCurrentLayout();
    if (!pinPanel.isOpen()) {
      pinPanel.setVisible(false);
      //  return false;
    }

    validate();
    repaint();

    return true;
  }