All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.media.j3d.Background

java.lang.Object
   |
   +----java.media.j3d.SceneGraphObject
           |
           +----java.media.j3d.Node
                   |
                   +----java.media.j3d.Leaf
                           |
                           +----java.media.j3d.Background

public class Background
extends Leaf
The Background leaf node defines either a solid background color or a background image that is used to fill the window at the beginning of each new frame. It optionally allows background geometry---which is pre-tessellated onto a unit sphere and is drawn at infinity---to be referenced. It also specifies an application region in which this background is active.


Variable Index

 o ALLOW_APPLICATION_BOUNDS_READ
Specifies that the Background allows read access to its application bounds and bounds leaf at runtime.
 o ALLOW_APPLICATION_BOUNDS_WRITE
Specifies that the Background allows write access to its application bounds and bounds leaf at runtime.
 o ALLOW_COLOR_READ
Specifies that the Background allows read access to its color at runtime.
 o ALLOW_COLOR_WRITE
Specifies that the Background allows write access to its color at runtime.
 o ALLOW_GEOMETRY_READ
Specifies that the Background allows read access to its background geometry at runtime.
 o ALLOW_GEOMETRY_WRITE
Specifies that the Background allows write access to its background geometry at runtime.
 o ALLOW_IMAGE_READ
Specifies that the Background allows read access to its image at runtime.
 o ALLOW_IMAGE_WRITE
Specifies that the Background allows write access to its image at runtime.

Constructor Index

 o Background()
Constructs a Background node with a default color (black).
 o Background(Color3f)
Constructs a Background node with the specified color.
 o Background(float, float, float)
Constructs a Background node with the specified color.
 o Background(PixelArray2D)
Constructs a Background node with the specified image.

Method Index

 o getApplicationBoundingLeaf()
Retrieves the Background node's application bounding leaf.
 o getApplicationBounds()
Retrieves the Background node's application bounds.
 o getColor(Color3f)
Retrieves the background color.
 o getGeometry()
Retrieves the background geometry.
 o getImage()
Retrieves the background image.
 o setApplicationBoundingLeaf(BoundingLeaf)
Set the Background's application region to the specified bounding leaf.
 o setApplicationBounds(Bounds)
Set the Background's application region to the specified bounds.
 o setColor(Color3f)
Sets the background color to the specified color.
 o setColor(float, float, float)
Sets the background color to the specified color.
 o setGeometry(BranchGroup)
Sets the background geometry to the specified BranchGroup node.
 o setImage(PixelArray2D)
Sets the background image to the specified image.

Variables

 o ALLOW_APPLICATION_BOUNDS_READ
 public static final int ALLOW_APPLICATION_BOUNDS_READ
Specifies that the Background allows read access to its application bounds and bounds leaf at runtime.

 o ALLOW_APPLICATION_BOUNDS_WRITE
 public static final int ALLOW_APPLICATION_BOUNDS_WRITE
Specifies that the Background allows write access to its application bounds and bounds leaf at runtime.

 o ALLOW_IMAGE_READ
 public static final int ALLOW_IMAGE_READ
Specifies that the Background allows read access to its image at runtime.

 o ALLOW_IMAGE_WRITE
 public static final int ALLOW_IMAGE_WRITE
Specifies that the Background allows write access to its image at runtime.

 o ALLOW_COLOR_READ
 public static final int ALLOW_COLOR_READ
Specifies that the Background allows read access to its color at runtime.

 o ALLOW_COLOR_WRITE
 public static final int ALLOW_COLOR_WRITE
Specifies that the Background allows write access to its color at runtime.

 o ALLOW_GEOMETRY_READ
 public static final int ALLOW_GEOMETRY_READ
Specifies that the Background allows read access to its background geometry at runtime.

 o ALLOW_GEOMETRY_WRITE
 public static final int ALLOW_GEOMETRY_WRITE
Specifies that the Background allows write access to its background geometry at runtime.

Constructors

 o Background
 public Background()
Constructs a Background node with a default color (black).

 o Background
 public Background(Color3f color)
Constructs a Background node with the specified color.

 o Background
 public Background(float r,
                   float g,
                   float b)
Constructs a Background node with the specified color.

 o Background
 public Background(PixelArray2D image)
Constructs a Background node with the specified image. If this image is non-null then the color is ignored.

Parameters:
image - pixel array object used as the background image

Methods

 o setColor
 public final void setColor(Color3f color)
Sets the background color to the specified color. This color is used if the image is null.

Parameters:
color - the new background color
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o setColor
 public final void setColor(float r,
                            float g,
                            float b)
Sets the background color to the specified color. This color is used if the image is null.

Parameters:
r - the red component of the background color
g - the green component of the background color
b - the blue component of the background color
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o getColor
 public final void getColor(Color3f color)
Retrieves the background color.

Parameters:
color - the vector that will receive the current background color
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o setImage
 public final void setImage(PixelArray2D image)
Sets the background image to the specified image. If this image is non-null then the color is ignored.

Parameters:
image - new pixel array object used as the background image
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o getImage
 public final PixelArray2D getImage()
Retrieves the background image.

Returns:
the current background image
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o setGeometry
 public final void setGeometry(BranchGroup branch)
Sets the background geometry to the specified BranchGroup node. If non-null, this background geometry is drawn on top of the background color or image using a projection matrix that essentially puts the geometry at infinity. The geometry should be pre-tessellated onto a unit sphere.

Parameters:
branch - the root of the background geometry
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
Throws: IllegalSharingException
if the BranchGroup node is a child of any Group node, or is already attached to a Locale, or is already referenced by another Background node.
 o getGeometry
 public final BranchGroup getGeometry()
Retrieves the background geometry.

Returns:
the BranchGroup node that is the root of the background geometry
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o setApplicationBounds
 public final void setApplicationBounds(Bounds region)
Set the Background's application region to the specified bounds. This is used when the application bounding leaf is set to null.

Parameters:
region - the bounds that contains the Background's new application region.
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o getApplicationBounds
 public final Bounds getApplicationBounds()
Retrieves the Background node's application bounds.

Returns:
this Background's application bounds information
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o setApplicationBoundingLeaf
 public final void setApplicationBoundingLeaf(BoundingLeaf region)
Set the Background's application region to the specified bounding leaf. When set to a value other than null, this overrides the application bounds object.

Parameters:
region - the bounding leaf node used to specify the Background node's new application region.
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o getApplicationBoundingLeaf
 public final BoundingLeaf getApplicationBoundingLeaf()
Retrieves the Background node's application bounding leaf.

Returns:
this Background's application bounding leaf information
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph

All Packages  Class Hierarchy  This Package  Previous  Next  Index