Exemplo 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);
     */
  }
Exemplo n.º 2
0
  public void setCurrentLayout(int newId) {

    if (newId >= nviews) return;

    tabbedPane.removeAll();
    tabbedToolPanel.removeAll();
    String key;
    String currValue;
    JComponent obj;
    PushpinIF pobj;
    clearPushpinComp();
    for (int i = 0; i < keys.size(); i++) {
      key = (String) keys.get(i);
      currValue = (String) tp_paneInfo[newId].get(key);
      obj = (JComponent) panes.get(key);
      pobj = null;
      if (currValue.equals("yes") && obj != null) {
        if (obj instanceof PushpinIF) {
          pobj = (PushpinIF) obj;
          pobj.setAvailable(true);
          if (!pobj.isOpen()) {
            if (!pobj.isPopup()) obj = null;
          }
        }
        if (obj != null) {
          if (key.equals("Locator")) key = getLocatorName();
          tabbedPane.addTab(key, null, obj, "");
        }
        // tabbedPane.addTab(key, null, (JComponent)panes.get(key), "");
      }
    }

    if (tabbedPane.getTabCount() < 1) {
      pinPanel.setAvailable(false);
      pinPanel.setStatus("close");
      // setVisible(false);
      return;
    }

    pinPanel.setAvailable(true);
    pinPanel.setStatus("open");
    if (tabbedPane.getTabCount() == 1) {
      tabbedToolPanel.add(tabbedPane.getComponentAt(0));
      // tabbedToolPanel.add(tabbedPane);
    } else {
      tabbedToolPanel.add(tabbedPane);
    }
    setSelectedTab(tp_selectedTab, selectedTabName);

    tabbedToolPanel.validate();
    // repaint();
  }
Exemplo n.º 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);
      }
    }
  }
Exemplo n.º 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);
  }
Exemplo n.º 5
0
 public JComponent searchTool(String name, int id) {
   VToolPanel vp = null;
   int num = keys.size();
   if (num <= 0 || name == null) return null;
   name = Util.getLabelString(name);
   for (int i = 0; i < num; i++) {
     String key = (String) keys.get(i);
     JComponent obj = (JComponent) panes.get(key);
     if (obj instanceof VToolPanel) vp = (VToolPanel) obj;
     else if (name.equals(key) && obj != null) {
       String Value = (String) tp_paneInfo[id].get(key);
       if (Value.equals("yes")) {
         return obj;
       }
     }
   }
   return (JComponent) vp;
 }
Exemplo n.º 6
0
  public void setViewPort(int id) {

    if (id >= nviews || id < 0) return;

    String key;
    String value;
    vpId = id;
    for (Enumeration e = tp_paneInfo[id].keys(); e.hasMoreElements(); ) {
      key = (String) e.nextElement();
      value = (String) tp_paneInfo[id].get(key);
      if (value.equals("yes")) {
        JComponent comp = (JComponent) panes.get(key);
        if (comp instanceof VToolPanel) {
          ((VToolPanel) comp).setViewPort(id);
        } else {
          if (comp instanceof PushpinIF) comp = ((PushpinIF) comp).getPinObj();
          if (comp instanceof XMLToolPanel) ((XMLToolPanel) comp).setViewPort(id);
        }
      }
    }
  }
Exemplo n.º 7
0
  /**
   * public void setCurrentLayout(int newId) {
   *
   * <p>if(newId >= nviews || vpId >= nviews) return;
   *
   * <p>String key; String newValue; String currValue;
   *
   * <p>for(int i=0; i<keys.size(); i++) { key = (String)keys.get(i); newValue =
   * (String)tp_paneInfo[newId].get(key); currValue = (String)tp_paneInfo[vpId].get(key); JComponent
   * obj = (JComponent)panes.get(key); if(newValue.equals("yes")) { if
   * (tabbedPane.indexOfComponent((Component)obj) < 0) tabbedPane.addTab(key, null, obj, ""); if
   * (obj instanceof PushpinIF) ((PushpinIF) obj).setAvailable(true); } else
   * if(newValue.equals("no")) { if (tabbedPane.indexOfComponent((Component)obj) >= 0)
   * tabbedPane.remove(obj); if (obj instanceof PushpinIF) ((PushpinIF) obj).setAvailable(false); }
   * }
   *
   * <p>tabbedToolPanel.removeAll(); if(tabbedPane.getTabCount() > 0) { if(tabbedPane.getTabCount()
   * == 1) { tabbedToolPanel.add(tabbedPane.getComponentAt(0)); } else if(tabbedPane.getTabCount() >
   * 1) { tabbedToolPanel.add(tabbedPane); } pinPanel.setStatus("open"); } else {
   * pinPanel.setStatus("close"); setVisible(false); } validate(); repaint(); }
   */
  public void initPanel() {

    if (panes == null || panes.size() <= 0) return;

    setCurrentLayout();
    String key;
    for (Enumeration e = panes.keys(); e.hasMoreElements(); ) {
      key = (String) e.nextElement();
      JComponent comp = (JComponent) panes.get(key);
      if (comp instanceof VToolPanel) ((VToolPanel) comp).initPanel();
      else {
        if (comp instanceof PushpinIF) comp = ((PushpinIF) comp).getPinObj();
        if (comp instanceof XMLToolPanel) ((XMLToolPanel) comp).buildPanel();
      }
      /**
       * ** if(comp instanceof XMLToolPanel) { ((XMLToolPanel)comp).buildPanel(); } else if(comp
       * instanceof VToolPanel) { ((VToolPanel)comp).initPanel(); } **
       */
    }
    if (pinPanel.isOpen()) {
      if (!pinPanel.isVisible()) pinPanel.setVisible(true);
    } else pinPanel.setVisible(false);
  }
Exemplo n.º 8
0
 private Constructor getTool(String key) {
   return ((Constructor) vobjs.get(key));
 }