|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.miv.pherd.ParticleBoxListenerProxy
public class ParticleBoxListenerProxy
Helper class that allows to listen at a particle box across thread boundaries.
| Field Summary | |
|---|---|
protected org.miv.mbox.MBoxStandalone |
events
The message box used to exchange messages between the two threads. |
protected ArrayList<ParticleBoxListener> |
listeners
The listeners in another thread than this one. |
| Constructor Summary | |
|---|---|
ParticleBoxListenerProxy(ParticleBox box,
boolean replay)
New listener proxy. |
|
| Method Summary | |
|---|---|
void |
addParticleBoxListener(ParticleBoxListener listener)
Add a listener to the events of the input particle box. |
void |
checkEvents()
This method must be called regularly to check if the particle box sent events. |
void |
connect(ParticleBox box,
boolean replay)
|
void |
disconnect(ParticleBox box)
|
void |
particleAdded(Object id,
double x,
double y,
double z)
A new particle appeared at (x,y,z). |
void |
particleAttributeChanged(Object id,
String attribute,
Object newValue,
boolean removed)
One of the particle attributes changed value. |
void |
particleMoved(Object id,
double x,
double y,
double z)
A particle moved. |
void |
particleRemoved(Object id)
A particle disappeared. |
void |
processMessage(String from,
Object[] data)
|
void |
removeParticleBoxListener(ParticleBoxListener listener)
Remove a listener. |
protected void |
replayBox(ParticleBox box)
Send events for all the particles already in the particle box as if these events where generated normally. |
void |
stepFinished(int time)
All particles moved and a new step is about to begin. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected org.miv.mbox.MBoxStandalone events
protected ArrayList<ParticleBoxListener> listeners
| Constructor Detail |
|---|
public ParticleBoxListenerProxy(ParticleBox box,
boolean replay)
checkEvents() is called.
box - The particle box to listen at.replay - Send events for all the particles already in the particle box ?.| Method Detail |
|---|
public void disconnect(ParticleBox box)
public void connect(ParticleBox box,
boolean replay)
protected void replayBox(ParticleBox box)
box - The particle box.public void addParticleBoxListener(ParticleBoxListener listener)
listener - The listener to call for each event in the input graph.public void removeParticleBoxListener(ParticleBoxListener listener)
listener - The listener to remove.public void checkEvents()
public void processMessage(String from,
Object[] data)
processMessage in interface org.miv.mbox.MBoxListener
public void particleAdded(Object id,
double x,
double y,
double z)
ParticleBoxListener
particleAdded in interface ParticleBoxListenerid - The particle unique identifier.x - The particle abscissa.y - The particle ordinate.z - The particle depth.
public void particleAttributeChanged(Object id,
String attribute,
Object newValue,
boolean removed)
ParticleBoxListener
particleAttributeChanged in interface ParticleBoxListenerid - The particle identifier.attribute - The attribute name.newValue - The attribute new value (null if removed).removed - If true the attribute is being removed.
public void particleMoved(Object id,
double x,
double y,
double z)
ParticleBoxListener
particleMoved in interface ParticleBoxListenerid - The particle unique identifier.x - The new abscissa.y - The new ordinate.z - The new depth.public void particleRemoved(Object id)
ParticleBoxListener
particleRemoved in interface ParticleBoxListenerid - The particle unique identifier.public void stepFinished(int time)
ParticleBoxListener
stepFinished in interface ParticleBoxListenertime - The finished step time.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||