Package net.geco.model

Examples of net.geco.model.Club


    runner.setNC(record[8].equals("X")); //$NON-NLS-1$
   
    Date relativeTime = TimeManager.safeParse(record[9]); // ! Time since zero hour
    runner.setRegisteredStarttime( TimeManager.absoluteTime(relativeTime, stage().getZeroHour()) );

    Club club = ensureClubInRegistry(record[15], record[14]);
    Category cat = ensureCategoryInRegistry(record[18], record[19]);
    runner.setClub(club);
    runner.setCategory(cat);
    runner.setCourse(registry().getDefaultCourseOrAnyFor(cat));
   
View Full Code Here


      }
    };
    ActionListener removeAction = new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        Club club = getSelectedData();
        if( club!=null ) {
          boolean removed = geco.stageControl().removeClub(club);
          if( !removed ) {
            JOptionPane.showMessageDialog(frame,
                  Messages.uiGet("StagePanel.ClubNoDeletionWarning"), //$NON-NLS-1$
View Full Code Here

    return runner;
  }
  private void setDefaults(Course course, Runner runner) throws RunnerCreationException {
    if( course==null )
      throw new RunnerCreationException(Messages.getString("RunnerControl.NoCourseWarning")); //$NON-NLS-1$
    Club club = registry().noClub();
    if( club==null )
      club = registry().anyClub();
    if( club==null )
      throw new RunnerCreationException(Messages.getString("RunnerControl.NoClubWarning")); //$NON-NLS-1$
    Category category = registry().noCategory();
View Full Code Here

    Runner runner = this.factory.createRunner();
    runner.setStartId(Integer.valueOf(record[0]));
    runner.setEcard(record[1]);
    runner.setFirstname(record[2]);
    runner.setLastname(record[3]);
    Club club = registry.findClub(record[4]);
    if( club == null ) {
      runner.setClub(registry.noClub());
      System.err.println("Unknown club " + record[4] + " for runner " + runner.idString()); //$NON-NLS-1$ //$NON-NLS-2$
    } else {
      runner.setClub(club);
View Full Code Here

    super(factory, reader, writer, registry);
  }
 
  @Override
  public Club importTData(String[] record) {
    Club club = this.factory.createClub();
    club.setName(record[0]);
    if( record.length==2 ){
      club.setShortname(record[1]);
    } else {
      club.setShortname(""); //$NON-NLS-1$
    }
    return club;
  }
View Full Code Here

  private StageControl stageControl() {
    return geco().getService(StageControl.class);
  }

  protected Club ensureClubInRegistry(String clubname, String shortname) {
    Club rClub = registry().findClub(clubname);
    if( rClub==null ) {
      rClub = stageControl().createClub(clubname, shortname);
    }
    return rClub;
  }
View Full Code Here

    List<String> coursenames = registry().getCourseNames();
   
    for (RunnerRaceData runnerData : registry().getRunnersData()) {
      Runner runner = runnerData.getRunner();
      if( runnerData.hasResult() ) {
        Club club = runner.getClub();
        Category category = runner.getCategory();
        Course course = runner.getCourse();
       
        Collection<String> record = saveRecord(
            runner.getStartId().toString(),
            runner.getEcard(),
            ( runner.getArchiveId()!=null )? runner.getArchiveId().toString() : "", //$NON-NLS-1$
            runner.getLastname(),
            runner.getFirstname(),
            "", //$NON-NLS-1$ // ark.getBirthYear(),
            "", //$NON-NLS-1$ // ark.getSex(),
            "", //$NON-NLS-1$
            ( runner.isNC() ) ? "X" : "0", //$NON-NLS-1$ //$NON-NLS-2$
            oeTime(runnerData.getOfficialStarttime()),
            oeTime(runnerData.getFinishtime()),
            oeTime(new Date(runnerData.getResult().getRacetime())),
            oeEvaluationCode(runnerData.getStatus()),
            Integer.toString(clubnames.indexOf(club.getName())),
            club.getShortname(),
            club.getName(),
            "", //$NON-NLS-1$
            Integer.toString(categorynames.indexOf(category.getName())),
            category.getShortname(),
            category.getLongname(),
            "", "", "", "", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
View Full Code Here

  protected void importRunnerRecord(String[] record) {
//    [0-5] Ident. base de données;Puce;Nom;Prénom;Né;S;
//    [6-9] N° club;Nom;Ville;Nat;
//    [10-15] N° cat.;Court;Long;Num1;Num2;Num3;
//    E_Mail;Texte1;Texte2;Texte3;Adr. nom;Rue;Ligne2;Code Post.;Ville;Tél.;Fax;E-mail;Id/Club;Louée
    Club club = ensureClubInArchive(record[7], record[8]);
    Category cat = ensureCategoryInArchive(record[11], record[12]);
    importRunner(record, club, cat);
  }
View Full Code Here

    archive.addRunner(runner);
  }


  private Club ensureClubInArchive(String shortName, String longName) {
    Club club = archive.findClub(longName);
    if( club==null ) {
      club = geco().factory().createClub();
      club.setName(trimQuotes(longName));
      club.setShortname(shortName);
      archive.addClub(club);
    }
    return club;
  }
View Full Code Here

  private Category ensureCategoryInRegistry(Category category) {
    return ensureCategoryInRegistry(category.getName(), category.getLongname());
  }

  private Runner createRunner(ArchiveRunner arkRunner, Course course) {
    Club club = arkRunner.getClub();
    Club rClub = ensureClubInRegistry(club.getName(), club.getShortname());
    Category category = arkRunner.getCategory();
    Category rCat = ensureCategoryInRegistry(category.getName(), category.getLongname());
    String ecard = arkRunner.getEcard();
    if( ecard.equals("") ){ //$NON-NLS-1$
      geco().log(Messages.getString("ArchiveManager.NoMatchingEcardWarning") + arkRunner.getName()); //$NON-NLS-1$
View Full Code Here

TOP

Related Classes of net.geco.model.Club

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.