1
2
3
4
5
6
7
8 package edu.uci.ics.jung.visualization3d;
9
10
11
12 import javax.media.j3d.Node;
13 import javax.media.j3d.Transform3D;
14 import javax.media.j3d.TransformGroup;
15
16
17
18
19
20
21 public class VertexGroup<V> extends TransformGroup {
22
23 V vertex;
24 Node shape;
25 TransformGroup labelNode = new TransformGroup();
26
27 public VertexGroup(V vertex, Node shape) {
28 this.vertex = vertex;
29 this.shape = shape;
30 setCapability(TransformGroup.ENABLE_PICK_REPORTING);
31 addChild(shape);
32 addChild(labelNode);
33 Transform3D tt = new Transform3D();
34
35 labelNode.setTransform(tt);
36 }
37
38
39
40
41
42 public Node getShape() {
43 return shape;
44 }
45
46
47
48
49
50 public void setShape(Node shape) {
51 this.shape = shape;
52 }
53
54
55 public String toString() { return "VertexGroup for "+vertex.toString(); }
56
57
58
59
60
61 public TransformGroup getLabelNode() {
62 return labelNode;
63 }
64
65 }