org.miv.pherd
Class ParticleBoxRunner.ParticleBoxListenerAdaptater

java.lang.Object
  extended by org.miv.pherd.ParticleBoxRunner.ParticleBoxListenerAdaptater
All Implemented Interfaces:
NTreeListener, ParticleBoxListener
Enclosing class:
ParticleBoxRunner

public static class ParticleBoxRunner.ParticleBoxListenerAdaptater
extends Object
implements ParticleBoxListener, NTreeListener

This class can listen at the events sent by a particle box and send them to an arbitrary (and eventually remote) message box.

Since:
2007
Author:
Antoine Dutot

Field Summary
protected  String from
          Message sender name.
protected  org.miv.mbox.MBox outbox
          Where to send messages ?.
 
Constructor Summary
ParticleBoxRunner.ParticleBoxListenerAdaptater(org.miv.mbox.MBox outbox, String from)
          New ParticleBox adapter that convert events from the particle box to messages sent into a (eventually remote) message box.
 
Method Summary
 void cellAdded(Object id, Object parentId, Anchor lo, Anchor hi, int depth, int index)
          A new cell appeared.
 void cellData(Object id, String message, Object data)
          The cell data changed.
 void cellRemoved(Object id)
          A cell disappeared.
 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 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

outbox

protected org.miv.mbox.MBox outbox
Where to send messages ?.


from

protected String from
Message sender name.

Constructor Detail

ParticleBoxRunner.ParticleBoxListenerAdaptater

public ParticleBoxRunner.ParticleBoxListenerAdaptater(org.miv.mbox.MBox outbox,
                                                      String from)
New ParticleBox adapter that convert events from the particle box to messages sent into a (eventually remote) message box.

Parameters:
outbox - Where to send particle messages.
from - The name of the sender this object will use to send messages.
Method Detail

particleAdded

public void particleAdded(Object id,
                          double x,
                          double y,
                          double z)
Description copied from interface: ParticleBoxListener
A new particle appeared at (x,y,z).

Specified by:
particleAdded in interface ParticleBoxListener
Parameters:
id - The particle unique identifier.
x - The particle abscissa.
y - The particle ordinate.
z - The particle depth.

particleMoved

public void particleMoved(Object id,
                          double x,
                          double y,
                          double z)
Description copied from interface: ParticleBoxListener
A particle moved.

Specified by:
particleMoved in interface ParticleBoxListener
Parameters:
id - The particle unique identifier.
x - The new abscissa.
y - The new ordinate.
z - The new depth.

particleRemoved

public void particleRemoved(Object id)
Description copied from interface: ParticleBoxListener
A particle disappeared.

Specified by:
particleRemoved in interface ParticleBoxListener
Parameters:
id - The particle unique identifier.

particleAttributeChanged

public void particleAttributeChanged(Object id,
                                     String attribute,
                                     Object newValue,
                                     boolean removed)
Description copied from interface: ParticleBoxListener
One of the particle attributes changed value.

Specified by:
particleAttributeChanged in interface ParticleBoxListener
Parameters:
id - The particle identifier.
attribute - The attribute name.
newValue - The attribute new value (null if removed).
removed - If true the attribute is being removed.

stepFinished

public void stepFinished(int time)
Description copied from interface: ParticleBoxListener
All particles moved and a new step is about to begin.

Specified by:
stepFinished in interface ParticleBoxListener
Parameters:
time - The finished step time.

cellAdded

public void cellAdded(Object id,
                      Object parentId,
                      Anchor lo,
                      Anchor hi,
                      int depth,
                      int index)
Description copied from interface: NTreeListener
A new cell appeared.

Specified by:
cellAdded in interface NTreeListener
Parameters:
id - The cell identifier.
parentId - The parent cell identifier.
lo - The cell space lowest point.
hi - The cell space highest point.
index - The cell index in its parent cell.

cellRemoved

public void cellRemoved(Object id)
Description copied from interface: NTreeListener
A cell disappeared.

Specified by:
cellRemoved in interface NTreeListener
Parameters:
id - The cell identifier.

cellData

public void cellData(Object id,
                     String message,
                     Object data)
Description copied from interface: NTreeListener
The cell data changed. This method is here to allow cell data to send arbitrary messages to the listeners.

Specified by:
cellData in interface NTreeListener
Parameters:
id - The cell identifier.
message - The message.
data - The message data.


Copyright © 2011. All Rights Reserved.