|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.miv.pherd.ntree.NTreeListenerProxy
public class NTreeListenerProxy
Helper class that allows to listen at a n-tree across thread boundaries.
| Field Summary | |
|---|---|
protected org.miv.mbox.MBoxStandalone |
events
The message box used to exchange messages between the two threads. |
protected ArrayList<NTreeListener> |
listeners
The listeners in another thread than this one. |
| Constructor Summary | |
|---|---|
NTreeListenerProxy(NTree tree,
boolean replay)
New listener proxy. |
|
| Method Summary | |
|---|---|
void |
addNTreeListener(NTreeListener listener)
Add a listener to the events of the input particle box. |
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 |
checkEvents()
This method must be called regularly to check if the particle box sent events. |
void |
connect(NTree tree,
boolean replay)
|
void |
disconnect(NTree tree)
|
void |
processMessage(String from,
Object[] data)
|
void |
removeNTReeListener(NTreeListener listener)
Remove a listener. |
protected void |
replayTree(Cell cell)
Recursively replay the n-tree. |
protected void |
replayTree(NTree tree)
Send events for all the cells already in the tree as if these events where generated normally. |
| 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<NTreeListener> listeners
| Constructor Detail |
|---|
public NTreeListenerProxy(NTree tree,
boolean replay)
checkEvents() is called.
tree - The n-tree to listen at.replay - Send events for all the n-tree cells already in the tree ?.| Method Detail |
|---|
public void disconnect(NTree tree)
public void connect(NTree tree,
boolean replay)
protected void replayTree(NTree tree)
tree - The n-tree.protected void replayTree(Cell cell)
cell - The starting cell.public void addNTreeListener(NTreeListener listener)
listener - The listener to call for each event in the input graph.public void removeNTReeListener(NTreeListener 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 cellAdded(Object id,
Object parentId,
Anchor lo,
Anchor hi,
int depth,
int index)
NTreeListener
cellAdded in interface NTreeListenerid - 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.
public void cellData(Object id,
String message,
Object data)
NTreeListener
cellData in interface NTreeListenerid - The cell identifier.message - The message.data - The message data.public void cellRemoved(Object id)
NTreeListener
cellRemoved in interface NTreeListenerid - The cell identifier.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||