1 package org.opentrafficsim.editor.extensions.map;
2
3 import org.djutils.draw.point.Point2d;
4 import org.opentrafficsim.draw.road.PriorityAnimation.PriorityData;
5
6
7
8
9
10
11
12
13
14 public class MapPriorityData implements PriorityData
15 {
16
17
18 private final MapLinkData linkData;
19
20
21 private final Point2d location;
22
23
24
25
26
27 public MapPriorityData(final MapLinkData linkData)
28 {
29 this.location = linkData.getDesignLine().getLocationFractionExtended(0.5);
30 this.linkData = linkData;
31 }
32
33
34 @Override
35 public Point2d getLocation()
36 {
37 return this.location;
38 }
39
40
41 @Override
42 public boolean isAllStop()
43 {
44 return "ALL_STOP".equals(this.linkData.getNode().getAttributeValue("Priority"));
45 }
46
47
48 @Override
49 public boolean isBusStop()
50 {
51 return "BUS_STOP".equals(this.linkData.getNode().getAttributeValue("Priority"));
52 }
53
54
55 @Override
56 public boolean isNone()
57 {
58 return "NONE".equals(this.linkData.getNode().getAttributeValue("Priority"));
59 }
60
61
62 @Override
63 public boolean isPriority()
64 {
65 return "PRIORITY".equals(this.linkData.getNode().getAttributeValue("Priority"));
66 }
67
68
69 @Override
70 public boolean isStop()
71 {
72 return "STOP".equals(this.linkData.getNode().getAttributeValue("Priority"));
73 }
74
75
76 @Override
77 public boolean isYield()
78 {
79 return "YIELD".equals(this.linkData.getNode().getAttributeValue("Priority"));
80 }
81
82
83 @Override
84 public String toString()
85 {
86 return "Priority " + this.linkData.getId();
87 }
88
89 }