1 package org.opentrafficsim.animation.data;
2
3 import org.djutils.draw.line.PolyLine2d;
4 import org.djutils.draw.point.OrientedPoint2d;
5 import org.opentrafficsim.base.geometry.OtsBounds2d;
6 import org.opentrafficsim.draw.road.TrafficLightDetectorAnimation.TrafficLightDetectorData;
7 import org.opentrafficsim.road.network.lane.object.detector.TrafficLightDetector;
8
9
10
11
12
13
14
15
16
17 public class AnimationTrafficLightDetectorData implements TrafficLightDetectorData
18 {
19
20
21 private final TrafficLightDetector trafficLigthDetector;
22
23
24
25
26
27 public AnimationTrafficLightDetectorData(final TrafficLightDetector trafficLigthDetector)
28 {
29 this.trafficLigthDetector = trafficLigthDetector;
30 }
31
32
33 @Override
34 public OrientedPoint2d getLocation()
35 {
36 return this.trafficLigthDetector.getLocation();
37 }
38
39
40 @Override
41 public OtsBounds2d getBounds()
42 {
43 return this.trafficLigthDetector.getBounds();
44 }
45
46
47 @Override
48 public PolyLine2d getGeometry()
49 {
50 return this.trafficLigthDetector.getGeometry();
51 }
52
53
54 @Override
55 public boolean getOccupancy()
56 {
57 return this.trafficLigthDetector.getOccupancy();
58 }
59
60
61 @Override
62 public String getId()
63 {
64 return this.trafficLigthDetector.getId();
65 }
66
67
68
69
70
71 public TrafficLightDetector getTrafficLightDetector()
72 {
73 return this.trafficLigthDetector;
74 }
75
76
77 @Override
78 public String toString()
79 {
80 return "Traffic light detector " + this.trafficLigthDetector.getId();
81 }
82
83 }