* @param lowerGraph the graph to display below it
*/
public void updateFrame(final DirectedSparseGraph g,final DirectedSparseGraph lowerGraph)
{
if (visFrame == null)
visFrame = new Visualiser();
visFrame.update(null, g);
if (lowerGraph != null)
{
try {// I'm assuming here that Swing has only one queue of threads to run on the AWT thread, hence the
// thread scheduled by invokeLater will be run to completion before the next one (below) runs and hence
// I rely on the results of execution of the above thread below in order to position the window.
SwingUtilities.invokeAndWait(new Runnable()
{
public void run()
{
Visualiser v=new Visualiser();v.update(null, lowerGraph);
Point newLoc = visFrame.getLocation();newLoc.move(0, visFrame.getHeight());v.setLocation(newLoc);
}
});
} catch (InterruptedException e) {
// cannot do much about this
e.printStackTrace();