/**
  * Konstruktor.
  *
  * @param gameId - Id des Spiels für das der Agent angemeldet wird.
  * @param params - Spielparameter
  * @param coordinator - Koordinator zur Kommunikation mit dem Server
  * @param agentPath - Pfad in dem sich die Agenten befinden.
  * @param parent - Parentmaske
  * @param hostname - Name des Simulationsservers
  */
 public AgentRegistrationFrame(
     Id gameId,
     Hashtable params,
     ICoordinator coordinator,
     GameTab parent,
     String scenarioName,
     String pathName) {
   // ClientInfoObject holen
   m_clientInfoObject = ClientInfoObject.getInstance(pathName);
   enableEvents(AWTEvent.WINDOW_EVENT_MASK);
   try {
     m_coordinator = coordinator;
     m_parameter = params;
     m_gameId = gameId;
     m_parent = parent;
     m_scenarioName = scenarioName;
     // Oberfläche erstellen
     jbInit();
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
  /**
   * Die Methode liefert die Namen der auswählbaren Agentenklassen zurück.
   *
   * @return Vector
   */
  private Vector getAgentClasses() {
    Vector retval = new Vector();
    try {

      String packageName =
          m_clientInfoObject
                  .getAgentClassesPath()
                  .substring(
                      m_clientInfoObject
                              .getAgentClassesPath()
                              .lastIndexOf(
                                  m_clientInfoObject.getPathSeparator(),
                                  m_clientInfoObject
                                          .getAgentClassesPath()
                                          .lastIndexOf(m_clientInfoObject.getPathSeparator())
                                      - 1)
                          + 1,
                      m_clientInfoObject.getAgentClassesPath().length() - 1)
              + "."
              + m_scenarioName;
      String completeAgentClassPath =
          m_clientInfoObject.getAgentClassesPath()
              + m_scenarioName
              + m_clientInfoObject.getPathSeparator()
              + AGENTENORDNER
              + m_clientInfoObject.getPathSeparator();
      System.out.println("PackageName: " + packageName);
      System.out.println(
          "Fileseperator: "
              + m_clientInfoObject.getPathSeparator()
              + " muesste sein "
              + File.pathSeparator);
      System.out.println("Agentpath: " + completeAgentClassPath);

      // File pathName = new File(m_clientInfoObject.getAgentClassesPath());
      File pathName = new File(completeAgentClassPath);
      File[] files = pathName.listFiles();

      for (int i = 0; i < files.length; i++) {
        /*
         * Das .class Ende abschneiden, bevor die Daten zurück gegeben
         * werden.
         */
        if (!(files[i].isDirectory()) && (files[i].getName().endsWith("Agent.class"))) {
          /*
           * Erst mal testen, ob das auch eine Verwendbare
           * Agentenklasse ist.
           */
          boolean runableAgent = true;
          /*         try {
          //        File mFile=files[i];
          //        String clName=files[i].getName().substring(0,files[i].getName().length()-6);
          //        ClassLoader classLoader= this.getClass().getClassLoader();
          //        Class agentClass2=Class.forName(clName, true, classLoader);


                  Class agentClass = Class.forName(
                          packageName
                          + "." + AGENTENORDNER + "."
                          +  files[i].getName().substring(0,files[i].getName().length()-6));
                  Method method =
                          agentClass.getDeclaredMethod(
                          "isRunableAgent", new Class[]{});
                          Object answer = method.invoke(null,new Object[]{});
                          if(answer instanceof Boolean) {
                              boolean value = ((Boolean)answer).booleanValue();
                              if(value == false) {
                                  runableAgent = false;
                              }
                          }
              }catch (Exception e) {
                  e.printStackTrace(System.out);
              } */
          if (runableAgent) {
            System.out.println("Agentclass " + files[i].getName() + " gefunden.");
            retval.addElement(files[i].getName().substring(0, files[i].getName().length() - 6));
          }
        }
      }
      if (retval.size() > 0) {
        return retval;
      }
    } catch (Exception ioE) {
      System.out.println("Fehler: " + ioE.toString());
      ioE.printStackTrace(System.out);
    }
    return retval;
  }