Esempio n. 1
0
 private void displayTool(Component comp) {
   if (tabbedPane != null && tabbedPane.getTabCount() > 1) {
     if (tabbedPane.indexOfComponent(comp) >= 0) {
       tabbedPane.setSelectedComponent(comp);
     }
   }
   if (comp instanceof PushpinObj) comp = ((PushpinObj) comp).getPinObj();
   if (comp instanceof XMLToolPanel) {
     ((XMLToolPanel) comp).updateChange();
     ((XMLToolPanel) comp).setEditMode(inEditMode);
   } else if (comp instanceof VToolPanel) ((VToolPanel) comp).updateValue();
 }
 public void propertyChange(PropertyChangeEvent e) {
   if (e.getSource() instanceof PanelThreadMonitor) {
     if (e.getPropertyName().equals("Status")) {
       PanelThreadMonitor mntTmp = (PanelThreadMonitor) e.getSource();
       int iMonitorIndex = pnlThread.indexOfComponent(mntTmp);
       if (iMonitorIndex >= 0) {
         if (e.getNewValue().equals("Started")) {
           if (!pnlThread.getBackgroundAt(iMonitorIndex).equals(COLOR_STARTED)) {
             pnlThread.setBackgroundAt(iMonitorIndex, COLOR_STARTED);
             pnlThread.setForegroundAt(iMonitorIndex, COLOR_STARTED_FG);
           }
         } else if (e.getNewValue().equals("Stopped")) {
           if (!pnlThread.getBackgroundAt(iMonitorIndex).equals(SystemColor.controlShadow)) {
             pnlThread.setBackgroundAt(iMonitorIndex, UIManager.getColor("TabbedPane.background"));
             pnlThread.setForegroundAt(iMonitorIndex, SystemColor.textText);
           }
         }
       }
     }
   }
 }