Beispiel #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;
 }
Beispiel #2
0
 private void setSelectedTab(int id, String name) {
   if (tabbedPane == null) return;
   int selectId = id;
   if (name != null) {
     for (int k = 0; k < tabbedPane.getTabCount(); k++) {
       String tabName = tabbedPane.getTitleAt(k);
       if (name.equals(tabName)) {
         selectId = k;
         break;
       }
     }
   }
   if (selectId >= 0 && selectId < tabbedPane.getTabCount()) tabbedPane.setSelectedIndex(selectId);
 }