Package net.geco.model

Examples of net.geco.model.Category


      }
    };
    ActionListener removeAction = new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        Category cat = getSelectedData();
        if( cat!=null ) {
          try {
            geco.stageControl().removeCategory(cat)
          } catch (Exception e2) {
            JOptionPane.showMessageDialog(frame,
View Full Code Here


   
    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));
   
    runnerControl().registerNewRunner(runner);
View Full Code Here

    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();
    if( category==null )
      category = registry().anyCategory();
    if( category==null )
      throw new RunnerCreationException(Messages.getString("RunnerControl.NoCategoryWarning")); //$NON-NLS-1$
View Full Code Here

    runner.setClub( registry().findClub(newClub) );
    return true;
  }
 
  public boolean validateCategory(Runner runner, String newCat) {
    Category oldCat = runner.getCategory();
    if( !oldCat.getShortname().equals(newCat) ) {
      runner.setCategory(registry().findCategory(newCat));
      registry().updateRunnerCategory(oldCat, runner);
      geco().log(Messages.getString("RunnerControl.CategoryChangeMessage1") //$NON-NLS-1$
            + runner.idString() + Messages.getString("RunnerControl.FromMessage") //$NON-NLS-1$
            + oldCat.getShortname() + Messages.getString("RunnerControl.ToMessage") //$NON-NLS-1$
            + newCat);
      return true;
    }
    return false;
  }
View Full Code Here

    super(factory, reader, writer, registry);
  }
 
  @Override
  public Category importTData(String[] record) {
    Category cat = this.factory.createCategory();
    cat.setShortname(record[0]);
    if( record.length==1 ){
      cat.setLongname("");
    } else {
      cat.setLongname(record[1]);
      if( record.length==3 ){
        cat.setCourse(registry.findCourse(record[2]));
      }     
    }
    return cat;
  }
View Full Code Here

      runner.setCourse(registry.anyCourse());
      System.err.println("Unknown course " + record[5] + " for runner " + runner.idString()); //$NON-NLS-1$ //$NON-NLS-2$
    } else {
      runner.setCourse(course);
    }
    Category cat = registry.findCategory(record[7]);
    if( cat == null ) {
      runner.setCategory(registry.noCategory());
      System.err.println("Unknown category " + record[7] + " for runner " + runner.idString()); //$NON-NLS-1$ //$NON-NLS-2$
    } else {
      runner.setCategory(cat);
View Full Code Here

    }
    return rClub;
  }

  protected Category ensureCategoryInRegistry(String categoryname, String longname) {
    Category rCat = registry().findCategory(categoryname);
    if( rCat==null ){
      rCat = stageControl().createCategory(categoryname, longname);
    }
    return rCat;
  }
View Full Code Here

   
    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$
            "", "", "", "", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
            "", "", "", "", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
            "", "", "",    //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
            "0", //$NON-NLS-1$
View Full Code Here

//    [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

    }
    return club;
  }

  private Category ensureCategoryInArchive(String shortName, String longName) {
    Category cat = archive.findCategory(shortName);
    if( cat==null ) {
      cat = geco().factory().createCategory();
      cat.setShortname(shortName);
      cat.setLongname(longName);
      archive.addCategory(cat);
    }
    return cat;
  }
View Full Code Here

TOP

Related Classes of net.geco.model.Category

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.