vrml.field
Class MFColor

java.lang.Object
  extended by vrml.Field
      extended by vrml.MField
          extended by vrml.field.MFColor
All Implemented Interfaces:
java.lang.Cloneable

public class MFColor
extends MField

Represents a VRML MFColor field in Java.


Constructor Summary
MFColor()
          Default constructor.
MFColor(float[] colors)
          Construct an MFColor field.
MFColor(float[][] colors)
          Construct a new MFColor object using the given 2D array containing RGB values.
MFColor(int size, float[] colors)
          Construct an MFColor field.
 
Method Summary
 void addValue(ConstSFColor color)
          Append a new element to the end of an MFColor field.
 void addValue(float red, float green, float blue)
          Append a new element to the end of an MFColor field.
 void addValue(SFColor color)
          Append a new element to the end of an MFColor field.
 void clear()
          Removes all fields from the MField.
 void delete(int index)
          Deletes a field from the MField.
 void get1Value(int index, float[] colors)
          Retrieves a specific SFColor element in an MFColor and returns it as a float array.
 void get1Value(int index, SFColor color)
          Retrieves a specific SFColor element in an MFColor and returns it as an SFColor object.
 int getSize()
          Number of elements contained in the MField.
 void getValue(float[] colors)
          Retrieves the value of an MFColor field.
 void getValue(float[][] colors)
          Retrieves the value of an MFColor field.
 void insertValue(int index, ConstSFColor color)
          Insert a new element at the specified position.
 void insertValue(int index, float red, float green, float blue)
          Insert a new element at the specified position.
 void insertValue(int index, SFColor color)
          Insert a new element at the specified position.
 void set1Value(int index, ConstSFColor color)
          Set an element in an MFColor field.
 void set1Value(int index, float red, float green, float blue)
          Set an element in an MFColor field.
 void set1Value(int index, SFColor color)
          Set an element in an MFColor field.
 void setValue(ConstMFColor colors)
          Set the value of an MFColor field.
 void setValue(float[] colors)
          Set the value of an MFColor field.
 void setValue(float[][] colors)
          Set the value of an MFColor field.
 void setValue(int size, float[] colors)
          Set the value of an MFColor field.
 void setValue(MFColor colors)
          Set the value of an MFColor field.
 
Methods inherited from class vrml.Field
clone, dispose, finalize, getPeer, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MFColor

public MFColor()
Default constructor.


MFColor

public MFColor(float[][] colors)
Construct a new MFColor object using the given 2D array containing RGB values.

Parameters:
colors - An array of sets of three float values (RGB)

MFColor

public MFColor(float[] colors)
Construct an MFColor field.

Parameters:
colors - An array of RGB value

MFColor

public MFColor(int size,
               float[] colors)
Construct an MFColor field.

Parameters:
size - Number of SFColor elements passed in.
colors - List of RGB 3-tuples
Method Detail

getSize

public int getSize()
Description copied from class: MField
Number of elements contained in the MField.

Specified by:
getSize in class MField
Returns:
Number of elements.

clear

public void clear()
Description copied from class: MField
Removes all fields from the MField.

Specified by:
clear in class MField

delete

public void delete(int index)
Description copied from class: MField
Deletes a field from the MField.

Specified by:
delete in class MField
Parameters:
index - Index of field to delete.

getValue

public void getValue(float[][] colors)
Retrieves the value of an MFColor field.

Parameters:
colors - 2D array of sets of RGB values to be returned.

getValue

public void getValue(float[] colors)
Retrieves the value of an MFColor field.

Parameters:
colors - Array of sets of RGB values to be returned.

get1Value

public void get1Value(int index,
                      float[] colors)
Retrieves a specific SFColor element in an MFColor and returns it as a float array.

Parameters:
index - Position of desired SFColor
colors - RGB value of specified SFColor.

get1Value

public void get1Value(int index,
                      SFColor color)
Retrieves a specific SFColor element in an MFColor and returns it as an SFColor object.

Parameters:
index - Position of desired SFColor
color - SFColor that will be set to desired value.

setValue

public void setValue(float[][] colors)
Set the value of an MFColor field.

Parameters:
colors - Array of array of RGB values.

setValue

public void setValue(float[] colors)
Set the value of an MFColor field.

Parameters:
colors - Array of RGB values.

setValue

public void setValue(int size,
                     float[] colors)
Set the value of an MFColor field.

Parameters:
size - Number of elements to put in MFColor field.
colors - Array of RGB values.

setValue

public void setValue(MFColor colors)
Set the value of an MFColor field.

Parameters:
colors - Existing MFColor object to copy values from.

setValue

public void setValue(ConstMFColor colors)
Set the value of an MFColor field.

Parameters:
colors - Existing ConstMFColor object to copy values from.

set1Value

public void set1Value(int index,
                      ConstSFColor color)
Set an element in an MFColor field.

Parameters:
index - Position of element to set.
color - Value to set element to.

set1Value

public void set1Value(int index,
                      SFColor color)
Set an element in an MFColor field.

Parameters:
index - Position of element to set.
color - Value to set element to.

set1Value

public void set1Value(int index,
                      float red,
                      float green,
                      float blue)
Set an element in an MFColor field.

Parameters:
index - Position of element to set.
red - R-component of new color.
green - G-component of new color.
blue - B-component of new color.

addValue

public void addValue(ConstSFColor color)
Append a new element to the end of an MFColor field.

Parameters:
color - Value to append.

addValue

public void addValue(SFColor color)
Append a new element to the end of an MFColor field.

Parameters:
color - Value to append.

addValue

public void addValue(float red,
                     float green,
                     float blue)
Append a new element to the end of an MFColor field.

Parameters:
red - R-component of new element.
green - G-component of new element.
blue - B-component of new element.

insertValue

public void insertValue(int index,
                        ConstSFColor color)
Insert a new element at the specified position.

Parameters:
index - Position to insert new element at.
color - Value to insert.

insertValue

public void insertValue(int index,
                        SFColor color)
Insert a new element at the specified position.

Parameters:
index - Position to insert new element at.
color - Value to insert.

insertValue

public void insertValue(int index,
                        float red,
                        float green,
                        float blue)
Insert a new element at the specified position.

Parameters:
index - Position to insert new element at.
red - R-component of new element.
green - G-component of new element.
blue - B-component of new element.