Package model

Examples of model.Line


  @Test
  public void searchScheduleByLineAndStation()
  {
    Timetable timetable1 = new Timetable();
   
    Line line1 = new Line();
    Station station1 = new Station();
   
    timetable1.setLine(line1);
    timetable1.setStation(station1);
    map.getTimetables().add(timetable1);
   
    assertEquals(1, map.searchSchedule(line1, station1).size());
   
    Timetable timetable2 = new Timetable();
    Line line2 = new Line();
    Station station2 = new Station();
   
    timetable2.setLine(line2);
    timetable2.setStation(station2);
    map.getTimetables().add(timetable2);
   
    Timetable timetable3 = new Timetable();
    Line line3 = new Line();
    Station station3 = new Station();
   
    timetable3.setLine(line3);
    timetable3.setStation(station3);
    map.getTimetables().add(timetable3);
View Full Code Here


 
  @Test
  public void searchScheduleByStation()
  {
    Timetable timetable1 = new Timetable()
    Line line1 = new Line();
    Station station1 = new Station();
   
    timetable1.setLine(line1);
    timetable1.setStation(station1);
    map.getTimetables().add(timetable1);
   
    assertEquals(1, map.searchSchedule(station1).size());
   
    Timetable timetable2 = new Timetable();
    Line line2 = new Line();
    Station station2 = new Station();
   
    timetable2.setLine(line2);
    timetable2.setStation(station2);
    map.getTimetables().add(timetable2);
   
    Timetable timetable3 = new Timetable();
    Line line3 = new Line();
    Station station3 = new Station();
   
    timetable3.setLine(line3);
    timetable3.setStation(station3);
    map.getTimetables().add(timetable3);
View Full Code Here

  }
 
  @Test
  public void findLineByName()
  {
    Line line1 = new Line("ligne1", TransportType.TRAMWAY, null);
    map.getLines().add(line1);
   
    assertEquals(line1, map.convertToLine("ligne1"));
  }
View Full Code Here

  }
 
  @Test
  public void nullLineByName()
  {
    Line line1 = new Line("ligne1", TransportType.TRAMWAY, null);
    map.getLines().add(line1);
   
    assertNull(map.convertToLine("test"));
  }
View Full Code Here

 
  @Test //test de getLinesNames
  public void testGetLinesNames(){
    String[] noms = new String[] {"Nom1", "Nom2"};
    LinkedList <Line> line = new LinkedList<Line>();
    line.add(new Line(noms[0], TransportType.BUS, null));
    line.add(new Line(noms[1], TransportType.BUS, null));
   
    test.getMap().setLines(line);
   
    assertArrayEquals(noms, test.getLinesNames());
  }
View Full Code Here

 
  @Test //test de checkLineName
  public void testCheckLineName(){
    String[] noms = new String[] {"Nom1", "Nom2"};
    LinkedList <Line> line = new LinkedList<Line>();
    line.add(new Line(noms[0], TransportType.BUS, null));
    line.add(new Line(noms[1], TransportType.BUS, null));
   
    test.getMap().setLines(line);
    assertTrue(test.checkLineName(noms[0]));
  }
View Full Code Here

  }
 
  @Test
  public void setgetLine()
  {
    Line line = new Line();
   
    timetable.setLine(line);
   
    assertEquals(line, timetable.getLine());
  }
View Full Code Here

    //Liste déroulante contenant "semaine" ou "week-end"
    Choice period = new Choice();
    period.addItem("Semaine");
    period.addItem("Week-end");
   
    Line tempLine = new Line();
    Station tempStation = new Station();
    Period tempPeriod = new Period();
   
    //Crée un message contenant des chaînes de caractères et les listes déroulantes
    Object[] message = new Object[] { "Ligne : ", line,
        "Station : ", station, "Période : " , period};
   
    //Crée la pop-up contenant le message
    int r = JOptionPane.showConfirmDialog(null, message,
        "Modifier des horaires", JOptionPane.OK_CANCEL_OPTION);
   
    //Si l'utilisateur a cliqué sur le bouton "OK"
    if (r == JOptionPane.OK_OPTION) {
      tempLine.setName(line.getSelectedItem().toString());
      tempStation.setName(station.getSelectedItem().toString());
     
      if(period.getSelectedItem()=="Semaine")
        numberPeriod=0;
      else
View Full Code Here

   */
  @Override
    public void actionPerformed(ActionEvent e) {
    HashMap<String, Line> map = new HashMap<String, Line>();
    map = controller.getLinesMap();
    Line temp = map.get(line.getSelectedItem().toString());
   
        DefaultComboBoxModel model = new DefaultComboBoxModel(temp.getStationsNames());
        station.setModel(model);
    }
View Full Code Here

          toShow.getName(), JOptionPane.PLAIN_MESSAGE,
          JOptionPane.CANCEL_OPTION, null, objLines, objLines[0]);

      //Si l'utilisateur a choisi une des lignes
      if (option >= 0) {
        Line converted = this.controller.getMap().convertToLine(
            objLines[option]);
       
        this.choosePeriod(toShow, converted);
      }
    }
View Full Code Here

TOP

Related Classes of model.Line

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.