Exemple #1
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;
  }
Exemple #2
0
  public boolean hideTool(String name) {
    JComponent obj = searchTool(name);
    if (obj == null) return false;
    if (obj instanceof VToolPanel) {
      if (!((VToolPanel) obj).hideTool(name)) return false;
    } else {
      if (obj instanceof PushpinIF) {
        PushpinIF pobj = (PushpinIF) obj;
        pobj.setStatus("hide");
      }
    }
    setCurrentLayout();
    if (!pinPanel.isOpen()) {
      pinPanel.setVisible(false);
    }

    validate();
    repaint();

    return true;
  }
Exemple #3
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);
      }
    }
  }