1 package org.opentrafficsim.animation.data;
2
3 import org.djutils.draw.point.OrientedPoint2d;
4 import org.opentrafficsim.base.geometry.OtsBounds2d;
5 import org.opentrafficsim.core.network.Node;
6 import org.opentrafficsim.draw.network.NodeAnimation.NodeData;
7
8
9
10
11
12
13
14
15
16 public class AnimationNodeData implements NodeData
17 {
18
19
20 private final Node node;
21
22
23
24
25
26 public AnimationNodeData(final Node node)
27 {
28 this.node = node;
29 }
30
31
32 @Override
33 public OtsBounds2d getBounds()
34 {
35 return this.node.getBounds();
36 }
37
38
39 @Override
40 public String getId()
41 {
42 return this.node.getId();
43 }
44
45
46 @Override
47 public OrientedPoint2d getLocation()
48 {
49 return this.node.getLocation();
50 }
51
52
53
54
55
56 public Node getNode()
57 {
58 return this.node;
59 }
60
61
62 @Override
63 public String toString()
64 {
65 return "Node " + this.node.getId();
66 }
67
68 }