j3d.org Aviatrix3D

org.j3d.aviatrix3d
Class ColorBackground

java.lang.Object
  extended byorg.j3d.aviatrix3d.SceneGraphObject
      extended byorg.j3d.aviatrix3d.Node
          extended byorg.j3d.aviatrix3d.Leaf
              extended byorg.j3d.aviatrix3d.Background
                  extended byorg.j3d.aviatrix3d.ColorBackground
All Implemented Interfaces:
Renderable, RenderableObject

public class ColorBackground
extends Background

Background node that represents a single solid 4-component colour.

This will set the background colour to a single colour for the entire viewport. If used, this will override the setClearColor() on DrawableSurface.

Version:
$Revision: 1.10 $
Author:
Justin Couch

Field Summary
 
Fields inherited from class org.j3d.aviatrix3d.Background
dispListMap
 
Fields inherited from class org.j3d.aviatrix3d.Node
bounds, implicitBounds, INVALID_BOUNDS, parent
 
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject
alive, updateHandler, WRITE_TIMING_MSG
 
Constructor Summary
ColorBackground()
          Constructs a background node for a base colour of black.
ColorBackground(float[] c)
          Construct a background node for a user-provided colour
 
Method Summary
 void getColor(float[] c)
          Get the current drawing colour
protected  void markBoundsDirty()
          Mark this node as having dirty bounds due to one of it's children having their bounds changed.
 void postRender(net.java.games.jogl.GL gl, net.java.games.jogl.GLU glu)
          Restore all openGL state to the given drawable.
 void render(net.java.games.jogl.GL gl, net.java.games.jogl.GLU glu)
          Issue ogl commands needed for this component
 void setColor(float[] c)
          Change the colour to the new colour.
 void setColor(float r, float g, float b, float a)
          Change the colour to the new colour.
 
Methods inherited from class org.j3d.aviatrix3d.Node
boundsChanged, checkForCyclicParent, getBounds, getParent, recomputeBounds, removeParent, setBounds, setLive, setParent, updateBounds
 
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject
checkForCyclicChild, dataChanged, getUserData, isLive, setUpdateHandler, setUserData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColorBackground

public ColorBackground()
Constructs a background node for a base colour of black.


ColorBackground

public ColorBackground(float[] c)
Construct a background node for a user-provided colour

Method Detail

render

public void render(net.java.games.jogl.GL gl,
                   net.java.games.jogl.GLU glu)
Issue ogl commands needed for this component

Parameters:
gl - The gl context to draw with
glu - The utility context to draw with

postRender

public void postRender(net.java.games.jogl.GL gl,
                       net.java.games.jogl.GLU glu)
Restore all openGL state to the given drawable.

Parameters:
gl - The gl context to draw with
glu - The utility context to draw with

markBoundsDirty

protected void markBoundsDirty()
Mark this node as having dirty bounds due to one of it's children having their bounds changed.

Overrides:
markBoundsDirty in class Node

setColor

public void setColor(float[] c)
              throws InvalidWriteTimingException
Change the colour to the new colour. Colour takes RGBA.

Parameters:
c - The colour to copy in
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener callback method

setColor

public void setColor(float r,
                     float g,
                     float b,
                     float a)
              throws InvalidWriteTimingException
Change the colour to the new colour. Colour takes RGBA.

Parameters:
r - The red colour component to use
g - The green colour component to use
b - The blue colour component to use
a - The alpha colour component to use
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener callback method

getColor

public void getColor(float[] c)
Get the current drawing colour

Parameters:
c - An array of length 4 or more to copy the colour to

j3d.org Aviatrix3D

Latest Info from http://aviatrix3d.j3d.org/
Copyright © 2003 - j3d.org