hmi.graphics.scenegraph
Class GTexture

java.lang.Object
  extended by hmi.xml.XMLStructureAdapter
      extended by hmi.graphics.scenegraph.GTexture
All Implemented Interfaces:
BinaryExternalizable, Diff.Differentiable, XMLStructure

public class GTexture
extends XMLStructureAdapter
implements BinaryExternalizable, Diff.Differentiable

A GTexture is the hmi.graphics.scenegraph representation of a texture, defined by its attributes like file name, wrap mode etcetera.

Author:
Job Zwiers

Field Summary
private  String imageFile
           
private  String name
           
private  float offsetR
           
private  float offsetS
           
private  float offsetT
           
private  float repeatR
           
private  float repeatS
           
private  float repeatT
           
private  String wrapR
           
private  String wrapS
           
private  String wrapT
           
private static String XMLTAG
           
 
Fields inherited from class hmi.xml.XMLStructureAdapter
ATTRIBUTE_TOKEN_DELIMITERS, COMMA_SEPARATOR, DECODEDARRAYSIZE, DEFAULT_RECOVER_MODE, NEWLINE, SYSTEMNEWLINE, TAB, TAB_STRING
 
Constructor Summary
GTexture()
          Creates a new GTexture, with default settins, and empty imageFile name
GTexture(XMLTokenizer tokenizer)
          Creates a new GTexture and reconstructs it from an XMLTokenizer stream
 
Method Summary
 StringBuilder appendAttributeString(StringBuilder buf, XMLFormatting fmt)
          appends the id and sid XML attributes to buf.
 void decodeAttributes(HashMap<String,String> attrMap, XMLTokenizer tokenizer)
          decodes the id and sid XML attributes.
 String getImageFileName()
          returns the texture file name
 float getOffsetR()
          Returns the offset for the R coordinate
 float getOffsetS()
          Returns the offset for the S coordinate
 float getOffsetT()
          Returns the offset for the T coordinate
 float getRepeatR()
          Returns the repeat factor for the R coordinate
 float getRepeatS()
          Returns the repeat factor for the S coordinate
 float getRepeatT()
          Returns the repeat factor for the T coordinate
 String getWrapR()
          returns the wrap mode for the R coordinate
 String getWrapS()
          returns the wrap mode for the S coordinate
 String getWrapT()
          returns the wrap mode for the T coordinate
 String getXMLTag()
          returns the XML Stag for XML encoding
 boolean hasContent()
          always returns false: no XML content part
 void readBinary(DataInput dataIn)
          Reads a binary encoding from dataIn
 void setImageFileName(String imageFile)
          Sets the texture file name
 void setOffsetR(float r)
          Sets the offset for the R coordinate
 void setOffsetS(float r)
          Sets the offset for the S coordinate
 void setOffsetT(float r)
          Sets the offsetr for the T coordinate
 void setRepeatR(float r)
          Sets the repeat factor for the R coordinate
 void setRepeatS(float r)
          Sets the repeat factor for the S coordinate
 void setRepeatT(float r)
          Sets the repeat factor for the T coordinate
 void setWrapR(String wt)
          Sets the wrap mode for the R coordinate
 void setWrapS(String wt)
          Sets the wrap mode for the S coordinate
 void setWrapT(String wt)
          Sets the wrap mode for the T coordinate
 String showDiff(Object gtObj)
          show differences
 void writeBinary(DataOutput dataOut)
          Writes a binary encoding to dataOut
static String xmlTag()
          The XML Stag for XML encoding
 
Methods inherited from class hmi.xml.XMLStructureAdapter
appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttributes, appendAttributes, appendAttributeString, appendBooleans, appendCloseEmptyTag, appendCloseSTag, appendComment, appendContent, appendContent, appendDoubleElement, appendEmptyTag, appendEmptyTag, appendEmptyTag, appendEmptyTag, appendEmptyTag, appendEmptyTag, appendETag, appendETag, appendFloatArrayElement, appendFloatElement, appendFloats, appendIntArrayElement, appendIntElement, appendInts, appendLongElement, appendNewLine, appendNewLine, appendNewLine, appendOpenSTag, appendOpenSTag, appendOptionalDoubleElement, appendOptionalFloatElement, appendOptionalIntElement, appendOptionalLongElement, appendSpaces, appendSpaces, appendSTag, appendSTag, appendSTag, appendStringArrayElement, appendStrings, appendSystemNewLine, appendTab, appendTextElement, appendXML, appendXML, appendXML, appendXML, appendXML, appendXMLStructure, appendXMLStructureList, appendXMLTextElementList, countTokens, countTokens, decodeAttribute, decodeAttribute, decodeBoolean, decodeBooleanArray, decodeBooleanArray, decodeBooleanArray, decodeBooleanArray, decodeContent, decodeDouble, decodeDoubleArray, decodeDoubleArray, decodeDoubleArray, decodeDoubleArray, decodeFloat, decodeFloatArray, decodeFloatArray, decodeFloatArray, decodeFloatArray, decodeFloatArrayElement, decodeInt, decodeIntArray, decodeIntArray, decodeIntArray, decodeIntArray, decodeIntArrayElement, decodeLong, decodeStringArray, decodeStringArray, decodeStringArray, decodeStringArray, decodeStringArrayElement, decodeStringList, decodeStringList, decodeXMLStructureList, decodeXMLValueElement, encodeStringArray, encodeStringArray, encodeStringList, encodeStringList, getNamespace, getOptionalAttribute, getOptionalAttribute, getOptionalBooleanAttribute, getOptionalDoubleAttribute, getOptionalFloatAttribute, getOptionalIntAttribute, getOptionalLongAttribute, getRequiredAttribute, getRequiredBooleanAttribute, getRequiredDoubleAttribute, getRequiredFloatAttribute, getRequiredIntAttribute, getRequiredLongAttribute, getTagLine, hasAttribute, parseXMLElement, postProcess, preProcess, readXML, readXML, readXML, readXML, readXML, setConsoleAttributeEnabled, setDefaultRecoverMode, setRecoverMode, spaces, toString, toXMLString, toXMLString, toXMLString, toXMLString, toXMLString, toXMLString, writeXML, writeXML, writeXML, writeXML, writeXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

