SEdit.Formalisms.World
Class WorldEntity

java.lang.Object
  extended by SEdit.SElement
      extended by SEdit.SNode
          extended by SEdit.Formalisms.World.WorldEntity
Direct Known Subclasses:
FixedEntity, MobileEntity

public class WorldEntity
extends SNode


Field Summary
protected  java.lang.String behaviorFileName
           
protected  java.lang.String brainClass
           
 
Fields inherited from class SEdit.SElement
comment, descriptor, element, id, label, persistent, structure
 
Constructor Summary
WorldEntity()
           
 
Method Summary
protected  void addInArrow(SArrow a)
           
protected  void addOutArrow(SArrow a)
           
 void afterDoIt()
          Method asked after the activation of entities
 void beforeDoIt()
          Method asked before the activation of entities
 void bodyDoIt()
          The activator of entities which do not have brain
 void delete()
          Delete an entity, and its brain if there is one.
 void doIt()
          The generic activators of entities.
 java.lang.String getBehaviorFileName()
          Return the behavior file name attached to the brain class used for scripting.
 Brain getBrain()
          Get the brain of an entity which generally derives from AbstractAgent.
 java.lang.String getBrainClass()
          Get the brain class name of an entity which generally derives from AbstractAgent.
 int getDistance(WorldEntity e)
          Computes and returns the distance between two entities
 java.util.Vector getInArrows()
           
 java.awt.Point getLocation()
           
 java.util.Vector getOutArrows()
           
 java.awt.Point getPosition()
          Returns the position of an entity, given as a Point.
protected  boolean isConnectable(SArrow s, boolean isTarget)
           
 void makeBrain(java.lang.String className, java.lang.String name, boolean gui, java.lang.String behaviorFileName)
          Creates the brain and launches if it is an agent.
 void selfDelete()
           
 void setBehaviorFileName(java.lang.String s)
          Set the behavior file name attached to the brain class used for scripting the behavior.
 void setBrain(Brain b)
          Set the brain of an entity.
 void setBrainClass(java.lang.String s)
          set the brain class name of an entity.
 void showLine(WorldEntity e, java.awt.Color c)
           
 java.lang.String toString()
           
 
Methods inherited from class SEdit.SNode
activate, deleteInArrow, deleteOutArrow, initGraphics, reInstall
 
Methods inherited from class SEdit.SElement
dump, getComment, getDescriptor, getGObject, getID, getLabel, getStructure, init, inspect, setComment, setDescriptor, setGObject, setID, setLabel, setStructure
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

brainClass

protected java.lang.String brainClass

behaviorFileName

protected java.lang.String behaviorFileName
Constructor Detail

WorldEntity

public WorldEntity()
Method Detail

getInArrows

public java.util.Vector getInArrows()
Specified by:
getInArrows in class SNode

getOutArrows

public java.util.Vector getOutArrows()
Specified by:
getOutArrows in class SNode

addOutArrow

protected void addOutArrow(SArrow a)
Specified by:
addOutArrow in class SNode

addInArrow

protected void addInArrow(SArrow a)
Specified by:
addInArrow in class SNode

isConnectable

protected boolean isConnectable(SArrow s,
                                boolean isTarget)
Specified by:
isConnectable in class SNode

getLocation

public java.awt.Point getLocation()

setBrain

public void setBrain(Brain b)
Set the brain of an entity. The brain generally derives from AbstractAgent.


getBrain

public Brain getBrain()
Get the brain of an entity which generally derives from AbstractAgent.


setBrainClass

public void setBrainClass(java.lang.String s)
set the brain class name of an entity. The brain generally derives from AbstractAgent.


getBrainClass

public java.lang.String getBrainClass()
Get the brain class name of an entity which generally derives from AbstractAgent.


setBehaviorFileName

public void setBehaviorFileName(java.lang.String s)
Set the behavior file name attached to the brain class used for scripting the behavior.


getBehaviorFileName

public java.lang.String getBehaviorFileName()
Return the behavior file name attached to the brain class used for scripting.


getPosition

public java.awt.Point getPosition()
Returns the position of an entity, given as a Point.


getDistance

public int getDistance(WorldEntity e)
Computes and returns the distance between two entities


makeBrain

public void makeBrain(java.lang.String className,
                      java.lang.String name,
                      boolean gui,
                      java.lang.String behaviorFileName)
Creates the brain and launches if it is an agent. The brain class is given as a String. The name argument is used to instantiate the name of the corresponding agent. If the gui flag is true, a bean is created and associated to this agent.


showLine

public void showLine(WorldEntity e,
                     java.awt.Color c)

delete

public void delete()
Delete an entity, and its brain if there is one. Do not ask directly this method.

Overrides:
delete in class SNode

selfDelete

public void selfDelete()

doIt

public void doIt()
The generic activators of entities. If there is brain, this brain is activated via the doIt method.


bodyDoIt

public void bodyDoIt()
The activator of entities which do not have brain


beforeDoIt

public void beforeDoIt()
Method asked before the activation of entities


afterDoIt

public void afterDoIt()
Method asked after the activation of entities


toString

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


Copyright © Madkit Team (O. Gutknecht, J. Ferber, F. Michel et al.) All Rights Reserved.