Xj3D VRML/X3D Code API

org.web3d.vrml.renderer.common.nodes
Class BaseTexture2DNode

java.lang.Object
  extended byorg.web3d.vrml.renderer.common.nodes.AbstractNode
      extended byorg.web3d.vrml.renderer.common.nodes.BaseTextureNode
          extended byorg.web3d.vrml.renderer.common.nodes.BaseTexture2DNode
All Implemented Interfaces:
FrameStateListener, VRMLAppearanceChildNodeType, VRMLNode, VRMLNodeType, VRMLTexture2DNodeType, VRMLTextureNodeType

public abstract class BaseTexture2DNode
extends BaseTextureNode
implements VRMLTexture2DNodeType

Base implementation of a 2D texture object.

Performs the VRML field handling for REPEAT_S and REPEAT_T.

Version:
$Revision: 1.6 $
Author:
Alan Hudson

Field Summary
protected static int FIELD_REPEATS
          Field Index
protected static int FIELD_REPEATT
           
protected  java.awt.image.RenderedImage implImage
          The base image for this texture
protected static int LAST_TEXTURENODETYPE_INDEX
           
protected  boolean vfRepeatS
          field SFBool repeatS TRUE
protected  boolean vfRepeatT
          field SFBool repeatT TRUE
 
Fields inherited from class org.web3d.vrml.renderer.common.nodes.BaseTextureNode
listenerList
 
Fields inherited from class org.web3d.vrml.renderer.common.nodes.AbstractNode
BAD_NODE_MSG, errorReporter, FIELD_METADATA, fieldData, hasChanged, INIT_ONLY_WRITE_MSG, inSetup, isDEF, isStatic, LAST_NODE_INDEX, METADATA_NODE_MSG, METADATA_PROTO_MSG, nodeName, pMetadata, refCount, stateManager, vfMetadata, vrmlMajorVersion, vrmlMinorVersion
 
Constructor Summary
BaseTexture2DNode(java.lang.String name)
          Default constructor for the node.
 
Method Summary
protected  void copy(VRMLTexture2DNodeType node)
          Set the fields of the grouping node that has the fields set based on the fields of the passed in node.
 VRMLFieldData getFieldValue(int index)
          Get the value of a field.
 java.awt.image.RenderedImage getImage()
          Get the image representation of this texture.
 boolean getRepeatS()
          Get the value of field repeatS.
 boolean getRepeatT()
          Get the value of field repeatT.
 int getTextureType()
          Get the texture type of this texture.
 void setValue(int index, boolean value)
          Set the value of the field at the given index as an boolean.
 
Methods inherited from class org.web3d.vrml.renderer.common.nodes.BaseTextureNode
addTextureListener, fireTextureImageChanged, fireTextureParamsChanged, getCacheString, nearestPowerTwo, removeTextureListener
 
Methods inherited from class org.web3d.vrml.renderer.common.nodes.AbstractNode
addNodeListener, allEventsComplete, checkNodeType, checkSecondaryType, checkSecondaryType, fireFieldChanged, getMetadataObject, getNodeFieldIndices, getRefCount, getSecondaryType, getUserData, getVRMLNodeName, hasFieldChanged, isDEF, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, sendRoute, setDEF, setErrorReporter, setFrameStateManager, setMetadataObject, setupFinished, setUserData, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setVersion, updateRefCount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.web3d.vrml.nodes.VRMLTextureNodeType
addTextureListener, getCacheString, getYUp, removeTextureListener
 
Methods inherited from interface org.web3d.vrml.nodes.VRMLNodeType
addNodeListener, getMetadataObject, getRefCount, hasFieldChanged, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, sendRoute, setDEF, setFrameStateManager, setMetadataObject, setupFinished, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, updateRefCount
 
Methods inherited from interface org.web3d.vrml.lang.VRMLNode
getFieldDeclaration, getFieldIndex, getNodeFieldIndices, getNumFields, getPrimaryType, getSecondaryType, getUserData, getVRMLNodeName, isDEF, setErrorReporter, setUserData, setVersion
 
Methods inherited from interface org.web3d.vrml.nodes.FrameStateListener
allEventsComplete
 

Field Detail

FIELD_REPEATS

protected static final int FIELD_REPEATS
Field Index

See Also:
Constant Field Values

FIELD_REPEATT

protected static final int FIELD_REPEATT
See Also:
Constant Field Values

LAST_TEXTURENODETYPE_INDEX

protected static final int LAST_TEXTURENODETYPE_INDEX
See Also:
Constant Field Values

vfRepeatS

protected boolean vfRepeatS
field SFBool repeatS TRUE


vfRepeatT

protected boolean vfRepeatT
field SFBool repeatT TRUE


implImage

protected java.awt.image.RenderedImage implImage
The base image for this texture

Constructor Detail

BaseTexture2DNode

public BaseTexture2DNode(java.lang.String name)
Default constructor for the node. The repeat flags are set to TRUE.

Parameters:
name - The name of the type of node
Method Detail

copy

protected void copy(VRMLTexture2DNodeType node)
Set the fields of the grouping node that has the fields set based on the fields of the passed in node. This will not copy any children nodes, only the local fields.

Parameters:
node - The grouping node to copy info from

getTextureType

public int getTextureType()
Get the texture type of this texture. Valid entries are defined in the vrml.lang.TextureConstants.

Specified by:
getTextureType in interface VRMLTextureNodeType

getImage

public java.awt.image.RenderedImage getImage()
Get the image representation of this texture.

Specified by:
getImage in interface VRMLTexture2DNodeType
Returns:
The image.

getRepeatS

public boolean getRepeatS()
Get the value of field repeatS. The field is not writable. Default value is true.

Specified by:
getRepeatS in interface VRMLTexture2DNodeType
Returns:
The current value of repeatS

getRepeatT

public boolean getRepeatT()
Get the value of field repeatT. The field is not writable. Default value is true.

Specified by:
getRepeatT in interface VRMLTexture2DNodeType
Returns:
The current value of repeatT

getFieldValue

public VRMLFieldData getFieldValue(int index)
                            throws InvalidFieldException
Get the value of a field. If the field is a primitive type, it will return a class representing the value. For arrays or nodes it will return the instance directly.

Specified by:
getFieldValue in interface VRMLNodeType
Overrides:
getFieldValue in class AbstractNode
Parameters:
index - The index of the field to change.
Returns:
The class representing the field value
Throws:
InvalidFieldException - The field index is not known

setValue

public void setValue(int index,
                     boolean value)
              throws InvalidFieldException
Set the value of the field at the given index as an boolean. This would be used to set SFBool field types.

Specified by:
setValue in interface VRMLNodeType
Overrides:
setValue in class AbstractNode
Parameters:
index - The index of destination field to set
value - The new value to use for the node
Throws:
InvalidFieldException - The field index is not know

Xj3D VRML/X3D Code API

Copyright © 2001 - 2005 Web3D Consortium