diff options
-rw-r--r-- | src/classes/share/javax/media/j3d/ViewSpecificGroup.java | 29 | ||||
-rw-r--r-- | src/classes/share/javax/media/j3d/ViewSpecificGroupRetained.java | 24 |
2 files changed, 25 insertions, 28 deletions
diff --git a/src/classes/share/javax/media/j3d/ViewSpecificGroup.java b/src/classes/share/javax/media/j3d/ViewSpecificGroup.java index 5477a35..35b327f 100644 --- a/src/classes/share/javax/media/j3d/ViewSpecificGroup.java +++ b/src/classes/share/javax/media/j3d/ViewSpecificGroup.java @@ -183,21 +183,20 @@ public class ViewSpecificGroup extends Group { } - /** - * Returns an enumeration of this ViewSpecificGroup node's list - * of views. - * - * @return an Enumeration object containing all the views. - * @exception CapabilityNotSetException if appropriate capability is - * not set and this object is part of live or compiled scene graph - */ - public Enumeration getAllViews() { - if (isLiveOrCompiled()) - if(!this.getCapability(ALLOW_VIEW_READ)) +/** + * Returns an enumeration of this ViewSpecificGroup node's list + * of views. + * + * @return an Enumeration object containing all the views. + * @exception CapabilityNotSetException if appropriate capability is + * not set and this object is part of live or compiled scene graph + */ +public Enumeration<View> getAllViews() { + if (isLiveOrCompiled() && !this.getCapability(ALLOW_VIEW_READ)) throw new CapabilityNotSetException(J3dI18N.getString("ViewSpecificGroup2")); - return ((ViewSpecificGroupRetained)this.retained).getAllViews(); - } + return ((ViewSpecificGroupRetained) this.retained).getAllViews(); +} /** @@ -350,8 +349,8 @@ public class ViewSpecificGroup extends Group { ViewSpecificGroupRetained attr = (ViewSpecificGroupRetained) originalNode.retained; ViewSpecificGroupRetained rt = (ViewSpecificGroupRetained) retained; - for (Enumeration e = attr.getAllViews(); e.hasMoreElements(); ) { - rt.addView((View)e.nextElement()); + for (Enumeration<View> e = attr.getAllViews(); e.hasMoreElements(); ) { + rt.addView(e.nextElement()); } } diff --git a/src/classes/share/javax/media/j3d/ViewSpecificGroupRetained.java b/src/classes/share/javax/media/j3d/ViewSpecificGroupRetained.java index c38a431..83b9a26 100644 --- a/src/classes/share/javax/media/j3d/ViewSpecificGroupRetained.java +++ b/src/classes/share/javax/media/j3d/ViewSpecificGroupRetained.java @@ -36,7 +36,7 @@ import java.util.Vector; class ViewSpecificGroupRetained extends GroupRetained { - ArrayList apiViewList = new ArrayList(); +ArrayList<View> apiViewList = new ArrayList<View>(); // Used by leaf objects particularly GAs // Updated in a MT Safe manner and also used by RenderBin @@ -154,10 +154,8 @@ class ViewSpecificGroupRetained extends GroupRetained { } - void setView(View view, int index) { - int i; - - View oldView = (View)apiViewList.get(index); +void setView(View view, int index) { + View oldView = apiViewList.get(index); Integer mtype = new Integer(SET_VIEW); if (oldView == view) @@ -315,9 +313,9 @@ class ViewSpecificGroupRetained extends GroupRetained { return keyList; } - View getView(int index) { - return (View)apiViewList.get(index); - } +View getView(int index) { + return apiViewList.get(index); +} void insertView(View view, int index) { int i; @@ -414,7 +412,7 @@ class ViewSpecificGroupRetained extends GroupRetained { void removeView(int index) { int i; - View v = (View) apiViewList.remove(index); + View v = apiViewList.remove(index); if (source.isLive() && v != null) { // Gather all affected leaf nodes and send a message to // RenderingEnv and RenderBin @@ -500,13 +498,13 @@ class ViewSpecificGroupRetained extends GroupRetained { } } - Enumeration getAllViews() { - Vector viewList = new Vector(); +Enumeration<View> getAllViews() { + Vector<View> viewList = new Vector<View>(apiViewList.size()); for (int i = 0; i < apiViewList.size(); i++) { - viewList.add(apiViewList.get(i)); + viewList.add(apiViewList.get(i)); } return viewList.elements(); - } +} int numViews() { return apiViewList.size(); |