aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/share
diff options
context:
space:
mode:
authorHarvey Harrison <[email protected]>2013-07-01 07:08:44 -0700
committerHarvey Harrison <[email protected]>2013-07-01 07:09:31 -0700
commitef7606cd9240c296dae1e44f3c9b47eef906b285 (patch)
treec7e9b83be562ca8a4f324f0ee75898a355c56a41 /src/classes/share
parentfbad5f1b7d04c1cf588e67f4fd00c04fe4f37d39 (diff)
j3dcore: annotate lots of lists of Views used by ViewSpecificGroups, and setLiveState
Signed-off-by: Harvey Harrison <[email protected]>
Diffstat (limited to 'src/classes/share')
-rw-r--r--src/classes/share/javax/media/j3d/GroupRetained.java20
-rw-r--r--src/classes/share/javax/media/j3d/MorphRetained.java4
-rw-r--r--src/classes/share/javax/media/j3d/SetLiveState.java22
-rw-r--r--src/classes/share/javax/media/j3d/Shape3DRetained.java4
-rw-r--r--src/classes/share/javax/media/j3d/SharedGroupRetained.java6
-rw-r--r--src/classes/share/javax/media/j3d/ViewSpecificGroupRetained.java45
6 files changed, 48 insertions, 53 deletions
diff --git a/src/classes/share/javax/media/j3d/GroupRetained.java b/src/classes/share/javax/media/j3d/GroupRetained.java
index 1b3b387..5b444c6 100644
--- a/src/classes/share/javax/media/j3d/GroupRetained.java
+++ b/src/classes/share/javax/media/j3d/GroupRetained.java
@@ -137,14 +137,14 @@ ArrayList<NodeRetained> compiledChildrenList = null;
boolean isInClearLive = false;
- // List of viewes scoped to this Group, for all subclasses
- // of group, except ViewSpecificGroup its a pointer to closest
- // ViewSpecificGroup parent
- // viewList for this node, if inSharedGroup is
- // false then only viewList(0) is valid
- // For VSGs, this list is an intersection of
- // higher level VSGs
- ArrayList viewLists = null;
+// List of viewes scoped to this Group, for all subclasses
+// of group, except ViewSpecificGroup its a pointer to closest
+// ViewSpecificGroup parent
+// viewList for this node, if inSharedGroup is
+// false then only viewList(0) is valid
+// For VSGs, this list is an intersection of
+// higher level VSGs
+ArrayList<ArrayList<View>> viewLists = null;
// True if this Node is descendent of ViewSpecificGroup;
boolean inViewSpecificGroup = false;
@@ -1556,7 +1556,7 @@ synchronized void setAltAppScope() {
s.changedViewList = new ArrayList();
s.keyList = new int[10];
s.viewScopedNodeList = new ArrayList();
- s.scopedNodesViewList = new ArrayList();
+ s.scopedNodesViewList = new ArrayList<ArrayList<View>>();
}
childCheckSetLive(child, childIndex, s, linkNode);
@@ -1718,7 +1718,7 @@ synchronized void setAltAppScope() {
s.changedViewList = new ArrayList();
s.keyList = new int[10];
s.viewScopedNodeList = new ArrayList();
- s.scopedNodesViewList = new ArrayList();
+ s.scopedNodesViewList = new ArrayList<ArrayList<View>>();
}
if (this instanceof OrderedGroupRetained && linkNode == null) {
diff --git a/src/classes/share/javax/media/j3d/MorphRetained.java b/src/classes/share/javax/media/j3d/MorphRetained.java
index 3abdc89..329cc62 100644
--- a/src/classes/share/javax/media/j3d/MorphRetained.java
+++ b/src/classes/share/javax/media/j3d/MorphRetained.java
@@ -1337,7 +1337,7 @@ class MorphRetained extends LeafRetained implements GeometryUpdater {
}
if (s.viewLists != null)
- shape.viewList = (ArrayList)s.viewLists.get(i);
+ shape.viewList = s.viewLists.get(i);
else
shape.viewList = null;
@@ -1416,7 +1416,7 @@ class MorphRetained extends LeafRetained implements GeometryUpdater {
}
if (s.viewLists != null)
- shape.viewList = (ArrayList)s.viewLists.get(0);
+ shape.viewList = s.viewLists.get(0);
else
shape.viewList = null;
diff --git a/src/classes/share/javax/media/j3d/SetLiveState.java b/src/classes/share/javax/media/j3d/SetLiveState.java
index 24ee2af..ab78cf9 100644
--- a/src/classes/share/javax/media/j3d/SetLiveState.java
+++ b/src/classes/share/javax/media/j3d/SetLiveState.java
@@ -66,11 +66,11 @@ class SetLiveState extends Object {
*/
ArrayList viewScopedNodeList = null;
- /**
- * Parallel list to viewScopedNodeList containing a list of views
- * that the viewScopedNode is scoped to
- */
- ArrayList scopedNodesViewList = null;
+/**
+ * Parallel list to viewScopedNodeList containing a list of views
+ * that the viewScopedNode is scoped to
+ */
+ArrayList<ArrayList<View>> scopedNodesViewList = null;
// Threads to notify after setLive/clearLive
int notifyThreads = 0;
@@ -93,12 +93,12 @@ ArrayList<ArrayList<ModelClipRetained>> modelClips = null;
// List of scoped alt app
ArrayList<ArrayList<AlternateAppearanceRetained>> altAppearances = null;
- // List of viewes scoped to this Group, for all subclasses
- // of group, except ViewSpecificGroup its a pointer to closest
- // ViewSpecificGroup parent
- // viewList for this node, if inSharedGroup is
- // false then only viewList(0) is valid
- ArrayList viewLists = null;
+// List of viewes scoped to this Group, for all subclasses
+// of group, except ViewSpecificGroup its a pointer to closest
+// ViewSpecificGroup parent
+// viewList for this node, if inSharedGroup is
+// false then only viewList(0) is valid
+ArrayList<ArrayList<View>> viewLists = null;
ArrayList changedViewGroup = null;
ArrayList changedViewList = null;
int[] keyList = null;
diff --git a/src/classes/share/javax/media/j3d/Shape3DRetained.java b/src/classes/share/javax/media/j3d/Shape3DRetained.java
index 9f7df98..6238911 100644
--- a/src/classes/share/javax/media/j3d/Shape3DRetained.java
+++ b/src/classes/share/javax/media/j3d/Shape3DRetained.java
@@ -1058,7 +1058,7 @@ Enumeration getAllGeometries(int id) {
msList.add(shape);
if (s.viewLists != null) {
- shape.viewList = (ArrayList)s.viewLists.get(j);
+ shape.viewList = s.viewLists.get(j);
} else {
shape.viewList = null;
}
@@ -1117,7 +1117,7 @@ Enumeration getAllGeometries(int id) {
msList.add(shape);
if (s.viewLists != null)
- shape.viewList = (ArrayList)s.viewLists.get(0);
+ shape.viewList = s.viewLists.get(0);
else
shape.viewList = null;
diff --git a/src/classes/share/javax/media/j3d/SharedGroupRetained.java b/src/classes/share/javax/media/j3d/SharedGroupRetained.java
index ab77e11..20f6925 100644
--- a/src/classes/share/javax/media/j3d/SharedGroupRetained.java
+++ b/src/classes/share/javax/media/j3d/SharedGroupRetained.java
@@ -102,7 +102,7 @@ Vector<NodeRetained> parents = new Vector<NodeRetained>(1);
switchStates.add(hkIndex, s.switchStates.get(index));
if (viewLists == null) {
- viewLists = new ArrayList(1);
+ viewLists = new ArrayList<ArrayList<View>>(1);
}
// If there are some ViewSpecificGroups in the path above this SharedGroup
// System.err.println("====> hkIndex = "+hkIndex+" s.viewLists = "+s.viewLists);
@@ -272,7 +272,7 @@ Vector<NodeRetained> parents = new Vector<NodeRetained>(1);
int savedLocalToVworldIndex[][] = s.localToVworldIndex;
HashKey savedLocalToVworldKeys[] = s.localToVworldKeys;
ArrayList<OrderedPath> savedOrderedPaths = s.orderedPaths;
- ArrayList savedViewList = s.viewLists;
+ ArrayList<ArrayList<View>> savedViewList = s.viewLists;
ArrayList<ArrayList<LightRetained>> savedLights = s.lights;
ArrayList<ArrayList<FogRetained>> savedFogs = s.fogs;
ArrayList<ArrayList<ModelClipRetained>> savedMclips = s.modelClips;
@@ -471,7 +471,7 @@ Vector<NodeRetained> parents = new Vector<NodeRetained>(1);
int savedLocalToVworldIndex[][] = s.localToVworldIndex;
HashKey savedLocalToVworldKeys[] = s.localToVworldKeys;
ArrayList<OrderedPath> savedOrderedPaths = s.orderedPaths;
- ArrayList savedViewLists = s.viewLists;
+ ArrayList<ArrayList<View>> savedViewLists = s.viewLists;
ArrayList<ArrayList<LightRetained>> savedLights = s.lights;
ArrayList<ArrayList<FogRetained>> savedFogs = s.fogs;
diff --git a/src/classes/share/javax/media/j3d/ViewSpecificGroupRetained.java b/src/classes/share/javax/media/j3d/ViewSpecificGroupRetained.java
index 377da5b..515dee1 100644
--- a/src/classes/share/javax/media/j3d/ViewSpecificGroupRetained.java
+++ b/src/classes/share/javax/media/j3d/ViewSpecificGroupRetained.java
@@ -46,9 +46,8 @@ ArrayList<View> apiViewList = new ArrayList<View>();
// Used in scoping
HashKey tempKey = new HashKey(250);
- // ArrayList of Integer indices
- ArrayList parentLists = new ArrayList();
-
+// ArrayList of Integer indices
+ArrayList<ArrayList<View>> parentLists = new ArrayList<ArrayList<View>>();
static final int SET_VIEW = 0x1;
static final int ADD_VIEW = 0x2;
@@ -57,7 +56,7 @@ ArrayList<View> apiViewList = new ArrayList<View>();
// Construct retained object
ViewSpecificGroupRetained() {
this.nodeType = NodeRetained.VIEWSPECIFICGROUP;
- viewLists = new ArrayList();
+ viewLists = new ArrayList<ArrayList<View>>();
}
void addView(View view) {
@@ -69,9 +68,8 @@ ArrayList<View> apiViewList = new ArrayList<View>();
// Gather all affected leaf nodes and send a message to
// RenderingEnv and RenderBin
if (inSharedGroup) {
- ArrayList parentList;
for (int k = 0; k < localToVworldKeys.length; k++) {
- parentList = (ArrayList)parentLists.get(k);
+ ArrayList<View> parentList = parentLists.get(k);
// If the parentList contains this view or if this is the
// first VSG then ..
if (parentList == null || parentList.contains(view)) {
@@ -109,7 +107,7 @@ ArrayList<View> apiViewList = new ArrayList<View>();
}
else {
- ArrayList parentList = (ArrayList)parentLists.get(0);
+ ArrayList<View> parentList = parentLists.get(0);
// If the parentList contains this view or if this is the
// first VSG then ..
@@ -166,9 +164,8 @@ void setView(View view, int index) {
// Gather all affected leaf nodes and send a message to
// RenderingEnv and RenderBin
if (inSharedGroup) {
- ArrayList parentList;
for (int k = 0; k < localToVworldKeys.length; k++) {
- parentList = (ArrayList)parentLists.get(k);
+ ArrayList<View> parentList = parentLists.get(k);
Object[] objAry = new Object[8];
ArrayList addVsgList = new ArrayList();
ArrayList removeVsgList = new ArrayList();
@@ -212,7 +209,7 @@ void setView(View view, int index) {
}
else {
- ArrayList parentList = (ArrayList)parentLists.get(0);
+ ArrayList<View> parentList = parentLists.get(0);
Object[] objAry = new Object[8];
ArrayList addVsgList = new ArrayList();
ArrayList removeVsgList = new ArrayList();
@@ -274,11 +271,11 @@ void setView(View view, int index) {
}
if (mode == ADD_VIEW) {
- ArrayList parentList = (ArrayList)parentLists.get(hkIndex);
+ ArrayList<View> parentList = parentLists.get(hkIndex);
parentList.add(v);
}
else if (mode == REMOVE_VIEW) {
- ArrayList parentList = (ArrayList)parentLists.get(hkIndex);
+ ArrayList<View> parentList = parentLists.get(hkIndex);
parentList.remove(v);
}
if(apiViewList.contains(v)) {
@@ -326,9 +323,8 @@ View getView(int index) {
// Gather all affected leaf nodes and send a message to
// RenderingEnv and RenderBin
if (inSharedGroup) {
- ArrayList parentList;
for (int k = 0; k < localToVworldKeys.length; k++) {
- parentList = (ArrayList)parentLists.get(k);
+ ArrayList<View> parentList = parentLists.get(k);
// If the parentList contains this view or if this is the
// first VSG then ..
if (parentList == null || parentList.contains(view)) {
@@ -366,7 +362,7 @@ View getView(int index) {
}
else {
- ArrayList parentList = (ArrayList)parentLists.get(0);
+ ArrayList<View> parentList = parentLists.get(0);
// If the parentList contains this view or if this is the
// first VSG then ..
@@ -417,9 +413,8 @@ View getView(int index) {
// Gather all affected leaf nodes and send a message to
// RenderingEnv and RenderBin
if (inSharedGroup) {
- ArrayList parentList;
for (int k = 0; k < localToVworldKeys.length; k++) {
- parentList = (ArrayList)parentLists.get(k);
+ ArrayList<View> parentList = parentLists.get(k);
// If the parentList contains this view or if this is the
// first VSG then ..
if (parentList == null || parentList.contains(v)) {
@@ -456,7 +451,7 @@ View getView(int index) {
}
else {
- ArrayList parentList = (ArrayList)parentLists.get(0);
+ ArrayList<View> parentList = parentLists.get(0);
// If the parentList contains this view or if this is the
// first VSG then ..
@@ -541,13 +536,13 @@ Enumeration<View> getAllViews() {
}
s.inViewSpecificGroup = true;
- ArrayList savedViewList = s.viewLists;
+ ArrayList<ArrayList<View>> savedViewList = s.viewLists;
if (s.changedViewGroup == null) {
s.changedViewGroup = new ArrayList();
s.changedViewList = new ArrayList();
s.keyList = new int[10];
s.viewScopedNodeList = new ArrayList();
- s.scopedNodesViewList = new ArrayList();
+ s.scopedNodesViewList = new ArrayList<ArrayList<View>>();
}
super.setLive(s);
s.viewLists = savedViewList;
@@ -555,13 +550,13 @@ Enumeration<View> getAllViews() {
}
void clearLive(SetLiveState s) {
- ArrayList savedViewList = s.viewLists;
+ ArrayList<ArrayList<View>> savedViewList = s.viewLists;
if (s.changedViewGroup == null) {
s.changedViewGroup = new ArrayList();
s.changedViewList = new ArrayList();
s.keyList = new int[10];
s.viewScopedNodeList = new ArrayList();
- s.scopedNodesViewList = new ArrayList();
+ s.scopedNodesViewList = new ArrayList<ArrayList<View>>();
}
// XXXX: This is a hack since removeNodeData is called before
// children are clearLives
@@ -697,11 +692,11 @@ void updateCachedInformation(int component, View view, int index) {
void setAuxData(SetLiveState s, int index, int hkIndex) {
ArrayList<View> vl = new ArrayList<View>();
- ArrayList parentList = null;
+ ArrayList<View> parentList = null;
int size = apiViewList.size();
if (s.viewLists != null) {
// System.err.println("=====> VSG: = "+this+" hkIndex = "+hkIndex+" s.viewLists = "+s.viewLists);
- parentList = (ArrayList) s.viewLists.get(hkIndex);
+ parentList = s.viewLists.get(hkIndex);
if (parentList != null) {
for (int i = 0; i < size; i++) {
View v = apiViewList.get(i);
@@ -734,7 +729,7 @@ void updateCachedInformation(int component, View view, int index) {
}
}
if (parentList != null) {
- parentLists.add(hkIndex, parentList.clone());
+ parentLists.add(hkIndex, new ArrayList<View>(parentList));
}
else {
parentLists.add(hkIndex, null);