public class Test extends JFrame implements Runnable,UpdateManagerListener
{
//Put a JSVGCanvas loaded with 22,500 rects with id into a JSVGScrollPane
(600 x 600), etc.
//JSVGCanvas.ALWAYS_DYNAMIC is set.
//Display the frame.
private Random random =new Random();
private Runnable task = new Runnable(){
public void run() {
for(int i=0;i<22500;i++)
{
Element tempE =
jSVGCanvas.getSVGDocument().getElementById(Integer.toString(random.nextInt(22500)));
tempE.setAttributeNS(null, "x",
Integer.toString(random.nextInt(600)));
tempE.setAttributeNS(null, "y",
Integer.toString(random.nextInt(600)));
}
}
};
public void run()
{
jSVGCanvas.getUpdateManager().getUpdateRunnableQueue().invokeLater(task);
}
public void managerStarted(UpdateManagerEvent e)
{
new Thread(this).start();
}
public void updateCompleted(UpdateManagerEvent e)
{
new Thread(this).start();
}
//Other boilerplate code
}
What I am trying to do right now is just to evaluate Batik and find out the
best possible performance, kind of Batik rendering world record:-)
I want to avoid getting stuck in the middle of development in a big project in
the future because of performance issues.