maspack.render
Class TextureProps

java.lang.Object
  extended by maspack.render.TextureProps
All Implemented Interfaces:
java.lang.Cloneable, CompositeProperty, HasProperties, Clonable, Scannable

public class TextureProps
extends java.lang.Object
implements CompositeProperty, Scannable, Clonable


Nested Class Summary
static class TextureProps.Mode
           
 
Field Summary
static PropertyList myProps
           
 
Constructor Summary
TextureProps()
           
TextureProps(TextureProps props)
           
 
Method Summary
 void clearTextureData()
           
 TextureProps clone()
          Returns a clone of this composite property.
 boolean equals(java.lang.Object obj)
           
 boolean equals(TextureProps props)
           
 PropertyList getAllPropertyInfo()
          Returns a list giving static information about all properties exported by this object.
 PropertyMode getAutomaticMode()
           
 PropertyMode getEnabledMode()
           
 java.lang.String getFileName()
           
 PropertyMode getFileNameMode()
           
 TextureProps.Mode getMode()
           
 PropertyMode getModeMode()
           
 Property getProperty(java.lang.String name)
          Returns a property associated with a specified path name.
 HasProperties getPropertyHost()
          Should be either HierarchyNode or HasProperties
 PropertyInfo getPropertyInfo()
          If this object is a property, returns the corresponding information
 double[] getSCoords()
           
 PropertyMode getSCoordsMode()
           
 PropertyMode getSphereMappingMode()
           
 double[] getTCoords()
           
 PropertyMode getTCoordsMode()
           
 Texture getTexture()
           
 boolean isAutomatic()
           
 boolean isEnabled()
           
 boolean isSphereMappingEnabled()
           
 boolean isWritable()
          Returns true if this component should in fact be written to secondary storage.
static void main(java.lang.String[] args)
           
 void scan(ReaderTokenizer rtok, java.lang.Object ref)
          Scans this element from a ReaderTokenizer.
 void set(TextureProps props)
           
 void setAutomatic(boolean enabled)
           
 void setAutomaticMode(PropertyMode mode)
           
 void setEnabled(boolean enabled)
           
 void setEnabledMode(PropertyMode mode)
           
 void setFileName(java.lang.String name)
           
 void setFileNameMode(PropertyMode mode)
           
 void setMode(TextureProps.Mode m)
           
 void setModeMode(PropertyMode mode)
           
 void setPropertyHost(HasProperties host)
          Sets the host for this property.
 void setPropertyInfo(PropertyInfo info)
          Sets the property information for this property.
 void setSCoords(double[] s)
           
 void setSCoordsMode(PropertyMode mode)
           
 void setSphereMappingEnabled(boolean enabled)
           
 void setSphereMappingMode(PropertyMode mode)
           
 void setTCoords(double[] t)
           
 void setTCoordsMode(PropertyMode mode)
           
 void setTexture(Texture texture)
           
 boolean textureFileExists()
           
 java.lang.String toString()
           
 void write(java.io.PrintWriter pw, NumberFormat fmt, java.lang.Object ref)
          Writes a text description of this element to a PrintWriter.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

myProps

public static PropertyList myProps
Constructor Detail

TextureProps

public TextureProps()

TextureProps

public TextureProps(TextureProps props)
Method Detail

getPropertyHost

public HasProperties getPropertyHost()
Should be either HierarchyNode or HasProperties

Specified by:
getPropertyHost in interface CompositeProperty

getPropertyInfo

public PropertyInfo getPropertyInfo()
If this object is a property, returns the corresponding information

Specified by:
getPropertyInfo in interface CompositeProperty

setPropertyHost

public void setPropertyHost(HasProperties host)
Sets the host for this property.

Specified by:
setPropertyHost in interface CompositeProperty
Parameters:
host - host for this property

setPropertyInfo

public void setPropertyInfo(PropertyInfo info)
Sets the property information for this property.

Specified by:
setPropertyInfo in interface CompositeProperty
Parameters:
info - property information

getProperty

