From ad9e0e16f1419bb0323a10bdbbef9fc9215d1157 Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Tue, 8 May 2012 15:43:22 -0700 Subject: j3dcore: annotate the SharedGroupRetained parents member Signed-off-by: Harvey Harrison --- src/classes/share/javax/media/j3d/BHTree.java | 4 ++-- src/classes/share/javax/media/j3d/GroupRetained.java | 9 ++++----- src/classes/share/javax/media/j3d/LinkRetained.java | 8 ++++---- src/classes/share/javax/media/j3d/NodeRetained.java | 20 ++++++++------------ src/classes/share/javax/media/j3d/PickInfo.java | 4 ++-- .../share/javax/media/j3d/SceneGraphPath.java | 3 +-- .../share/javax/media/j3d/SharedGroupRetained.java | 11 +++++------ .../javax/media/j3d/WakeupOnCollisionEntry.java | 6 ++---- 8 files changed, 28 insertions(+), 37 deletions(-) (limited to 'src/classes') 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 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 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 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 branchGroupPaths = new ArrayList branchGroupPaths = new ArrayList 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 branchGroupPaths = new ArrayList 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 branchGroupPaths = new ArrayList 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 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 parents = new Vector(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 = ((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; -- cgit v1.2.3