org.jdesktop.wonderland.client.jme
Class ViewProperties

java.lang.Object
  extended by org.jdesktop.wonderland.client.jme.ViewProperties

public class ViewProperties
extends java.lang.Object

A collection of configurable properties for the View. When a property has been changed, a set of listeners are notified of the change. This class is also JAXB annotated so that is may be (de)serialized to/from XML.

Author:
Jordan Slott

Nested Class Summary
static interface ViewProperties.ViewPropertiesListener
          Listener for changes in the collection of view properties
static class ViewProperties.ViewProperty
          An enumeration of all possible type sof view properties
 
Constructor Summary
ViewProperties()
          Default constructor
 
Method Summary
 void addViewPropertiesListener(ViewProperties.ViewPropertiesListener listener)
          Adds a new property change listener to the set.
static ViewProperties decode(java.io.Reader r)
          Takes the input reader of the XML file and instantiates an instance of the ViewProperties class.
 void encode(java.io.Writer w)
          Writes the ViewProperties class to an output writer.
 float getBackClip()
          Returns the back clip (meters).
 float getFieldOfView()
          Returns the field-of-view in degrees.
 float getFrontClip()
          Returns the front clip (meters).
 void removeViewPropertiesListener(ViewProperties.ViewPropertiesListener listener)
          Removes an existing property change listener from the set.
 void setBackClip(float clip)
          Sets the back clip (meters) and notifies any registered listeners.
 void setFieldOfView(float fov)
          Sets the field-of-view in degress and notifies any registered listeners.
 void setFrontClip(float clip)
          Sets the front clip (meters) and notifies any registered listeners.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewProperties

public ViewProperties()
Default constructor

Method Detail

getFieldOfView

public float getFieldOfView()
Returns the field-of-view in degrees.

Returns:
The field-of-view

setFieldOfView

public void setFieldOfView(float fov)
Sets the field-of-view in degress and notifies any registered listeners.

Parameters:
fov - The new field-of-view (degrees)

getFrontClip

public float getFrontClip()
Returns the front clip (meters).

Returns:
The front clip

setFrontClip

public void setFrontClip(float clip)
Sets the front clip (meters) and notifies any registered listeners.

Parameters:
clip - The front clip (meters)

getBackClip

public float getBackClip()
Returns the back clip (meters).

Returns:
The back clip

setBackClip

public void setBackClip(float clip)
Sets the back clip (meters) and notifies any registered listeners.

Parameters:
clip - The back clip (meters)

addViewPropertiesListener

public void addViewPropertiesListener(ViewProperties.ViewPropertiesListener listener)
Adds a new property change listener to the set. If the listener already exists, this method does nothing.

Parameters:
listener - The listener to add

removeViewPropertiesListener

public void removeViewPropertiesListener(ViewProperties.ViewPropertiesListener listener)
Removes an existing property change listener from the set. If the listener does not exist, the method does nothing.

Parameters:
listener - The listener to remove

decode

public static ViewProperties decode(java.io.Reader r)
                             throws javax.xml.bind.JAXBException
Takes the input reader of the XML file and instantiates an instance of the ViewProperties class.

Parameters:
r - The input reader of the version XML file
Throws:
javax.xml.bind.JAXBException

encode

public void encode(java.io.Writer w)
            throws javax.xml.bind.JAXBException
Writes the ViewProperties class to an output writer.

Parameters:
w - The output writer to write to
Throws:
javax.xml.bind.JAXBException


Open Wonderland - http://openwonderland.org