public Property getProperty(java.lang.String name)
Description copied from interface: HasProperties
Returns a property associated with a specified path name. All properties exported by this object must have a name which is a valid Java identifier. Specifying one of these names causes the corresponding Property to be returned. Handles to sub-properties can also be obtained by delimiting the sub-property name(s) by '.' characters. A sub-property exists if the value of a property is itself an object which exports properties. It is only possible to obtain a sub-property handle if each of its ancestor properties exports their values by reference.

Specified by:
getProperty in interface HasProperties
Parameters:
name - name of the desired property or sub-property
Returns:
handle to the property

getAllPropertyInfo

public PropertyList getAllPropertyInfo()
Description copied from interface: HasProperties
Returns a list giving static information about all properties exported by this object.

Specified by:
getAllPropertyInfo in interface HasProperties
Returns:
static information for all exported properties

clearTextureData

public void clearTextureData()

isEnabled

public boolean isEnabled()

setEnabled

public void setEnabled(boolean enabled)

getEnabledMode

public PropertyMode getEnabledMode()

setEnabledMode

public void setEnabledMode(PropertyMode mode)

getMode

public TextureProps.Mode getMode()

setMode

public void setMode(TextureProps.Mode m)

getModeMode

public PropertyMode getModeMode()

setModeMode

public void setModeMode(PropertyMode mode)

getFileName

public java.lang.String getFileName()

setFileName

public void setFileName(java.lang.String name)

textureFileExists

public boolean textureFileExists()

getTexture

public Texture getTexture()

setTexture

public void setTexture(Texture texture)

getFileNameMode

public PropertyMode getFileNameMode()

setFileNameMode

public void setFileNameMode(PropertyMode mode)

isSphereMappingEnabled

public boolean isSphereMappingEnabled()

setSphereMappingEnabled

public void setSphereMappingEnabled(boolean enabled)

getSphereMappingMode

public PropertyMode getSphereMappingMode()

setSphereMappingMode

public void setSphereMappingMode(PropertyMode mode)

isAutomatic

public boolean isAutomatic()

setAutomatic

public void setAutomatic(boolean enabled)

getAutomaticMode

public PropertyMode getAutomaticMode()

setAutomaticMode

public void setAutomaticMode(PropertyMode mode)

setSCoords

public void setSCoords(double[] s)

getSCoords

public double[] getSCoords()

getSCoordsMode

public PropertyMode getSCoordsMode()

setSCoordsMode

public void setSCoordsMode(PropertyMode mode)

setTCoords

public void setTCoords(double[] t)

getTCoords

public double[] getTCoords()

getTCoordsMode

public PropertyMode getTCoordsMode()

setTCoordsMode

public void setTCoordsMode(PropertyMode mode)

set

public void set(TextureProps props)

equals

public boolean equals(TextureProps props)

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

isWritable

public boolean isWritable()
Returns true if this component should in fact be written to secondary storage. This gives subclasses control over whether or not they are actually written out.

Specified by:
isWritable in interface Scannable
Returns:
true if this component should be written to secondary storage.

write

public void write(java.io.PrintWriter pw,
                  NumberFormat fmt,
                  java.lang.Object ref)
           throws java.io.IOException
Description copied from interface: Scannable
Writes a text description of this element to a PrintWriter. The text description should be compatable with scan and complete enough to allow full reconstruction of the element.

Specified by:
write in interface Scannable
Parameters:
pw - stream for writing the element
fmt - numeric formating information
ref - optional reference object which can be used for producing references to other objects
Throws:
java.io.IOException - if an I/O error occured

scan

public void scan(ReaderTokenizer rtok,
                 java.lang.Object ref)
          throws java.io.IOException
Description copied from interface: Scannable
Scans this element from a ReaderTokenizer. The expected text format is assumed to be compatible with that produced by write.

Specified by:
scan in interface Scannable
Parameters:
rtok - Tokenizer from which to scan the element
ref - optional reference object which can be used for resolving references to other objects
Throws:
java.io.IOException - if an I/O or formatting error occured

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

clone

public TextureProps clone()
Description copied from interface: CompositeProperty
Returns a clone of this composite property.

Specified by:
clone in interface CompositeProperty
Specified by:
clone in interface Clonable
Overrides:
clone in class java.lang.Object
Returns:
clone of this property

main

public static void main(java.lang.String[] args)