javax.media.j3d
Class VirtualUniverse

java.lang.Object
  extended by javax.media.j3d.VirtualUniverse
Direct Known Subclasses:
SimpleUniverse

public class VirtualUniverse
extends java.lang.Object

A VirtualUniverse object is the top-level container for all scene graphs. A virtual universe consists of a set of Locale objects, each of which has a high-resolution position within the virtual universe. An application or applet may have more than one VirtualUniverse objects, but many applications will need only one. Virtual universes are separate entities in that no node object may exist in more than one virtual universe at any one time. Likewise, the objects in one virtual universe are not visible in, nor do they interact with objects in, any other virtual universe.

A VirtualUniverse object defines methods to enumerate its Locale objects and to remove them from the virtual universe.

See Also:
Locale

Constructor Summary
VirtualUniverse()
          Constructs a new VirtualUniverse.
 
Method Summary
 java.util.Enumeration getAllLocales()
          Returns the enumeration object of all locales in this virtual universe.
static int getJ3DThreadPriority()
          Retrieves that priority of Java 3D's threads.
static java.util.Map getProperties()
          Returns a read-only Map object containing key-value pairs that define various global properties for Java 3D.
 int numLocales()
          Returns the number of locales.
 void removeAllLocales()
          Removes all Locales and their associates branch graphs from this universe.
 void removeLocale(Locale locale)
          Removes a Locale and its associates branch graphs from this universe.
static void setJ3DThreadPriority(int priority)
          Sets the priority of all Java 3D threads to the specified value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VirtualUniverse

public VirtualUniverse()
Constructs a new VirtualUniverse.

Method Detail

removeLocale

public void removeLocale(Locale locale)
Removes a Locale and its associates branch graphs from this universe. All branch graphs within the specified Locale are detached, regardless of whether their ALLOW_DETACH capability bits are set. The Locale is then marked as being dead: no branch graphs may subsequently be attached.

Parameters:
locale - the Locale to be removed.
Throws:
java.lang.IllegalArgumentException - if the specified Locale is not attached to this VirtualUniverse.
Since:
Java 3D 1.2

removeAllLocales

public void removeAllLocales()
Removes all Locales and their associates branch graphs from this universe. All branch graphs within each Locale are detached, regardless of whether their ALLOW_DETACH capability bits are set. Each Locale is then marked as being dead: no branch graphs may subsequently be attached. This method should be called by applications and applets to allow Java 3D to cleanup its resources.

Since:
Java 3D 1.2

getAllLocales

public java.util.Enumeration getAllLocales()
Returns the enumeration object of all locales in this virtual universe.

Returns:
the enumeration object

numLocales

public int numLocales()
Returns the number of locales.

Returns:
the count of locales

setJ3DThreadPriority

public static void setJ3DThreadPriority(int priority)
Sets the priority of all Java 3D threads to the specified value. The default value is the priority of the thread that started Java 3D.

Parameters:
priority - the new thread priority
Throws:
java.lang.IllegalArgumentException - if the priority is not in the range MIN_PRIORITY to MAX_PRIORITY
java.lang.SecurityException - if the priority is greater than that of the calling thread
Since:
Java 3D 1.2

getJ3DThreadPriority

public static int getJ3DThreadPriority()
Retrieves that priority of Java 3D's threads.

Returns:
the current priority of Java 3D's threads
Since:
Java 3D 1.2

getProperties

public static final java.util.Map getProperties()
Returns a read-only Map object containing key-value pairs that define various global properties for Java 3D. All of the keys are String objects. The values are key-specific, but most will be String objects.

The set of global Java 3D properties always includes values for the following keys:

The descriptions of the values returned for each key are as follows:

Returns:
the global Java 3D properties
Since:
Java 3D 1.3