1 package org.opentrafficsim.animation.data;
2
3 import org.djutils.draw.line.Polygon2d;
4 import org.djutils.draw.point.OrientedPoint2d;
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 @Override
32 public Polygon2d getContour()
33 {
34 throw new UnsupportedOperationException("Nodes do not have a drawable contour.");
35 }
36
37 @Override
38 public String getId()
39 {
40 return this.node.getId();
41 }
42
43 @Override
44 public OrientedPoint2d getLocation()
45 {
46 return this.node.getLocation();
47 }
48
49
50
51
52
53 public Node getNode()
54 {
55 return this.node;
56 }
57
58 @Override
59 public String toString()
60 {
61 return "Node " + this.node.getId();
62 }
63
64 }