1 package org.opentrafficsim.editor.extensions.map;
2
3 import org.opentrafficsim.base.geometry.BoundingRectangle;
4 import org.opentrafficsim.base.geometry.OtsBounds2d;
5 import org.opentrafficsim.draw.DrawLevel;
6 import org.opentrafficsim.draw.road.GtuGeneratorPositionAnimation.GtuGeneratorPositionData;
7 import org.opentrafficsim.editor.OtsEditor;
8 import org.opentrafficsim.editor.XsdTreeNode;
9
10
11
12
13
14
15
16
17
18 public class MapGeneratorData extends MapLaneBasedObjectData implements GtuGeneratorPositionData
19 {
20
21
22 private static final long serialVersionUID = 20240310L;
23
24
25 private final String type;
26
27
28
29
30
31
32
33 public MapGeneratorData(final EditorMap map, final XsdTreeNode node, final OtsEditor editor)
34 {
35 super(map, node, editor);
36 this.type = node.getNodeName().equals("Generator") ? "Generator " : "List generator ";
37 }
38
39
40 @Override
41 protected OtsBounds2d calculateBounds()
42 {
43 return new BoundingRectangle(0.0, 4.75, -1.0, 1.0);
44 }
45
46
47 @Override
48 public int getQueueCount()
49 {
50 return 0;
51 }
52
53
54 @Override
55 public double getZ()
56 {
57 return DrawLevel.OBJECT.getZ();
58 }
59
60
61 @Override
62 public String toString()
63 {
64 return this.type + getLinkLanePositionId();
65 }
66
67 }