fr.inria.zuist.engine
Class ObjectDescription

java.lang.Object
  extended by fr.inria.zuist.engine.ObjectDescription
Direct Known Subclasses:
ClosedShapeDescription, ResourceDescription, TextDescription

public abstract class ObjectDescription
extends Object

Description of objects to be loaded/unloaded in the scene.

Author:
Emmanuel Pietriga

Field Summary
protected  String id
           
protected  Region parentRegion
           
protected  boolean sensitive
           
protected  String takesTo
           
protected  short takesToType
           
protected  int zindex
           
 
Constructor Summary
protected ObjectDescription(String id, int z, Region pr, boolean sensitive)
           
 
Method Summary
abstract  void createObject(SceneManager sm, VirtualSpace vs, boolean fadeIn)
          Called automatically by scene manager.
abstract  void destroyObject(SceneManager sm, VirtualSpace vs, boolean fadeOut)
          Called automatically by scene manager.
abstract  Glyph getGlyph()
          Get Glyph described by this description.
 String getID()
          Get this object description's ID.
 Region getParentRegion()
          Get Region this object belongs to.
abstract  double getX()
          Get x-coordinate of object in virtual space.
abstract  double getY()
          Get y-coordinate of object in virtual space.
 int getZindex()
          Get z-index for this object.
 boolean isSensitive()
          Is the object sensitive to cursor entry/exit.
abstract  void moveTo(double x, double y)
           
protected  void setParentRegion(Region pr)
           
 void setSensitive(boolean b)
          Should the object be sensitive to cursor entry/exit.
 void setTakesTo(String id, short t)
          Should take/"transport" to object/region whose ID is id
protected  void setZindex(int i)
           
 String takesTo()
          Get the ID of object where this one takes/"transports" to.
 short takesToType()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected String id

zindex

protected int zindex

sensitive

protected boolean sensitive

parentRegion

protected Region parentRegion

takesTo

protected String takesTo

takesToType

protected short takesToType
Constructor Detail

ObjectDescription

protected ObjectDescription(String id,
                            int z,
                            Region pr,
                            boolean sensitive)
Method Detail

createObject

public abstract void createObject(SceneManager sm,
                                  VirtualSpace vs,
                                  boolean fadeIn)
Called automatically by scene manager. Can be called by client application to force loading of objects not actually visible.


destroyObject

public abstract void destroyObject(SceneManager sm,
                                   VirtualSpace vs,
                                   boolean fadeOut)
Called automatically by scene manager. Can be called by client application to force unloading of objects still visible.


setSensitive

public void setSensitive(boolean b)
Should the object be sensitive to cursor entry/exit.


isSensitive

public boolean isSensitive()
Is the object sensitive to cursor entry/exit.


getGlyph

public abstract Glyph getGlyph()
Get Glyph described by this description.

Returns:
might return null if the description has not been loaded. This depends on the type of ObjectDescription.

getZindex

public int getZindex()
Get z-index for this object.


setZindex

protected void setZindex(int i)

getParentRegion

public Region getParentRegion()
Get Region this object belongs to.


setParentRegion

protected void setParentRegion(Region pr)

setTakesTo

public void setTakesTo(String id,
                       short t)
Should take/"transport" to object/region whose ID is id

Parameters:
id - set to null if should not take anywhere

takesTo

public String takesTo()
Get the ID of object where this one takes/"transports" to.

Returns:
null if none

takesToType

public short takesToType()
Returns:
one of SceneManager.{TAKES_TO_OBJECT, TAKES_TO_REGION}

getID

public String getID()
Get this object description's ID.


getX

public abstract double getX()
Get x-coordinate of object in virtual space.


getY

public abstract double getY()
Get y-coordinate of object in virtual space.


moveTo

public abstract void moveTo(double x,
                            double y)


Copyright © 2000-2002 Xerox Corporation. All Rights Reserved
Copyright © 2003 World Wide Web Consortium. All Rights Reserved
Copyright © 2004-2011 INRIA. All Rights Reserved
Licensed under the GNU LGPL. For full terms see the file COPYING.