public class IAgent extends IObject implements IDynamics
Modifier and Type | Field and Description |
---|---|
boolean |
alive |
int |
duration |
boolean |
interactOverridden
check if a child class overrides void interact(IDynamics) or not
|
java.util.ArrayList<IDynamics> |
localDynamics |
IObject |
parent |
java.util.ArrayList<IObject> |
targets
target objects to be updated by dynamic object
|
int |
time |
Modifier and Type | Method and Description |
---|---|
void |
addDynamics(IDynamics dyna)
override IObject.addDynamics to manage dynamics locally.
|
boolean |
alive() |
IAgent |
clr(double dgray) |
IAgent |
clr(double dgray,
double dalpha) |
IAgent |
clr(double dr,
double dg,
double db) |
IAgent |
clr(double dr,
double dg,
double db,
double da) |
IAgent |
clr(float fgray) |
IAgent |
clr(float fgray,
float falpha) |
IAgent |
clr(float fr,
float fg,
float fb) |
IAgent |
clr(float fr,
float fg,
float fb,
float fa) |
IAgent |
clr(IColor c)
to set an object color
|
IAgent |
clr(IColor c,
double alpha)
to set color, with alpha value overwritten
|
IAgent |
clr(IColor c,
float alpha)
to set color, with alpha value overwritten
|
IAgent |
clr(IColor c,
int alpha)
to set color, with alpha value overwritten
|
IAgent |
clr(int gray) |
IAgent |
clr(int gray,
int alpha) |
IAgent |
clr(int r,
int g,
int b) |
IAgent |
clr(int r,
int g,
int b,
int a) |
IAgent |
clr(IObject o)
to set the same color with the object
|
void |
del()
delete agent and stop it by removing it from dynamics server
|
void |
del(boolean deleteGeometry)
stop agent with option of deleting/keeping the geometry the agent owns
|
void |
deletDynamics(int index) |
void |
deleteDynamics() |
void |
deleteDynamics(IDynamics dyn) |
int |
duration() |
IAgent |
duration(int dur) |
int |
dynamicsNum() |
IDynamics |
getDynamics(int i) |
IAgent |
hide() |
IAgent |
hsb(double h,
double s,
double b) |
IAgent |
hsb(double h,
double s,
double b,
double a) |
IAgent |
hsb(float h,
float s,
float b) |
IAgent |
hsb(float h,
float s,
float b,
float a) |
void |
initAgent() |
void |
interact(java.util.ArrayList<IDynamics> agents)
behavior definition of interaction with other dynamic objects.
|
void |
interact(IDynamics agent) |
IAgent |
layer(ILayer l)
Set layer by ILayer object
|
java.util.ArrayList<IDynamics> |
localDynamics()
local dynamics are updated by IDynamics server too but not show up in interact's argument.
|
IAgent |
name(java.lang.String nm)
methods of IObject
|
IObject |
parent()
getting parent object
|
ISubobject |
parent(IObject par)
setting parent object
|
void |
postinteract(java.util.ArrayList<IDynamics> agents)
executed after interact(ArrayList
|
void |
postupdate()
executed after update().
|
void |
preinteract(java.util.ArrayList<IDynamics> agents)
executed before interact(ArrayList
|
void |
preupdate()
executed before update().
|
IAgent |
removeTarget(int i)
remove target object.
|
IAgent |
removeTarget(IObject obj)
remove target object.
|
IAgent |
setColor(double dgray) |
IAgent |
setColor(double dgray,
double dalpha) |
IAgent |
setColor(double dr,
double dg,
double db) |
IAgent |
setColor(double dr,
double dg,
double db,
double da) |
IAgent |
setColor(float fgray) |
IAgent |
setColor(float fgray,
float falpha) |
IAgent |
setColor(float fr,
float fg,
float fb) |
IAgent |
setColor(float fr,
float fg,
float fb,
float fa) |
IAgent |
setColor(IColor c) |
IAgent |
setColor(IColor c,
double alpha) |
IAgent |
setColor(IColor c,
float alpha) |
IAgent |
setColor(IColor c,
int alpha) |
IAgent |
setColor(int gray) |
IAgent |
setColor(int gray,
int alpha) |
IAgent |
setColor(int r,
int g,
int b) |
IAgent |
setColor(int r,
int g,
int b,
int a) |
IAgent |
setHSBColor(double h,
double s,
double b) |
IAgent |
setHSBColor(double h,
double s,
double b,
double a) |
IAgent |
setHSBColor(float h,
float s,
float b) |
IAgent |
setHSBColor(float h,
float s,
float b,
float a) |
IAgent |
show() |
IObject |
target(int i)
get target object.
|
IAgent |
target(IObject targetObj)
add terget object to be updated by this dynamic object.
|
int |
targetNum()
get total target number.
|
java.util.ArrayList<IObject> |
targets()
get all target objects.
|
int |
time() |
IAgent |
time(int tm)
not recommended to use.
|
void |
update()
behavior definition of updating dynamics in each time frame
|
void |
updateGraphic()
update graphic when control point location changes or some minor change.
|
void |
updateTarget()
update all terget objects (should be called when the dynamic object is updated).
|
IAgent |
weight(double w) |
IAgent |
weight(float w) |
addUserData, addUserData, alpha, alphaInt, attr, attr, attr, awtColor, blue, blueInt, brightness, castStringHashMap, clearDynamics, clearGraphics, clr, clr, clr, clr, clr, cp, createGraphic, defaultAttribute, deleteGraphic, dup, getAWTColor, getColor, getGraphic, getGraphic, getParameter, graphicsNum, gray, grayInt, green, greenInt, grey, greyInt, hue, initGraphic, initObject, isValid, isVisible, layer, layer, name, red, redInt, resetGraphic, saturation, server, setColor, setColor, setColor, setColor, setParameter, setTexture, syncColor, syncGraphic, syncVisibility, syncWeight, texture, userData, userData, userData, userDataNum, visible, weight
public IObject parent
public java.util.ArrayList<IObject> targets
public java.util.ArrayList<IDynamics> localDynamics
public int time
public int duration
public boolean alive
public boolean interactOverridden
public IAgent()
public IAgent(IObject parent)
public void initAgent()
public void addDynamics(IDynamics dyna)
addDynamics
in class IObject
public IDynamics getDynamics(int i)
getDynamics
in class IObject
public int dynamicsNum()
dynamicsNum
in class IObject
public void deleteDynamics()
deleteDynamics
in class IObject
public void deletDynamics(int index)
deletDynamics
in class IObject
public void deleteDynamics(IDynamics dyn)
deleteDynamics
in class IObject
public void del()
public void del(boolean deleteGeometry)
public void updateGraphic()
IObject
updateGraphic
in class IObject
public IObject parent()
ISubobject
parent
in interface ISubobject
public ISubobject parent(IObject par)
ISubobject
parent
in interface ISubobject
public java.util.ArrayList<IDynamics> localDynamics()
localDynamics
in interface IDynamics
public IAgent target(IObject targetObj)
public int targetNum()
public java.util.ArrayList<IObject> targets()
public IAgent removeTarget(int i)
removeTarget
in interface IDynamics
public IAgent removeTarget(IObject obj)
removeTarget
in interface IDynamics
public void updateTarget()
updateTarget
in interface IDynamics
public boolean alive()
public int time()
public IAgent time(int tm)
public int duration()
public IAgent duration(int dur)
public void preinteract(java.util.ArrayList<IDynamics> agents)
IDynamics
preinteract
in interface IDynamics
public void interact(java.util.ArrayList<IDynamics> agents)
IDynamics
public void interact(IDynamics agent)
public void postinteract(java.util.ArrayList<IDynamics> agents)
IDynamics
postinteract
in interface IDynamics
public void preupdate()
IDynamics
public void update()
IDynamics
public void postupdate()
IDynamics
postupdate
in interface IDynamics
public IAgent layer(ILayer l)
IObject
public IAgent clr(IColor c, int alpha)
IObject
public IAgent clr(IColor c, float alpha)
IObject
public IAgent clr(IColor c, double alpha)
IObject
public IAgent clr(IObject o)
IObject
public IAgent setColor(double dr, double dg, double db)
public IAgent setColor(float fr, float fg, float fb, float fa)
public IAgent setColor(double dr, double dg, double db, double da)
public IAgent setHSBColor(float h, float s, float b, float a)
setHSBColor
in class IObject
public IAgent setHSBColor(double h, double s, double b, double a)
setHSBColor
in class IObject
public IAgent setHSBColor(float h, float s, float b)
setHSBColor
in class IObject
public IAgent setHSBColor(double h, double s, double b)
setHSBColor
in class IObject