aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarvey Harrison <[email protected]>2012-06-27 00:26:24 -0700
committerHarvey Harrison <[email protected]>2012-06-27 00:26:24 -0700
commit43930a1a60e4efbea6f44ea6b3b3871512972271 (patch)
treeab9ad092d7c7805a060e970b7684f69fce3313c8 /src
parent1ae355b8e4ec376fe398cd24a9ca14431160276c (diff)
j3dcore: annotate SetLiveState orderPaths and switchStates lists
Signed-off-by: Harvey Harrison <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/classes/share/javax/media/j3d/BackgroundRetained.java9
-rw-r--r--src/classes/share/javax/media/j3d/GroupRetained.java8
-rw-r--r--src/classes/share/javax/media/j3d/Locale.java16
-rw-r--r--src/classes/share/javax/media/j3d/OrderedGroupRetained.java35
-rw-r--r--src/classes/share/javax/media/j3d/SetLiveState.java4
-rw-r--r--src/classes/share/javax/media/j3d/Shape3DRetained.java4
-rw-r--r--src/classes/share/javax/media/j3d/SharedGroupRetained.java16
7 files changed, 42 insertions, 50 deletions
diff --git a/src/classes/share/javax/media/j3d/BackgroundRetained.java b/src/classes/share/javax/media/j3d/BackgroundRetained.java
index adc471f..947f63a 100644
--- a/src/classes/share/javax/media/j3d/BackgroundRetained.java
+++ b/src/classes/share/javax/media/j3d/BackgroundRetained.java
@@ -490,12 +490,11 @@ GeometryAtom[] bgGeometryAtoms = null;
setLiveState.branchGroupPaths = new ArrayList<BranchGroupRetained[]>();
setLiveState.branchGroupPaths.add(new BranchGroupRetained[0]);
- setLiveState.orderedPaths = new ArrayList(1);
- setLiveState.orderedPaths.add(new OrderedPath());
-
- setLiveState.switchStates = new ArrayList(1);
- setLiveState.switchStates.add(new SwitchState(false));
+ setLiveState.orderedPaths = new ArrayList<OrderedPath>(1);
+ setLiveState.orderedPaths.add(new OrderedPath());
+ setLiveState.switchStates = new ArrayList<SwitchState>(1);
+ setLiveState.switchStates.add(new SwitchState(false));
branch.setLive(setLiveState);
diff --git a/src/classes/share/javax/media/j3d/GroupRetained.java b/src/classes/share/javax/media/j3d/GroupRetained.java
index b9d1a13..73ef7c4 100644
--- a/src/classes/share/javax/media/j3d/GroupRetained.java
+++ b/src/classes/share/javax/media/j3d/GroupRetained.java
@@ -78,8 +78,8 @@ ArrayList<ArrayList<AlternateAppearanceRetained>> altAppearances = null;
// the immediate childIndex of a parentSwitchLink
int parentSwitchLinkChildIndex = -1;
- // per shared path ordered path data
- ArrayList orderedPaths = null;
+// per shared path ordered path data
+ArrayList<OrderedPath> orderedPaths = null;
/**
* If collisionBound is set, this is equal to the
@@ -1518,7 +1518,7 @@ synchronized void setAltAppScope() {
// branchGroupArray since they will get replace (not append)
// by creating a new reference in child's group.
s.branchGroupPaths = new ArrayList<BranchGroupRetained[]>(branchGroupPaths);
- s.orderedPaths = orderedPaths;
+ s.orderedPaths = orderedPaths;
// Make the scoped fogs and lights of the child to include, the
// the scoped fog of this group
@@ -2713,7 +2713,7 @@ synchronized void setAltAppScope() {
s.ogList.add(this);
s.ogChildIdList.add(new Integer(i));
}
- s.orderedPaths = (ArrayList)og.childrenOrderedPaths.get(i);
+ s.orderedPaths = og.childrenOrderedPaths.get(i);
}
if (child != null) {
diff --git a/src/classes/share/javax/media/j3d/Locale.java b/src/classes/share/javax/media/j3d/Locale.java
index 0b6f4d7..9bae012 100644
--- a/src/classes/share/javax/media/j3d/Locale.java
+++ b/src/classes/share/javax/media/j3d/Locale.java
@@ -215,11 +215,11 @@ public class Locale extends Object {
s.branchGroupPaths = new ArrayList<BranchGroupRetained[]>();
s.branchGroupPaths.add(new BranchGroupRetained[0]);
- s.orderedPaths = new ArrayList(1);
- s.orderedPaths.add(new OrderedPath());
+ s.orderedPaths = new ArrayList<OrderedPath>(1);
+ s.orderedPaths.add(new OrderedPath());
- s.switchStates = new ArrayList(1);
- s.switchStates.add(new SwitchState(false));
+ s.switchStates = new ArrayList<SwitchState>(1);
+ s.switchStates.add(new SwitchState(false));
bgr.setLive(s);
@@ -501,11 +501,11 @@ public class Locale extends Object {
universe.setLiveState.branchGroupPaths = new ArrayList<BranchGroupRetained[]>();
universe.setLiveState.branchGroupPaths.add(new BranchGroupRetained[0]);
- universe.setLiveState.orderedPaths = new ArrayList(1);
- universe.setLiveState.orderedPaths.add(new OrderedPath());
+ universe.setLiveState.orderedPaths = new ArrayList<OrderedPath>(1);
+ universe.setLiveState.orderedPaths.add(new OrderedPath());
- universe.setLiveState.switchStates = new ArrayList(1);
- universe.setLiveState.switchStates.add(new SwitchState(false));
+ universe.setLiveState.switchStates = new ArrayList<SwitchState>(1);
+ universe.setLiveState.switchStates.add(new SwitchState(false));
nbgr.setLive(universe.setLiveState);
diff --git a/src/classes/share/javax/media/j3d/OrderedGroupRetained.java b/src/classes/share/javax/media/j3d/OrderedGroupRetained.java
index 6ad32a4..2b2535d 100644
--- a/src/classes/share/javax/media/j3d/OrderedGroupRetained.java
+++ b/src/classes/share/javax/media/j3d/OrderedGroupRetained.java
@@ -52,9 +52,8 @@ private OrderedBin[] orderedBin = new OrderedBin[0];
// orderedCollection in each orderedBin (per view)
int childCount = 0;
- // per children ordered path data
- ArrayList childrenOrderedPaths = new ArrayList(1);
-
+// per children ordered path data
+ArrayList<ArrayList<OrderedPath>> childrenOrderedPaths = new ArrayList<ArrayList<OrderedPath>>(1);
// child index order - set by the user.
int[] userChildIndexOrder = null;
@@ -309,10 +308,7 @@ OrderedBin getOrderedBin(int index) {
}
void setAuxData(SetLiveState s, int index, int hkIndex) {
- OrderedPath setLiveStateOrderedPath, newOrderedPath;
- ArrayList childOrderedPaths;
-
- setLiveStateOrderedPath = (OrderedPath) s.orderedPaths.get(hkIndex);
+ OrderedPath setLiveStateOrderedPath = s.orderedPaths.get(hkIndex);
for (int i=0; i<children.size(); i++) {
NodeRetained child = children.get(i);
if (refCount == s.refCount) {
@@ -321,10 +317,9 @@ OrderedBin getOrderedBin(int index) {
child.orderedId = getOrderedChildId();
}
- newOrderedPath = setLiveStateOrderedPath.clonePath();
+ OrderedPath newOrderedPath = setLiveStateOrderedPath.clonePath();
newOrderedPath.addElementToPath(this, child.orderedId);
- childOrderedPaths = (ArrayList)childrenOrderedPaths.get(i);
- childOrderedPaths.add(hkIndex, newOrderedPath);
+ childrenOrderedPaths.get(i).add(hkIndex, newOrderedPath);
}
}
@@ -386,7 +381,7 @@ OrderedBin getOrderedBin(int index) {
if((inSharedGroup) && (s.keys.length != localToVworld.length)) {
int i, index;
- ArrayList childOrderedPaths;
+ ArrayList<OrderedPath> childOrderedPaths;
// Must be in reverse, to preserve right indexing.
for (i = s.keys.length-1; i >= 0; i--) {
@@ -394,7 +389,7 @@ OrderedBin getOrderedBin(int index) {
localToVworldKeys.length);
if(index >= 0) {
for (int j=0; j<children.size(); j++) {
- childOrderedPaths = (ArrayList)childrenOrderedPaths.get(j);
+ childOrderedPaths = childrenOrderedPaths.get(j);
childOrderedPaths.remove(index);
}
}
@@ -449,11 +444,11 @@ OrderedBin getOrderedBin(int index) {
}
void insertChildrenData(int index) {
- childrenOrderedPaths.add(index, new ArrayList(1));
+ childrenOrderedPaths.add(index, new ArrayList<OrderedPath>(1));
}
void appendChildrenData() {
- childrenOrderedPaths.add(new ArrayList(1));
+ childrenOrderedPaths.add(new ArrayList<OrderedPath>(1));
}
void doRemoveChild(int index, J3dMessage messages[], int messageIndex) {
@@ -476,19 +471,18 @@ OrderedBin getOrderedBin(int index) {
s.ogChildIdList.add(new Integer(childIndex));
s.ogOrderedIdList.add(child.orderedId);
}
- s.orderedPaths = (ArrayList)childrenOrderedPaths.get(childIndex);
+ s.orderedPaths = childrenOrderedPaths.get(childIndex);
if(child!=null)
child.setLive(s);
}
void childCheckSetLive(NodeRetained child, int childIndex,
SetLiveState s, NodeRetained linkNode) {
- OrderedPath childOrderedPath;
- ArrayList childOrderedPaths;
+ ArrayList<OrderedPath> childOrderedPaths;
if (linkNode != null) {
int ci = children.indexOf(linkNode);
- childOrderedPaths = (ArrayList)childrenOrderedPaths.get(ci);
+ childOrderedPaths = childrenOrderedPaths.get(ci);
} else {
child.orderedId = getOrderedChildId();
// set this regardless of refCount
@@ -505,11 +499,10 @@ OrderedBin getOrderedBin(int index) {
s.ogCIOTableList.add(newArr);
}
- childOrderedPaths = (ArrayList)childrenOrderedPaths.get(childIndex);
+ childOrderedPaths = childrenOrderedPaths.get(childIndex);
for(int i=0; i< orderedPaths.size();i++){
- childOrderedPath =
- ((OrderedPath)orderedPaths.get(i)).clonePath();
+ OrderedPath childOrderedPath = orderedPaths.get(i).clonePath();
childOrderedPath.addElementToPath(this, child.orderedId);
childOrderedPaths.add(childOrderedPath);
}
diff --git a/src/classes/share/javax/media/j3d/SetLiveState.java b/src/classes/share/javax/media/j3d/SetLiveState.java
index b61dacc..398105f 100644
--- a/src/classes/share/javax/media/j3d/SetLiveState.java
+++ b/src/classes/share/javax/media/j3d/SetLiveState.java
@@ -107,7 +107,7 @@ ArrayList<ArrayList<AlternateAppearanceRetained>> altAppearances = null;
// The current bitmask of types in transformTragets
//int transformTargetThreads = 0;
- ArrayList orderedPaths = null;
+ArrayList<OrderedPath> orderedPaths = null;
ArrayList ogList = new ArrayList(5);
ArrayList ogChildIdList = new ArrayList(5);
@@ -190,7 +190,7 @@ ArrayList<BranchGroupRetained[]> parentBranchGroupPaths = null;
// currently used by Switch, can be extended for other node types
int[] hashkeyIndex = null;
- ArrayList switchStates = null;
+ArrayList<SwitchState> switchStates = null;
SetLiveState(VirtualUniverse u) {
universe = u;
diff --git a/src/classes/share/javax/media/j3d/Shape3DRetained.java b/src/classes/share/javax/media/j3d/Shape3DRetained.java
index d4facf8..5c06447 100644
--- a/src/classes/share/javax/media/j3d/Shape3DRetained.java
+++ b/src/classes/share/javax/media/j3d/Shape3DRetained.java
@@ -787,7 +787,7 @@ class Shape3DRetained extends LeafRetained {
ms.localBounds = localBounds;
// End new 1.3.2
- OrderedPath op = (OrderedPath)s.orderedPaths.get(index);
+ OrderedPath op = s.orderedPaths.get(index);
if (op.pathElements.size() == 0) {
ms.orderedPath = null;
} else {
@@ -2175,7 +2175,7 @@ class Shape3DRetained extends LeafRetained {
parent = morph.parent;
locale = morph.locale;
- OrderedPath op = (OrderedPath)s.orderedPaths.get(index);
+ OrderedPath op = s.orderedPaths.get(index);
if (op.pathElements.size() == 0) {
orderedPath = null;
} else {
diff --git a/src/classes/share/javax/media/j3d/SharedGroupRetained.java b/src/classes/share/javax/media/j3d/SharedGroupRetained.java
index 2e8aacf..0c42918 100644
--- a/src/classes/share/javax/media/j3d/SharedGroupRetained.java
+++ b/src/classes/share/javax/media/j3d/SharedGroupRetained.java
@@ -76,7 +76,7 @@ Vector<NodeRetained> parents = new Vector<NodeRetained>(1);
// combined localTargetThreads and decendants' localTargetThreads
int targetThreads = 0;
- ArrayList switchStates = null;
+ ArrayList<SwitchState> switchStates = null;
SharedGroupRetained() {
this.nodeType = NodeRetained.SHAREDGROUP;
@@ -92,13 +92,13 @@ Vector<NodeRetained> parents = new Vector<NodeRetained>(1);
branchGroupPaths.add(hkIndex, s.branchGroupPaths.get(index));
if (orderedPaths == null) {
- orderedPaths = new ArrayList(1);
+ orderedPaths = new ArrayList<OrderedPath>(1);
}
orderedPaths.add(hkIndex, s.orderedPaths.get(index));
- if (switchStates == null) {
- switchStates = new ArrayList(1);
- }
+ if (switchStates == null) {
+ switchStates = new ArrayList<SwitchState>(1);
+ }
switchStates.add(hkIndex, s.switchStates.get(index));
if (viewLists == null) {
@@ -470,7 +470,7 @@ Vector<NodeRetained> parents = new Vector<NodeRetained>(1);
Transform3D savedLocalToVworld[][] = s.localToVworld;
int savedLocalToVworldIndex[][] = s.localToVworldIndex;
HashKey savedLocalToVworldKeys[] = s.localToVworldKeys;
- ArrayList savedOrderedPaths = s.orderedPaths;
+ ArrayList<OrderedPath> savedOrderedPaths = s.orderedPaths;
ArrayList savedViewLists = s.viewLists;
ArrayList<ArrayList<LightRetained>> savedLights = s.lights;
@@ -829,7 +829,7 @@ Vector<NodeRetained> parents = new Vector<NodeRetained>(1);
if (type == TargetsInterface.SWITCH_TARGETS) {
// child info is not used, SG does not have per child states
if (index < switchStates.size()) {
- SwitchState switchState = (SwitchState)switchStates.get(index);
+ SwitchState switchState = switchStates.get(index);
return switchState.cachedTargets;
} else {
return null;
@@ -851,7 +851,7 @@ Vector<NodeRetained> parents = new Vector<NodeRetained>(1);
System.err.println(" resetCachedTargets: " + this);
}
for (int i=0; i<newCtArr.length; i++) {
- switchState = (SwitchState)switchStates.get(i);
+ switchState = switchStates.get(i);
switchState.cachedTargets = newCtArr[i];
}