|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.progeeks.graph.swing.SwingGraphSynchronizer
public class SwingGraphSynchronizer
GraphListener that will forward graph changes to another graph. The tricky part is that it does the forwarding on the swing thread thus allowing changes to the souce graph to happen in a background thread. Furthermore, changes are queued up in the background to reduce background->swing message processing. On the swing thread, as many changes as possible are done before relinquishing control. Note: removal of edges is a weird case and so only works when using an ImmutableIdentityEdge based graph as source and target.
Constructor Summary | |
---|---|
SwingGraphSynchronizer()
|
|
SwingGraphSynchronizer(com.phoenixst.plexus.Graph target)
|
Method Summary | |
---|---|
protected void |
addChange(org.progeeks.graph.swing.SwingGraphSynchronizer.GraphChange change)
Adds a change to the queue of changes waiting to be processed by the SwingCommand. |
void |
edgeAdded(com.phoenixst.plexus.GraphEvent event)
|
void |
edgeRemoved(com.phoenixst.plexus.GraphEvent event)
|
protected org.progeeks.graph.swing.SwingGraphSynchronizer.GraphChange[] |
getChanges()
Returns all of the current changes as an array and clears the queue. |
com.phoenixst.plexus.Graph |
getTargetGraph()
|
void |
nodeAdded(com.phoenixst.plexus.GraphEvent event)
|
void |
nodeRemoved(com.phoenixst.plexus.GraphEvent event)
|
void |
setTargetGraph(com.phoenixst.plexus.Graph target)
|
void |
waitForPending()
Waits for all current pending operations to complete. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SwingGraphSynchronizer()
public SwingGraphSynchronizer(com.phoenixst.plexus.Graph target)
Method Detail |
---|
public void waitForPending() throws java.lang.InterruptedException
java.lang.InterruptedException
public void setTargetGraph(com.phoenixst.plexus.Graph target)
public com.phoenixst.plexus.Graph getTargetGraph()
protected void addChange(org.progeeks.graph.swing.SwingGraphSynchronizer.GraphChange change)
protected org.progeeks.graph.swing.SwingGraphSynchronizer.GraphChange[] getChanges()
public void nodeAdded(com.phoenixst.plexus.GraphEvent event)
nodeAdded
in interface com.phoenixst.plexus.GraphListener
public void nodeRemoved(com.phoenixst.plexus.GraphEvent event)
nodeRemoved
in interface com.phoenixst.plexus.GraphListener
public void edgeAdded(com.phoenixst.plexus.GraphEvent event)
edgeAdded
in interface com.phoenixst.plexus.GraphListener
public void edgeRemoved(com.phoenixst.plexus.GraphEvent event)
edgeRemoved
in interface com.phoenixst.plexus.GraphListener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |