aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/share
diff options
context:
space:
mode:
authorHarvey Harrison <[email protected]>2012-05-03 16:42:07 -0700
committerHarvey Harrison <[email protected]>2012-05-03 16:42:07 -0700
commit529c93b2e141890b244ee1b2728aedf22075d6a2 (patch)
tree1e6bc4c2839eb7979efc059e647bde5b66b22d04 /src/classes/share
parent14ba12fa286ebb0354e25aea82f345831efa5c09 (diff)
j3dcore: annotate GeometryRetained userslist
Signed-off-by: Harvey Harrison <[email protected]>
Diffstat (limited to 'src/classes/share')
-rw-r--r--src/classes/share/javax/media/j3d/GeometryArrayRetained.java12
-rw-r--r--src/classes/share/javax/media/j3d/GeometryRetained.java41
-rw-r--r--src/classes/share/javax/media/j3d/Text3DRetained.java15
3 files changed, 28 insertions, 40 deletions
diff --git a/src/classes/share/javax/media/j3d/GeometryArrayRetained.java b/src/classes/share/javax/media/j3d/GeometryArrayRetained.java
index 8b40360..6110d5e 100644
--- a/src/classes/share/javax/media/j3d/GeometryArrayRetained.java
+++ b/src/classes/share/javax/media/j3d/GeometryArrayRetained.java
@@ -3481,8 +3481,6 @@ abstract class GeometryArrayRetained extends GeometryRetained{
void sendDataChangedMessage(boolean coordinatesChanged) {
J3dMessage[] m;
int i, j, k, index, numShapeMessages, numMorphMessages;
- ArrayList shapeList;
- Shape3DRetained s;
ArrayList morphList;
MorphRetained morph;
@@ -3508,9 +3506,9 @@ abstract class GeometryArrayRetained extends GeometryRetained{
for (i = 0; i < numShapeMessages; i++, k++) {
gaList.clear();
- shapeList = (ArrayList)userLists.get(i);
- for (j=0; j<shapeList.size(); j++) {
- s = (Shape3DRetained)shapeList.get(j);
+ ArrayList<Shape3DRetained> shapeList = userLists.get(i);
+ for (j = 0; j < shapeList.size(); j++) {
+ Shape3DRetained s = shapeList.get(j);
LeafRetained src = (LeafRetained)s.sourceNode;
// Should only need to update distinct localBounds.
if (coordinatesChanged && src.boundsAutoCompute) {
@@ -3518,8 +3516,8 @@ abstract class GeometryArrayRetained extends GeometryRetained{
}
}
- for (j=0; j<shapeList.size(); j++) {
- s = (Shape3DRetained)shapeList.get(j);
+ for (j = 0; j < shapeList.size(); j++) {
+ Shape3DRetained s = shapeList.get(j);
LeafRetained src = (LeafRetained)s.sourceNode;
if (src.boundsDirty) {
// update combine bounds of mirrorShape3Ds. So we need to
diff --git a/src/classes/share/javax/media/j3d/GeometryRetained.java b/src/classes/share/javax/media/j3d/GeometryRetained.java
index a1345df..358768e 100644
--- a/src/classes/share/javax/media/j3d/GeometryRetained.java
+++ b/src/classes/share/javax/media/j3d/GeometryRetained.java
@@ -101,7 +101,7 @@ abstract class GeometryRetained extends NodeComponentRetained {
// A list of ArrayLists which contain all the Shape3DRetained objects
// refering to this geometry. Each list corresponds to the universe
// above.
- ArrayList<ArrayList<Shape3DRetained>> userLists = new ArrayList();
+ ArrayList<ArrayList<Shape3DRetained>> userLists = new ArrayList<ArrayList<Shape3DRetained>>();
// true if color not specified with alpha channel
boolean noAlpha = false;
@@ -154,9 +154,6 @@ abstract class GeometryRetained extends NodeComponentRetained {
// This adds a Shape3DRetained to the list of users of this geometry
void addUser(Shape3DRetained s) {
- int index;
- ArrayList shapeList;
-
if (s.sourceNode.boundsAutoCompute) {
incrComputeGeoBounds();
}
@@ -168,25 +165,21 @@ abstract class GeometryRetained extends NodeComponentRetained {
}
}
synchronized (universeList) {
- if (universeList.contains(s.universe)) {
- index = universeList.indexOf(s.universe);
- shapeList = (ArrayList)userLists.get(index);
- shapeList.add(s);
- } else {
- universeList.add(s.universe);
- shapeList = new ArrayList();
- shapeList.add(s);
- userLists.add(shapeList);
- }
+ if (universeList.contains(s.universe)) {
+ int index = universeList.indexOf(s.universe);
+ userLists.get(index).add(s);
+ } else {
+ universeList.add(s.universe);
+ ArrayList<Shape3DRetained> shapeList = new ArrayList<Shape3DRetained>();
+ shapeList.add(s);
+ userLists.add(shapeList);
+ }
}
}
// This adds a Shape3DRetained to the list of users of this geometry
void removeUser(Shape3DRetained s) {
- int index;
- ArrayList shapeList;
-
if (s.sourceNode.boundsAutoCompute) {
decrComputeGeoBounds();
}
@@ -198,13 +191,13 @@ abstract class GeometryRetained extends NodeComponentRetained {
}
synchronized (universeList) {
- index = universeList.indexOf(s.universe);
- shapeList = (ArrayList)userLists.get(index);
- shapeList.remove(shapeList.indexOf(s));
- if (shapeList.size() == 0) {
- userLists.remove(index);
- universeList.remove(index);
- }
+ int index = universeList.indexOf(s.universe);
+ ArrayList<Shape3DRetained> shapeList = userLists.get(index);
+ shapeList.remove(s);
+ if (shapeList.size() == 0) {
+ userLists.remove(index);
+ universeList.remove(index);
+ }
}
}
diff --git a/src/classes/share/javax/media/j3d/Text3DRetained.java b/src/classes/share/javax/media/j3d/Text3DRetained.java
index 3496dce..232f28f 100644
--- a/src/classes/share/javax/media/j3d/Text3DRetained.java
+++ b/src/classes/share/javax/media/j3d/Text3DRetained.java
@@ -467,8 +467,7 @@ class Text3DRetained extends GeometryRetained {
J3dMessage[] m;
int i, j, k, kk, numMessages;
int gSize;
- ArrayList shapeList, gaList;
- Shape3DRetained s;
+ ArrayList gaList;
GeometryAtom[] newGeometryAtoms;
ArrayList tiArrList = new ArrayList();
ArrayList newCtArrArrList = new ArrayList();
@@ -482,12 +481,12 @@ class Text3DRetained extends GeometryRetained {
m[i] = new J3dMessage();
m[i].type = J3dMessage.TEXT3D_DATA_CHANGED;
m[i].threads = targetThreads;
- shapeList = (ArrayList)userLists.get(i);
+ ArrayList<Shape3DRetained> shapeList = userLists.get(i);
newGeometryAtomList.clear();
oldGeometryAtomList.clear();
for (j=0; j<shapeList.size(); j++) {
- s = (Shape3DRetained)shapeList.get(j);
+ Shape3DRetained s = shapeList.get(j);
if (s.boundsAutoCompute) {
// update combine bounds of mirrorShape3Ds. So we need to
// use its bounds and not localBounds.
@@ -648,9 +647,7 @@ class Text3DRetained extends GeometryRetained {
final void sendTransformChangedMessage() {
J3dMessage[] m;
int i, j, numMessages, sCnt;
- ArrayList shapeList;
ArrayList gaList = new ArrayList();
- Shape3DRetained s;
GeometryRetained geomR;
synchronized(liveStateLock) {
if (source.isLive()) {
@@ -661,10 +658,10 @@ class Text3DRetained extends GeometryRetained {
m[i] = new J3dMessage();
m[i].type = J3dMessage.TEXT3D_TRANSFORM_CHANGED;
m[i].threads = targetThreads;
- shapeList = (ArrayList)userLists.get(i);
+ ArrayList<Shape3DRetained> shapeList = userLists.get(i);
// gaList = new GeometryAtom[shapeList.size() * numChars];
- for (j=0; j<shapeList.size(); j++) {
- s = (Shape3DRetained)shapeList.get(j);
+ for (j = 0; j < shapeList.size(); j++) {
+ Shape3DRetained s = shapeList.get(j);
// Find the right geometry.
for(sCnt=0; sCnt<s.geometryList.size(); sCnt++) {