Ejemplo n.º 1
0
 public boolean popdnTool(String name) {
   JComponent obj = searchTool(name);
   if (obj == null) return false;
   if (obj instanceof VToolPanel) {
     if (!((VToolPanel) obj).popdnTool(name)) return false;
   } else {
     if (obj instanceof PushpinIF) {
       PushpinIF pobj = (PushpinIF) obj;
       pobj.pinPopup(false);
     }
     boolean bContain = containTool(obj);
     if (!bContain) return false;
   }
   bChangeTool = true;
   setCurrentLayout();
   if (previous_selectedTab >= 1 && tabbedPane != null) {
     if (tabbedPane.getTabCount() > previous_selectedTab)
       tabbedPane.setSelectedIndex(previous_selectedTab);
   }
   VnmrjIF vif = Util.getVjIF();
   if (vif != null) vif.raiseToolPanel(false);
   if (!pinPanel.isOpen()) pinPanel.setVisible(false);
   bChangeTool = false;
   updateSelectedObj();
   repaint();
   return true;
 }
Ejemplo n.º 2
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;
 }
Ejemplo n.º 3
0
  public void showPinObj(PushpinIF pobj, boolean on) {
    Component comp = (Component) pobj;
    if (comp == null) return;
    Container p = comp.getParent();
    if (!on) {
      pobj.setPopup(false, true);
      if (p != null && p != tabbedPane) {
        p.remove(comp);
        p.validate();
        p.repaint();
      }
      if (popupComp == comp) popupComp = null;
      return;
    }

    if (popupComp != null) {
      if (popupComp != comp) {
        ((PushpinIF) popupComp).setPopup(false, true);
        p = popupComp.getParent();
        if (p != null && p != tabbedPane) {
          p.remove(popupComp);
        }
      }
      popupComp = null;
    }
    /*
    if (!isShowing()) {
        return;
    }
     */
    if (comp.isShowing()) {
      return;
    }
    Container p2 = null;
    p = pinPanel.getParent();
    while (p != null) {
      if (p instanceof JLayeredPane) p2 = p;
      p = p.getParent();
    }
    if (p2 == null) return;
    if (!isShowing()) {
      VnmrjIF vif = Util.getVjIF();
      vif.raiseToolPanel(on);
      setVisible(true);
    }

    popupComp = comp;
    p = p2;
    pobj.setPopup(true, true);
    /*
    Point pt0 = p.getLocationOnScreen();
    Point pt1 = getLocationOnScreen();
     */
    Point pt1 = getLocation();
    Dimension dim = getSize();
    int y0 = (int) ((float) dim.height * pobj.getRefY());
    int h = (int) ((float) dim.height * pobj.getRefH());
    int x = pt1.x + 2;
    int y = pt1.y + y0;
    p.add(comp, JLayeredPane.MODAL_LAYER);
    comp.setBounds(x, y, dim.width, dim.height - y0);
    ((JComponent) p).validate();
    /*
    p.repaint();
     */
  }