From 0e5947e0d9e6d2b8f2b0c88095f3c610a447c129 Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Sun, 27 Jan 2013 23:55:44 -0800 Subject: j3dcore: annotate Renderbin map, format the management functions Signed-off-by: Harvey Harrison --- .../javax/media/j3d/GeometryArrayRetained.java | 76 ++++++++++------------ 1 file changed, 35 insertions(+), 41 deletions(-) diff --git a/src/classes/share/javax/media/j3d/GeometryArrayRetained.java b/src/classes/share/javax/media/j3d/GeometryArrayRetained.java index 94cff1c..c3967f3 100644 --- a/src/classes/share/javax/media/j3d/GeometryArrayRetained.java +++ b/src/classes/share/javax/media/j3d/GeometryArrayRetained.java @@ -29,7 +29,6 @@ package javax.media.j3d; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; -import java.util.Set; import javax.vecmath.Color3b; import javax.vecmath.Color3f; @@ -321,7 +320,7 @@ ArrayList gaList = new ArrayList(1); // key = the RenderBin // value = a set of RenderAtomListInfo objects using this // geometry array for display list purposes - private HashMap dlistUsers = null; +private HashMap> dlistUsers = null; // timestamp used to create display list. This is either // one per renderer for useSharedCtx, or one per Canvas for non-shared @@ -10448,59 +10447,54 @@ ArrayList> morphUserLists = null; } } - // Add the specified render atom as a user of this geometry array - // (for the specified render bin) - void addDlistUser(RenderBin renderBin, RenderAtomListInfo ra) { - if (dlistUsers == null) { - dlistUsers = new HashMap(2, 1.0f); - } +// Add the specified render atom as a user of this geometry array +// (for the specified render bin) +void addDlistUser(RenderBin renderBin, RenderAtomListInfo ra) { + if (dlistUsers == null) + dlistUsers = new HashMap>(2, 1.0f); - Set raSet = (Set)dlistUsers.get(renderBin); + HashSet raSet = dlistUsers.get(renderBin); if (raSet == null) { - raSet = new HashSet(); - dlistUsers.put(renderBin, raSet); + raSet = new HashSet(); + dlistUsers.put(renderBin, raSet); } raSet.add(ra); - } +} - // Remove the specified render atom from the set of users of this - // geometry array (for the specified render bin) - void removeDlistUser(RenderBin renderBin, RenderAtomListInfo ra) { - if (dlistUsers == null) { - // Nothing to do - return; - } +// Remove the specified render atom from the set of users of this +// geometry array (for the specified render bin) +void removeDlistUser(RenderBin renderBin, RenderAtomListInfo ra) { + if (dlistUsers == null) + return; + + HashSet raSet = dlistUsers.get(renderBin); + if (raSet == null) + return; - Set raSet = (Set)dlistUsers.get(renderBin); - if (raSet == null) { - // Nothing to do - return; - } raSet.remove(ra); - } +} - // Returns true if the set of render atoms using this geometry - // array in the specified render bin is empty. - boolean isDlistUserSetEmpty(RenderBin renderBin) { - if (dlistUsers == null) { - return true; - } +// Returns true if the set of render atoms using this geometry +// array in the specified render bin is empty. +boolean isDlistUserSetEmpty(RenderBin renderBin) { + if (dlistUsers == null) + return true; - Set raSet = (Set)dlistUsers.get(renderBin); + HashSet raSet = dlistUsers.get(renderBin); if (raSet == null) { - return true; + return true; } return raSet.isEmpty(); - } +} - // This method is used for debugging only - int numDlistUsers(RenderBin renderBin) { - if (isDlistUserSetEmpty(renderBin)) { - return 0; - } - Set raSet = (Set)dlistUsers.get(renderBin); +// This method is used for debugging only +int numDlistUsers(RenderBin renderBin) { + if (isDlistUserSetEmpty(renderBin)) + return 0; + + HashSet raSet = dlistUsers.get(renderBin); return raSet.size(); - } +} void setDlistTimeStamp(int rdrBit, long timeStamp) { int index = getIndex(rdrBit); -- cgit v1.2.3