aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarvey Harrison <[email protected]>2012-05-08 15:43:22 -0700
committerHarvey Harrison <[email protected]>2012-05-08 15:43:22 -0700
commitad9e0e16f1419bb0323a10bdbbef9fc9215d1157 (patch)
tree23c215a8701725bb6ae8a6ef11765c1c72739ce7 /src
parentdae49ab10772e2f44ea6867fec21f1d1a2ccc643 (diff)
j3dcore: annotate the SharedGroupRetained parents member
Signed-off-by: Harvey Harrison <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/classes/share/javax/media/j3d/BHTree.java4
-rw-r--r--src/classes/share/javax/media/j3d/GroupRetained.java9
-rw-r--r--src/classes/share/javax/media/j3d/LinkRetained.java8
-rw-r--r--src/classes/share/javax/media/j3d/NodeRetained.java20
-rw-r--r--src/classes/share/javax/media/j3d/PickInfo.java4
-rw-r--r--src/classes/share/javax/media/j3d/SceneGraphPath.java3
-rw-r--r--src/classes/share/javax/media/j3d/SharedGroupRetained.java11
-rw-r--r--src/classes/share/javax/media/j3d/WakeupOnCollisionEntry.java6
8 files changed, 28 insertions, 37 deletions
diff --git a/src/classes/share/javax/media/j3d/BHTree.java b/src/classes/share/javax/media/j3d/BHTree.java
index d1dc3a0..9d3c3a9 100644
--- a/src/classes/share/javax/media/j3d/BHTree.java
+++ b/src/classes/share/javax/media/j3d/BHTree.java
@@ -518,9 +518,9 @@ class BHTree {
// retrieve the last node ID
String nodeId = key.getLastNodeId();
NodeRetained prevNode = node;
- Vector parents = ((SharedGroupRetained) node).parents;
+ Vector<NodeRetained> parents = ((SharedGroupRetained)node).parents;
for(int i=parents.size()-1; i >=0; i--) {
- NodeRetained link = (NodeRetained) parents.elementAt(i);
+ NodeRetained link = parents.get(i);
if (link.nodeId.equals(nodeId)) {
node = link;
break;
diff --git a/src/classes/share/javax/media/j3d/GroupRetained.java b/src/classes/share/javax/media/j3d/GroupRetained.java
index 4ee5441..b610aa1 100644
--- a/src/classes/share/javax/media/j3d/GroupRetained.java
+++ b/src/classes/share/javax/media/j3d/GroupRetained.java
@@ -2914,10 +2914,10 @@ synchronized void setAltAppScope() {
if (node instanceof SharedGroupRetained) {
// retrieve the last node ID
String nodeId = key.getLastNodeId();
- Vector parents = ((SharedGroupRetained) node).parents;
+ Vector<NodeRetained> parents = ((SharedGroupRetained)node).parents;
// find the matching link
for(int i=parents.size()-1; i >=0; i--) {
- NodeRetained link = (NodeRetained) parents.get(i);
+ NodeRetained link = parents.get(i);
if (link.nodeId.equals(nodeId)) {
node = link;
break;
@@ -3148,8 +3148,7 @@ synchronized void setAltAppScope() {
}
} else if (parent instanceof SharedGroupRetained) {
String nodeId = key.getLastNodeId();
- Vector parents = ((SharedGroupRetained) parent).parents;
- NodeRetained ln;
+ Vector<NodeRetained> parents = ((SharedGroupRetained)parent).parents;
if (parentSwitchLinkChildIndex == -1) {
parentSwitchLinkChildIndex =
@@ -3157,7 +3156,7 @@ synchronized void setAltAppScope() {
}
for(j=0; j< parents.size(); j++) {
- ln = (NodeRetained)parents.get(j);
+ NodeRetained ln = parents.get(j);
if (ln.nodeId.equals(nodeId)) {
parent = ln;
break;
diff --git a/src/classes/share/javax/media/j3d/LinkRetained.java b/src/classes/share/javax/media/j3d/LinkRetained.java
index d06813b..b895693 100644
--- a/src/classes/share/javax/media/j3d/LinkRetained.java
+++ b/src/classes/share/javax/media/j3d/LinkRetained.java
@@ -84,7 +84,7 @@ class LinkRetained extends LeafRetained {
((GroupRetained) parent).checkClearLive(this.sharedGroup,
newKeys, true, null,
0, 0, this);
- this.sharedGroup.parents.removeElement(this);
+ this.sharedGroup.parents.remove(this);
}
}
@@ -97,7 +97,7 @@ class LinkRetained extends LeafRetained {
if (source.isLive() && (sharedGroup != null)) {
- this.sharedGroup.parents.addElement(this);
+ this.sharedGroup.parents.add(this);
visited = true;
try {
int ci = ((GroupRetained) parent).indexOfChild((Node)this.sharedGroup.source);
@@ -163,7 +163,7 @@ class LinkRetained extends LeafRetained {
}
if (sharedGroup != null) {
- this.sharedGroup.parents.addElement(this);
+ this.sharedGroup.parents.add(this);
HashKey newKeys[] = getNewKeys(s.locale.nodeId, s.keys);
HashKey oldKeys[] = s.keys;
s.keys = newKeys;
@@ -230,7 +230,7 @@ class LinkRetained extends LeafRetained {
HashKey oldKeys[] = s.keys;
s.keys = newKeys;
s.inSharedGroup = true;
- this.sharedGroup.parents.removeElement(this);
+ this.sharedGroup.parents.remove(this);
this.sharedGroup.clearLive(s);
s.inSharedGroup = inSharedGroup;
s.keys = oldKeys;
diff --git a/src/classes/share/javax/media/j3d/NodeRetained.java b/src/classes/share/javax/media/j3d/NodeRetained.java
index d8a304c..e9c0ad1 100644
--- a/src/classes/share/javax/media/j3d/NodeRetained.java
+++ b/src/classes/share/javax/media/j3d/NodeRetained.java
@@ -352,13 +352,10 @@ ArrayList<BranchGroupRetained[]> branchGroupPaths = new ArrayList<BranchGroupRet
// Search for the right parent.
for(i=0; i<sgRetained.parents.size(); i++) {
- if(nodeId.equals((String)(((NodeRetained)
- (sgRetained.parents.elementAt(i))).nodeId))) {
+ if (nodeId.equals(sgRetained.parents.get(i).nodeId)) {
// Found the right link. Now traverse upward.
- computeLocalToVworld(caller,
- (NodeRetained)(sgRetained.parents.elementAt(i)),
- key, l2Vw);
+ computeLocalToVworld(caller, sgRetained.parents.get(i), key, l2Vw);
return;
}
}
@@ -774,11 +771,11 @@ ArrayList<BranchGroupRetained[]> branchGroupPaths = new ArrayList<BranchGroupRet
do {
if (nodeR instanceof SharedGroupRetained) {
String nodeId = key.getLastNodeId();
- Vector parents = ((SharedGroupRetained) nodeR).parents;
+ Vector<NodeRetained> parents = ((SharedGroupRetained)nodeR).parents;
int sz = parents.size();
NodeRetained prevNodeR = nodeR;
for(int j=0; j< sz; j++) {
- NodeRetained linkR = (NodeRetained) parents.elementAt(j);
+ NodeRetained linkR = parents.get(j);
if (linkR.nodeId.equals(nodeId)) {
nodeR = linkR;
break;
@@ -827,11 +824,11 @@ ArrayList<BranchGroupRetained[]> branchGroupPaths = new ArrayList<BranchGroupRet
do {
if (nodeR instanceof SharedGroupRetained) {
String nodeId = key.getLastNodeId();
- Vector parents = ((SharedGroupRetained) nodeR).parents;
+ Vector<NodeRetained> parents = ((SharedGroupRetained)nodeR).parents;
int sz = parents.size();
NodeRetained prevNodeR = nodeR;
for(int j=0; j< sz; j++) {
- NodeRetained linkR = (NodeRetained) parents.elementAt(j);
+ NodeRetained linkR = parents.get(j);
if (linkR.nodeId.equals(nodeId)) {
nodeR = linkR;
break;
@@ -882,12 +879,11 @@ ArrayList<BranchGroupRetained[]> branchGroupPaths = new ArrayList<BranchGroupRet
else if (nodeR instanceof SharedGroupRetained) {
// note that key is truncated after getLastNodeId
String nodeId = key.getLastNodeId();
- Vector parents = ((SharedGroupRetained) nodeR).parents;
+ Vector<NodeRetained> parents = ((SharedGroupRetained)nodeR).parents;
int sz = parents.size();
NodeRetained prevNodeR = nodeR;
for (j=0; j< sz; j++) {
- NodeRetained linkR =
- (NodeRetained) parents.elementAt(j);
+ NodeRetained linkR = parents.get(j);
if (linkR.nodeId.equals(nodeId)) {
nodeR = linkR;
break;
diff --git a/src/classes/share/javax/media/j3d/PickInfo.java b/src/classes/share/javax/media/j3d/PickInfo.java
index d96dba1..ac85374 100644
--- a/src/classes/share/javax/media/j3d/PickInfo.java
+++ b/src/classes/share/javax/media/j3d/PickInfo.java
@@ -454,11 +454,11 @@ public class PickInfo extends Object {
if (nodeR instanceof SharedGroupRetained) {
// retrieve the last node ID
String nodeId = key.getLastNodeId();
- Vector parents = ((SharedGroupRetained) nodeR).parents;
+ Vector<NodeRetained> parents = ((SharedGroupRetained)nodeR).parents;
int sz = parents.size();
NodeRetained prevNodeR = nodeR;
for(int i=0; i< sz; i++) {
- NodeRetained linkR = (NodeRetained) parents.elementAt(i);
+ NodeRetained linkR = parents.get(i);
if (linkR.nodeId.equals(nodeId)) {
nodeR = linkR;
// Need to add Link to the path report
diff --git a/src/classes/share/javax/media/j3d/SceneGraphPath.java b/src/classes/share/javax/media/j3d/SceneGraphPath.java
index da9ccfc..1741162 100644
--- a/src/classes/share/javax/media/j3d/SceneGraphPath.java
+++ b/src/classes/share/javax/media/j3d/SceneGraphPath.java
@@ -490,8 +490,7 @@ public class SceneGraphPath {
if (interior == null)
return false;
while (--idx > 0) {
- if (((SharedGroupRetained)
- node).parents.contains(interior[idx].retained)) {
+ if (((SharedGroupRetained)node).parents.contains(interior[idx].retained)) {
break;
}
}
diff --git a/src/classes/share/javax/media/j3d/SharedGroupRetained.java b/src/classes/share/javax/media/j3d/SharedGroupRetained.java
index 0c1c60b..e22f072 100644
--- a/src/classes/share/javax/media/j3d/SharedGroupRetained.java
+++ b/src/classes/share/javax/media/j3d/SharedGroupRetained.java
@@ -65,10 +65,10 @@ class SharedGroupRetained extends GroupRetained implements TargetsInterface {
// key which identifies a unique path from a locale to this switch link
HashKey switchKey = new HashKey();
- /**
- * The Shared Group Node's parent vector.
- */
- Vector parents = new Vector(1);
+/**
+ * The Shared Group Node's parent vector.
+ */
+Vector<NodeRetained> parents = new Vector<NodeRetained>(1);
// J3d copy.
CachedTargets[] j3dCTs = null;
@@ -637,10 +637,9 @@ class SharedGroupRetained extends GroupRetained implements TargetsInterface {
void traverseSwitchParent() {
int i;
- NodeRetained ln;
for(i=0; i<parents.size(); i++) {
- ln = (NodeRetained) parents.elementAt(i);
+ NodeRetained ln = parents.get(i);
if (ln.parentSwitchLink != null) {
if (parentSwitchLink instanceof SwitchRetained) {
((SwitchRetained)parentSwitchLink).traverseSwitchParent();
diff --git a/src/classes/share/javax/media/j3d/WakeupOnCollisionEntry.java b/src/classes/share/javax/media/j3d/WakeupOnCollisionEntry.java
index bd39186..c3050a6 100644
--- a/src/classes/share/javax/media/j3d/WakeupOnCollisionEntry.java
+++ b/src/classes/share/javax/media/j3d/WakeupOnCollisionEntry.java
@@ -514,8 +514,6 @@ public final class WakeupOnCollisionEntry extends WakeupCriterion {
NodeRetained nodeR = target;
Locale locale = nodeR.locale;
String nodeId;
- Vector parents;
- NodeRetained linkR;
if (nodeR.inSharedGroup) {
// getlastNodeId() will destroy this key
@@ -535,10 +533,10 @@ public final class WakeupOnCollisionEntry extends WakeupCriterion {
// retrieve the last node ID
nodeId = key.getLastNodeId();
- parents = ((SharedGroupRetained) nodeR).parents;
+ Vector<NodeRetained> parents = ((SharedGroupRetained)nodeR).parents;
NodeRetained prevNodeR = nodeR;
for(int i=parents.size()-1; i >=0; i--) {
- linkR = (NodeRetained) parents.elementAt(i);
+ NodeRetained linkR = parents.get(i);
if (linkR.nodeId.equals(nodeId)) {
nodeR = linkR;
break;