I have got the following animator
class that implements Runnable (mentioned in JUNG documentation).
How can tell the thread
, if some condition was true pause
for some time and then start
running?
switch (args[0])
{
case "agent":
int size=nodeAttributes.size();
int i;
for(i=0;i<size;i++)
{
if(args[1].equals(nodeAttributes.get(i).nodeName))
{
VertexCollider vtxCol = new VertexCollider(layout, panel,args[1], args[2] , args[1] , nodeAttributes.get(i));
vtxCol.setMaximumIterations(1000);
vtxCol.setDesiredPrecision(1);
vtxCol.initialize();
Animator animator = new Animator(vtxCol);
animator.start();
if(nodeAttributes.get(i).isMoving)
{
animator.stop();
animator.wait(10000);
System.out.println("stopped");
}
nodeAttributes.get(i).isMoving = true;
break;
}
}
break;
}