private String name

wrapS

private String wrapS

wrapT

private String wrapT

wrapR

private String wrapR

repeatS

private float repeatS

repeatT

private float repeatT

repeatR

private float repeatR

offsetS

private float offsetS

offsetT

private float offsetT

offsetR

private float offsetR

imageFile

private String imageFile

XMLTAG

private static final String XMLTAG
See Also:
Constant Field Values
Constructor Detail

GTexture

public GTexture()
Creates a new GTexture, with default settins, and empty imageFile name


GTexture

public GTexture(XMLTokenizer tokenizer)
         throws IOException
Creates a new GTexture and reconstructs it from an XMLTokenizer stream

Throws:
IOException
Method Detail

showDiff

public String showDiff(Object gtObj)
show differences

Specified by:
showDiff in interface Diff.Differentiable

setWrapS

public void setWrapS(String wt)
Sets the wrap mode for the S coordinate


getWrapS

public String getWrapS()
returns the wrap mode for the S coordinate


setWrapT

public void setWrapT(String wt)
Sets the wrap mode for the T coordinate


getWrapT

public String getWrapT()
returns the wrap mode for the T coordinate


setWrapR

public void setWrapR(String wt)
Sets the wrap mode for the R coordinate


getWrapR

public String getWrapR()
returns the wrap mode for the R coordinate


setRepeatS

public void setRepeatS(float r)
Sets the repeat factor for the S coordinate


getRepeatS

public float getRepeatS()
Returns the repeat factor for the S coordinate


setRepeatT

public void setRepeatT(float r)
Sets the repeat factor for the T coordinate


getRepeatT

public float getRepeatT()
Returns the repeat factor for the T coordinate


setRepeatR

public void setRepeatR(float r)
Sets the repeat factor for the R coordinate


getRepeatR

public float getRepeatR()
Returns the repeat factor for the R coordinate


setOffsetS

public void setOffsetS(float r)
Sets the offset for the S coordinate


getOffsetS

public float getOffsetS()
Returns the offset for the S coordinate


setOffsetT

public void setOffsetT(float r)
Sets the offsetr for the T coordinate


getOffsetT

public float getOffsetT()
Returns the offset for the T coordinate


setOffsetR

public void setOffsetR(float r)
Sets the offset for the R coordinate


getOffsetR

public float getOffsetR()
Returns the offset for the R coordinate


setImageFileName

public void setImageFileName(String imageFile)
Sets the texture file name


getImageFileName

public String getImageFileName()
returns the texture file name


appendAttributeString

public StringBuilder appendAttributeString(StringBuilder buf,
                                           XMLFormatting fmt)
appends the id and sid XML attributes to buf.

Overrides:
appendAttributeString in class XMLStructureAdapter

decodeAttributes

public void decodeAttributes(HashMap<String,String> attrMap,
                             XMLTokenizer tokenizer)
decodes the id and sid XML attributes.

Overrides:
decodeAttributes in class XMLStructureAdapter

hasContent

public boolean hasContent()
always returns false: no XML content part

Overrides:
hasContent in class XMLStructureAdapter

xmlTag

public static String xmlTag()
The XML Stag for XML encoding


getXMLTag

public String getXMLTag()
returns the XML Stag for XML encoding

Specified by:
getXMLTag in interface XMLStructure
Overrides:
getXMLTag in class XMLStructureAdapter

writeBinary

public void writeBinary(DataOutput dataOut)
                 throws IOException
Writes a binary encoding to dataOut

Specified by:
writeBinary in interface BinaryExternalizable
Throws:
IOException

readBinary

public void readBinary(DataInput dataIn)
                throws IOException
Reads a binary encoding from dataIn

Specified by:
readBinary in interface BinaryExternalizable
Throws:
IOException