Esempio n. 1
0
 public boolean popupTool(String name) {
   JComponent obj = searchTool(name);
   if (obj == null) return false;
   if (obj instanceof VToolPanel) {
     if (!((VToolPanel) obj).popupTool(name)) return false;
   } else {
     if (obj instanceof PushpinIF) {
       PushpinIF pobj = (PushpinIF) obj;
       if (!pobj.isOpen()) pobj.pinPopup(true);
     }
   }
   bChangeTool = true;
   setCurrentLayout();
   if (!pinPanel.isOpen()) {
     pinPanel.setVisible(false);
     bChangeTool = false;
     return false;
   }
   displayTool((Component) obj);
   VnmrjIF vif = Util.getVjIF();
   if (vif != null) vif.raiseToolPanel(true);
   bChangeTool = false;
   validate();
   repaint();
   return true;
 }
Esempio 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();
  }