de.javagl.swogl.scene
Class DefaultLightSetup

java.lang.Object
  extended by de.javagl.swogl.scene.DefaultLightSetup
All Implemented Interfaces:
LightSetup

public final class DefaultLightSetup
extends java.lang.Object
implements LightSetup

Default implementation of a LightSetup


Constructor Summary
DefaultLightSetup()
          Creates a new, empty light setup, with a default ambient light of (0.2, 0.2, 0.2, 1.0).
 
Method Summary
 void addLight(Light light)
          Add the given Light to this setup.
 void addLightSetupListener(LightSetupListener lightSetupListener)
          Add the given LightSetupListener to be informed about changes in this LightSetup
 void clear()
          Removes all lights from this LightSetup
 javax.vecmath.Color4f getAmbient()
          Returns the global ambient light color
 java.util.List<Light> getLights()
          Returns an unmodifiable copy of the current list of lights contained in this setup.
 int getMaximumNumberOfLights()
          Returns the maximum number of Lights that may be contained in this setup
 void removeLight(int index)
          Removes the Light with the given Index from this setup.
 void removeLight(Light light)
          Removes the given Light from this setup.
 void removeLightSetupListener(LightSetupListener lightSetupListener)
          Remove the given LightSetupListener
 void setAmbient(javax.vecmath.Tuple4f color)
          Set the global ambient light color
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultLightSetup

public DefaultLightSetup()
Creates a new, empty light setup, with a default ambient light of (0.2, 0.2, 0.2, 1.0).

Method Detail

getAmbient

public javax.vecmath.Color4f getAmbient()
Description copied from interface: LightSetup
Returns the global ambient light color

Specified by:
getAmbient in interface LightSetup
Returns:
The global ambient light color

setAmbient

public void setAmbient(javax.vecmath.Tuple4f color)
Description copied from interface: LightSetup
Set the global ambient light color

Specified by:
setAmbient in interface LightSetup
Parameters:
color - The global ambient light color

getMaximumNumberOfLights

public int getMaximumNumberOfLights()
Description copied from interface: LightSetup
Returns the maximum number of Lights that may be contained in this setup

Specified by:
getMaximumNumberOfLights in interface LightSetup
Returns:
The maximum number of lights

addLight

public void addLight(Light light)
Description copied from interface: LightSetup
Add the given Light to this setup.

Specified by:
addLight in interface LightSetup
Parameters:
light - The light to add

removeLight

public void removeLight(int index)
Description copied from interface: LightSetup
Removes the Light with the given Index from this setup.

Specified by:
removeLight in interface LightSetup
Parameters:
index - The index of the Light to remove.

removeLight

public void removeLight(Light light)
Description copied from interface: LightSetup
Removes the given Light from this setup.

Specified by:
removeLight in interface LightSetup
Parameters:
light - The Light to remove.

clear

public void clear()
Description copied from interface: LightSetup
Removes all lights from this LightSetup

Specified by:
clear in interface LightSetup

getLights

public java.util.List<Light> getLights()
Description copied from interface: LightSetup
Returns an unmodifiable copy of the current list of lights contained in this setup.

Specified by:
getLights in interface LightSetup
Returns:
The current list of lights

addLightSetupListener

public void addLightSetupListener(LightSetupListener lightSetupListener)
Description copied from interface: LightSetup
Add the given LightSetupListener to be informed about changes in this LightSetup

Specified by:
addLightSetupListener in interface LightSetup
Parameters:
lightSetupListener - The listener to add

removeLightSetupListener

public void removeLightSetupListener(LightSetupListener lightSetupListener)
Description copied from interface: LightSetup
Remove the given LightSetupListener

Specified by:
removeLightSetupListener in interface LightSetup
Parameters:
lightSetupListener - The listener to remove

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object