From 8237ea93f5fc1f4ef6ecc32c0941db0f150ab6bb Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Sun, 24 Jun 2012 01:14:44 -0700 Subject: j3dcore: annotate some lists in GeometryArrayRetained Signed-off-by: Harvey Harrison --- .../javax/media/j3d/GeometryArrayRetained.java | 36 +++++++++------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/src/classes/share/javax/media/j3d/GeometryArrayRetained.java b/src/classes/share/javax/media/j3d/GeometryArrayRetained.java index b8712c0..68bd9a6 100644 --- a/src/classes/share/javax/media/j3d/GeometryArrayRetained.java +++ b/src/classes/share/javax/media/j3d/GeometryArrayRetained.java @@ -340,13 +340,13 @@ abstract class GeometryArrayRetained extends GeometryRetained{ static final int INIT_MIRROR_GEOMETRY = 0x02; - // A list of Universes that this Geometry is referenced in Morph from - ArrayList morphUniverseList = null; +// A list of Universes that this Geometry is referenced in Morph from +ArrayList morphUniverseList = null; - // A list of ArrayLists which contain all the MorphRetained objects - // refering to this geometry. Each list corresponds to the universe - // above. - ArrayList morphUserLists = null; +// A list of ArrayLists which contain all the MorphRetained objects +// refering to this geometry. Each list corresponds to the universe +// above. +ArrayList> morphUserLists = null; // The following variables are only used in compile mode @@ -3476,8 +3476,6 @@ abstract class GeometryArrayRetained extends GeometryRetained{ void sendDataChangedMessage(boolean coordinatesChanged) { J3dMessage[] m; int i, j, k, index, numShapeMessages, numMorphMessages; - ArrayList morphList; - MorphRetained morph; synchronized(liveStateLock) { if (source != null && source.isLive()) { @@ -3547,11 +3545,10 @@ abstract class GeometryArrayRetained extends GeometryRetained{ if (numMorphMessages > 0) { synchronized (morphUniverseList) { for (i = 0; i < numMorphMessages; i++, k++) { - morphList = (ArrayList)morphUserLists.get(i); - for (j=0; j morphList = morphUserLists.get(i); + for (j = 0; j < morphList.size(); j++) { + morphList.get(j).updateMorphedGeometryArray(this, coordinatesChanged); + } } } } @@ -10684,20 +10681,18 @@ abstract class GeometryArrayRetained extends GeometryRetained{ // This adds a MorphRetained to the list of users of this geometry void addMorphUser(MorphRetained m) { int index; - ArrayList morphList; if(morphUniverseList == null) { - morphUniverseList = new ArrayList(1); - morphUserLists = new ArrayList(1); + morphUniverseList = new ArrayList(1); + morphUserLists = new ArrayList>(1); } synchronized (morphUniverseList) { if (morphUniverseList.contains(m.universe)) { index = morphUniverseList.indexOf(m.universe); - morphList = (ArrayList)morphUserLists.get(index); - morphList.add(m); + morphUserLists.get(index).add(m); } else { morphUniverseList.add(m.universe); - morphList = new ArrayList(5); + ArrayList morphList = new ArrayList(5); morphList.add(m); morphUserLists.add(morphList); } @@ -10707,14 +10702,13 @@ abstract class GeometryArrayRetained extends GeometryRetained{ // This adds a MorphRetained to the list of users of this geometry void removeMorphUser(MorphRetained m) { int index; - ArrayList morphList; if(morphUniverseList == null) return; synchronized (morphUniverseList) { index = morphUniverseList.indexOf(m.universe); - morphList = (ArrayList)morphUserLists.get(index); + ArrayList morphList = morphUserLists.get(index); morphList.remove(morphList.indexOf(m)); if (morphList.size() == 0) { morphUserLists.remove(index); -- cgit v1.2.3