From ef7606cd9240c296dae1e44f3c9b47eef906b285 Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Mon, 1 Jul 2013 07:08:44 -0700 Subject: j3dcore: annotate lots of lists of Views used by ViewSpecificGroups, and setLiveState Signed-off-by: Harvey Harrison --- .../share/javax/media/j3d/GroupRetained.java | 20 +++++----- .../share/javax/media/j3d/MorphRetained.java | 4 +- .../share/javax/media/j3d/SetLiveState.java | 22 +++++------ .../share/javax/media/j3d/Shape3DRetained.java | 4 +- .../share/javax/media/j3d/SharedGroupRetained.java | 6 +-- .../javax/media/j3d/ViewSpecificGroupRetained.java | 45 ++++++++++------------ 6 files changed, 48 insertions(+), 53 deletions(-) (limited to 'src/classes/share') 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 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> 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>(); } 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>(); } 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> scopedNodesViewList = null; // Threads to notify after setLive/clearLive int notifyThreads = 0; @@ -93,12 +93,12 @@ ArrayList> modelClips = null; // List of scoped alt app ArrayList> 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> 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 parents = new Vector(1); switchStates.add(hkIndex, s.switchStates.get(index)); if (viewLists == null) { - viewLists = new ArrayList(1); + viewLists = new ArrayList>(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 parents = new Vector(1); int savedLocalToVworldIndex[][] = s.localToVworldIndex; HashKey savedLocalToVworldKeys[] = s.localToVworldKeys; ArrayList savedOrderedPaths = s.orderedPaths; - ArrayList savedViewList = s.viewLists; + ArrayList> savedViewList = s.viewLists; ArrayList> savedLights = s.lights; ArrayList> savedFogs = s.fogs; ArrayList> savedMclips = s.modelClips; @@ -471,7 +471,7 @@ Vector parents = new Vector(1); int savedLocalToVworldIndex[][] = s.localToVworldIndex; HashKey savedLocalToVworldKeys[] = s.localToVworldKeys; ArrayList savedOrderedPaths = s.orderedPaths; - ArrayList savedViewLists = s.viewLists; + ArrayList> savedViewLists = s.viewLists; ArrayList> savedLights = s.lights; ArrayList> 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 apiViewList = new ArrayList(); // Used in scoping HashKey tempKey = new HashKey(250); - // ArrayList of Integer indices - ArrayList parentLists = new ArrayList(); - +// ArrayList of Integer indices +ArrayList> parentLists = new ArrayList>(); static final int SET_VIEW = 0x1; static final int ADD_VIEW = 0x2; @@ -57,7 +56,7 @@ ArrayList apiViewList = new ArrayList(); // Construct retained object ViewSpecificGroupRetained() { this.nodeType = NodeRetained.VIEWSPECIFICGROUP; - viewLists = new ArrayList(); + viewLists = new ArrayList>(); } void addView(View view) { @@ -69,9 +68,8 @@ ArrayList apiViewList = new ArrayList(); // 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 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 apiViewList = new ArrayList(); } else { - ArrayList parentList = (ArrayList)parentLists.get(0); + ArrayList 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 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 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 parentList = parentLists.get(hkIndex); parentList.add(v); } else if (mode == REMOVE_VIEW) { - ArrayList parentList = (ArrayList)parentLists.get(hkIndex); + ArrayList 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 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 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 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 parentList = parentLists.get(0); // If the parentList contains this view or if this is the // first VSG then .. @@ -541,13 +536,13 @@ Enumeration getAllViews() { } s.inViewSpecificGroup = true; - ArrayList savedViewList = s.viewLists; + ArrayList> 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>(); } super.setLive(s); s.viewLists = savedViewList; @@ -555,13 +550,13 @@ Enumeration getAllViews() { } void clearLive(SetLiveState s) { - ArrayList savedViewList = s.viewLists; + ArrayList> 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>(); } // 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 vl = new ArrayList(); - ArrayList parentList = null; + ArrayList 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(parentList)); } else { parentLists.add(hkIndex, null); -- cgit v1.2.3