From 26c75696599004c1af04d02d3ce015b1b4e8261a Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Sat, 2 Feb 2013 10:24:31 -0800 Subject: j3dcore: Annotate list of user sounds in GraphicsContext3D Signed-off-by: Harvey Harrison --- .../share/javax/media/j3d/GraphicsContext3D.java | 53 +++++++++++----------- 1 file changed, 26 insertions(+), 27 deletions(-) (limited to 'src/classes/share') diff --git a/src/classes/share/javax/media/j3d/GraphicsContext3D.java b/src/classes/share/javax/media/j3d/GraphicsContext3D.java index 8b2c8ec..450fee9 100644 --- a/src/classes/share/javax/media/j3d/GraphicsContext3D.java +++ b/src/classes/share/javax/media/j3d/GraphicsContext3D.java @@ -126,7 +126,7 @@ public class GraphicsContext3D extends Object { private Appearance uAppearance = null; private Vector uLights = new Vector(); private HiResCoord uHiRes = new HiResCoord(); - private Vector uSounds = new Vector(); + private Vector uSounds = new Vector(); private AuralAttributes uAuralAttributes = null; private boolean uBufferOverride = false; private boolean uFrontBufferRendering = false; @@ -1218,7 +1218,7 @@ public int numLights() { if (sound.isLive()) { throw new IllegalSharingException(J3dI18N.getString("GraphicsContext3D23")); } - uSounds.setElementAt(sound, index); + uSounds.set(index, sound); if ((canvas3d.view == null) || (canvas3d.view.universe == null) || (!canvas3d.view.active) || @@ -1269,7 +1269,7 @@ public int numLights() { if (sound.isLive()) { throw new IllegalSharingException(J3dI18N.getString("GraphicsContext3D23")); } - uSounds.insertElementAt(sound, index); + uSounds.add(index, sound); if ((canvas3d.view == null) || (canvas3d.view.universe == null) || (!canvas3d.view.active) || @@ -1297,7 +1297,7 @@ public int numLights() { * @param index which sound to remove */ public void removeSound(int index) { - uSounds.removeElementAt(index); + uSounds.remove(index); if ((canvas3d.view == null) || (canvas3d.view.universe == null) || (!canvas3d.view.active) || @@ -1323,23 +1323,22 @@ public int numLights() { sendSoundMessage(GraphicsContext3D.REMOVE_SOUND, null, sound); } - /** - * Retrieves the index selected sound. - * @param index which sound to return - * @return the sound at location index - */ - public Sound getSound(int index) { - Sound sound = (Sound)(uSounds.elementAt(index)); - return sound; - } +/** + * Retrieves the index selected sound. + * @param index which sound to return + * @return the sound at location index + */ +public Sound getSound(int index) { + return uSounds.get(index); +} - /** - * Retrieves the enumeration object of all the sounds. - * @return the enumeration object of all the sounds - */ - public Enumeration getAllSounds() { - return uSounds.elements(); - } +/** + * Retrieves the enumeration object of all the sounds. + * @return the enumeration object of all the sounds + */ +public Enumeration getAllSounds() { + return uSounds.elements(); +} /** * Appends the specified sound to this graphics context's list of sounds. @@ -1361,7 +1360,7 @@ public int numLights() { throw new IllegalSharingException(J3dI18N.getString("GraphicsContext3D23")); } - uSounds.addElement(sound); + uSounds.add(sound); if ((canvas3d.view == null) || (canvas3d.view.universe == null) || (!canvas3d.view.active) || @@ -1383,13 +1382,13 @@ public int numLights() { sendSoundMessage(GraphicsContext3D.ADD_SOUND, sound, null); } - /** - * Retrieves the current number of sounds in this graphics context. - * @return the current number of sounds - */ - public int numSounds() { +/** + * Retrieves the current number of sounds in this graphics context. + * @return the current number of sounds + */ +public int numSounds() { return uSounds.size(); - } +} SoundScheduler getSoundScheduler() { if (canvas3d != null && canvas3d.view != null) -- cgit v1.2.3