crystalspace.jbind.impl.engine.sharevar
Class csSharedVariable

java.lang.Object
  extended bycrystalspace.jbind.impl.csNativeObject
      extended bycrystalspace.jbind.impl.csutil.scf.csBase
          extended bycrystalspace.jbind.impl.engine.sharevar.csSharedVariable
All Implemented Interfaces:
iBase, iPointer, iSharedVariable

public class csSharedVariable
extends csBase
implements iSharedVariable

Author:
Quentin Anciaux

Field Summary
 
Fields inherited from class crystalspace.jbind.impl.csNativeObject
ImplFactory, nPointer
 
Fields inherited from interface crystalspace.jbind.interfaces.iengine.sharevar.iSharedVariable
SV_COLOR, SV_FLOAT, SV_UNKNOWN, SV_VECTOR
 
Constructor Summary
csSharedVariable(iPointer nPointer)
           
 
Method Summary
 void addListener(iSharedVariableListener listener)
          Add a listener to variables.
 float get()
          Get the floating point version of the var value.
 csColor getColor()
          Get the csColor from the variable.
 java.lang.String getName()
          Get the name of this variable.
 int getType()
          Get the type currently stored by this variable.
 csVector3 getVector()
          Get the vector from the variable.
 int getVersion()
          Return the version of the interface
protected  boolean isNativePointerValidSafe(long pointer)
           
 iObject queryObject()
          Get the private object interface.
 void removeListener(iSharedVariableListener listener)
          Remove a listener.
 void set(float val)
          Set the variable to a floating pt value.
 void setColor(csColor col)
          Set the variable to store a csColor.
 void setName(java.lang.String name)
          iSharedVariables are referenced by name.
 void setVector(csVector3 v)
          Set the variable to store a csVector3.
 
Methods inherited from class crystalspace.jbind.impl.csutil.scf.csBase
decRef, equals, finalize, getRefCount, incRef, nDelete, queryInterface, queryInterfaceSafe
 
Methods inherited from class crystalspace.jbind.impl.csNativeObject
changePointer, getPointer, getPointer, getPointerArray, hashCode, isMemoryOwner, isNativePointerValid, newNativeObject, setMemoryOwner, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface crystalspace.jbind.interfaces.iutil.scf.iBase
decRef, getRefCount, incRef, queryInterface, queryInterfaceSafe
 
Methods inherited from interface crystalspace.jbind.interfaces.iPointer
changePointer, getPointer, isMemoryOwner, setMemoryOwner
 

Constructor Detail

csSharedVariable

public csSharedVariable(iPointer nPointer)
Parameters:
nPointer -
Method Detail

getVersion

public int getVersion()
Description copied from interface: iBase
Return the version of the interface

Specified by:
getVersion in interface iBase
Specified by:
getVersion in class csBase
See Also:
iBase.getVersion()

getName

public java.lang.String getName()
Description copied from interface: iSharedVariable
Get the name of this variable.

Specified by:
getName in interface iSharedVariable
Specified by:
getName in class csBase
See Also:
iBase.getName()

isNativePointerValidSafe

protected boolean isNativePointerValidSafe(long pointer)
Specified by:
isNativePointerValidSafe in class csNativeObject
See Also:
csNativeObject.isNativePointerValidSafe(long)

addListener

public void addListener(iSharedVariableListener listener)
Description copied from interface: iSharedVariable
Add a listener to variables.

Specified by:
addListener in interface iSharedVariable
Parameters:
listener -
See Also:
iSharedVariable.addListener(crystalspace.jbind.interfaces.iengine.sharevar.iSharedVariableListener)

get

public float get()
Description copied from interface: iSharedVariable
Get the floating point version of the var value. Referenced by csSpriteLODListener::VariableChanged();, and csLODListener::VariableChanged();.

Specified by:
get in interface iSharedVariable
Returns:
See Also:
iSharedVariable.get()

getColor

public csColor getColor()
Description copied from interface: iSharedVariable
Get the csColor from the variable.

Specified by:
getColor in interface iSharedVariable
Returns:
See Also:
iSharedVariable.getColor()

getType

public int getType()
Description copied from interface: iSharedVariable
Get the type currently stored by this variable.

Specified by:
getType in interface iSharedVariable
Returns:
See Also:
iSharedVariable.getType()

getVector

public csVector3 getVector()
Description copied from interface: iSharedVariable
Get the vector from the variable.

Specified by:
getVector in interface iSharedVariable
Returns:
See Also:
iSharedVariable.getVector()

queryObject

public iObject queryObject()
Description copied from interface: iSharedVariable
Get the private object interface.

Specified by:
queryObject in interface iSharedVariable
Returns:
See Also:
iSharedVariable.queryObject()

removeListener

public void removeListener(iSharedVariableListener listener)
Description copied from interface: iSharedVariable
Remove a listener.

Specified by:
removeListener in interface iSharedVariable
Parameters:
listener -
See Also:
iSharedVariable.removeListener(crystalspace.jbind.interfaces.iengine.sharevar.iSharedVariableListener)

set

public void set(float val)
Description copied from interface: iSharedVariable
Set the variable to a floating pt value.

Specified by:
set in interface iSharedVariable
Parameters:
val -
See Also:
iSharedVariable.set(float)

setColor

public void setColor(csColor col)
Description copied from interface: iSharedVariable
Set the variable to store a csColor.

Specified by:
setColor in interface iSharedVariable
Parameters:
col -
See Also:
iSharedVariable.setColor(crystalspace.jbind.impl.csutil.cscolor.csColor)

setName

public void setName(java.lang.String name)
Description copied from interface: iSharedVariable
iSharedVariables are referenced by name. Here is where you set it.

Specified by:
setName in interface iSharedVariable
Parameters:
name -
See Also:
iSharedVariable.setName(java.lang.String)

setVector

public void setVector(csVector3 v)
Description copied from interface: iSharedVariable
Set the variable to store a csVector3.

Specified by:
setVector in interface iSharedVariable
Parameters:
v -
See Also:
iSharedVariable.setVector(crystalspace.jbind.impl.csgeom.vector3.csVector3)