Xj3D VRML/X3D Code API

vrml.field
Class ConstSFColor

java.lang.Object
  extended byvrml.Field
      extended byvrml.ConstField
          extended byvrml.field.ConstSFColor
All Implemented Interfaces:
java.lang.Cloneable

public class ConstSFColor
extends ConstField

VRML JSAI type class containing a fixed color field

Version:
$Revision: 1.5 $
Author:
Alan Hudson, Justin Couch

Field Summary
protected  float[] data
          The components of the field
 
Fields inherited from class vrml.Field
valueChanged
 
Constructor Summary
protected ConstSFColor()
          Construct an instance with default values.
  ConstSFColor(float red, float green, float blue)
          Create a new color based on the given values.
 
Method Summary
 java.lang.Object clone()
          Create a cloned copy of this node.
 float getBlue()
          Get the blue component of the color
 float getGreen()
          Get the green component of the color
 float getRed()
          Get the red component of the color
 void getValue(float[] colors)
          Copy this angle into the user array
 java.lang.String toString()
          Create a string representation of this field.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

data

protected float[] data
The components of the field

Constructor Detail

ConstSFColor

protected ConstSFColor()
Construct an instance with default values. Not available to mere mortals.


ConstSFColor

public ConstSFColor(float red,
                    float green,
                    float blue)
Create a new color based on the given values.

Parameters:
red - The red component of the color
green - The green component of the color
blue - The blue component of the color
Method Detail

getValue

public void getValue(float[] colors)
Copy this angle into the user array

Parameters:
colors - The target array to copy into

getRed

public float getRed()
Get the red component of the color

Returns:
The red value [0 - 1]

getGreen

public float getGreen()
Get the green component of the color

Returns:
The green value [0 - 1]

getBlue

public float getBlue()
Get the blue component of the color

Returns:
The blue value [0 - 1]

toString

public java.lang.String toString()
Create a string representation of this field.

Returns:
A string representation of the color

clone

public java.lang.Object clone()
Create a cloned copy of this node.

Specified by:
clone in class Field
Returns:
A complete copy of the node

Xj3D VRML/X3D Code API

Copyright © 2001 - 2005 Web3D Consortium