View Javadoc

1   /*
2    * Created on Dec 18, 2003
3    * 
4    * Copyright (c) 2003, 2004 Delft University of Technology Jaffalaan 5, 2628 BX
5    * Delft, the Netherlands All rights reserved.
6    * 
7    * This software is proprietary information of Delft University of Technology
8    * The code is published under the General Public License
9    */
10  
11  package nl.tudelft.simulation.traffic.controlpoint.virtual;
12  
13  import nl.tudelft.simulation.dsol.simulators.SimulatorInterface;
14  import nl.tudelft.simulation.event.Event;
15  import nl.tudelft.simulation.event.EventInterface;
16  import nl.tudelft.simulation.traffic.controlpoint.real.VisibleControlPointInterface;
17  import nl.tudelft.simulation.traffic.track.TrackInterface;
18  import nl.tudelft.simulation.traffic.vehicle.VehiclePhysicalInterface;
19  
20  /***
21   */
22  public class Show extends VirtualControlPoint implements ShowInterface
23  {
24      /*** the owner */
25      private VisibleControlPointInterface owner;
26  
27      /***
28       * @param track
29       * @param progression
30       * @param owner
31       * @param simulator
32       */
33      public Show(final TrackInterface track, final double progression,
34              final VisibleControlPointInterface owner,
35              final SimulatorInterface simulator)
36      {
37          super(track, progression, simulator);
38          this.owner = owner;
39      }
40  
41      /***
42       * @see nl.tudelft.simulation.traffic.controlpoint.virtual.ShowInterface#getOwner()
43       */
44      public VisibleControlPointInterface getOwner()
45      {
46          return this.owner;
47      }
48  
49      /***
50       * @see nl.tudelft.simulation.traffic.controlpoint.ControlPointInterface#pass(nl.tudelft.simulation.traffic.vehicle.VehiclePhysicalInterface)
51       */
52      public void pass(final VehiclePhysicalInterface vehicle)
53      {
54          EventInterface ev = new Event(ShowInterface.VISIBLE, this, this.owner);
55          this.fireEvent(ev);
56      }
57  }