/** @param args */
  public void run(String[] arg0) {
    try {
      boolean chosen = buildUpdateGUI();
      if (!chosen) System.exit(0);

      if (getShotsUsingAssets()) if (confirmShotsToUpdate() == null) System.exit(0);
      processNodes();
      System.err.println("DONE");
      System.exit(0);
    } catch (PipelineException e) {
      e.printStackTrace();
    }
  } // end run(String)
  /** @param args */
  public static void main(String[] args) {
    UpdateAssetGUI gui = new UpdateAssetGUI();
    try {
      boolean chosen = gui.buildUpdateGUI();
      if (!chosen) System.exit(0);

      if (gui.getShotsUsingAssets()) if (gui.confirmShotsToUpdate() == null) System.exit(0);
      gui.processNodes();
      System.err.println("DONE");
      System.exit(0);
    } catch (PipelineException e) {
      e.printStackTrace();
    }
  } // end main(args)
  public UpdateAssetGUI() {
    try {
      PluginMgrClient.init();
      mclient = new MasterMgrClient();
      queue = new QueueMgrClient();
      plug = PluginMgrClient.getInstance();
      log = LogMgr.getInstance();

      pAssetManager = new TreeMap<String, AssetInfo>();

      project = "lr";
      charList = new TreeMap<String, String>();
      setsList = new TreeMap<String, String>();
      propsList = new TreeMap<String, String>();

      potentialUpdates = new TreeSet<String>();
      pSubstituteFields = new TreeMap<String, LinkedList<JBooleanField>>();

      /* load the look-and-feel */
      {
        try {
          SynthLookAndFeel synth = new SynthLookAndFeel();
          synth.load(
              LookAndFeelLoader.class.getResourceAsStream("synth.xml"), LookAndFeelLoader.class);
          UIManager.setLookAndFeel(synth);
        } catch (java.text.ParseException ex) {
          log.log(
              LogMgr.Kind.Ops,
              LogMgr.Level.Severe,
              "Unable to parse the look-and-feel XML file (synth.xml):\n" + "  " + ex.getMessage());
          System.exit(1);
        } catch (UnsupportedLookAndFeelException ex) {
          log.log(
              LogMgr.Kind.Ops,
              LogMgr.Level.Severe,
              "Unable to load the Pipeline look-and-feel:\n" + "  " + ex.getMessage());
          System.exit(1);
        }
      }

      /* application wide UI settings */
      {
        JPopupMenu.setDefaultLightWeightPopupEnabled(false);
        ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);
      }
    } catch (PipelineException ex) {
      ex.printStackTrace();
    } // end try/catch
  } // end constructor
 public void actionPerformed(ActionEvent e) {
   String com = e.getActionCommand();
   if (com.equals("user")) {
     String user1 = userField.getSelected();
     String view1 = viewField.getSelected();
     viewField.setValues(areas.get(user1));
     if (areas.get(user1).contains(view1)) viewField.setSelected(view1);
     try {
       w = new Wrapper(user1, viewField.getSelected(), toolsetField.getSelected(), mclient);
     } catch (PipelineException e1) {
       e1.printStackTrace();
       System.exit(1);
     }
   } else if (com.equals("wrap")) {
     try {
       w =
           new Wrapper(
               userField.getSelected(),
               viewField.getSelected(),
               toolsetField.getSelected(),
               mclient);
     } catch (PipelineException e1) {
       e1.printStackTrace();
       System.exit(1);
     }
   } else if (com.equals("proj")) {
     project = projectField.getSelected();
   } else if (com.equals("add")) {
     list.add(assetChoiceBox());
     diag.validate();
   } else if (com.equals("type")) {
     JCollectionField eventSrc = (JCollectionField) e.getSource();
     Collection<String> curList = getCorrectList(eventSrc.getSelected());
     Box can = (Box) eventSrc.getParent();
     JCollectionField oldList = ((JCollectionField) can.getComponent(2));
     oldList.setValues(curList);
     JCollectionField newList = (JCollectionField) can.getComponent(4);
     newList.setValues(curList);
   }
 } // end actionPerformed
 /**
  * Internal constructor used to create new events.
  *
  * @param nodeOp The type of node operation recorded by the event.
  * @param name The fully resolved node name.
  * @param author The name of the user which generated the event.
  */
 protected BaseNodeEvent(NodeEventOp nodeOp, String name, String author) {
   this(System.currentTimeMillis(), nodeOp, name, author);
 }
 /**
  * Mark the given server as having become unreachable.
  *
  * @param hostname The fully resolved name of the host.
  */
 public synchronized void unreachable(String hostname) {
   pStamps.put(hostname, System.currentTimeMillis());
 }