In my fight with SwingGraphicsNode I'm trying to repaint it (inside JSVGCanvas) after intercepting repaint method call on a swing component. I'm calling fireGraphicsNodeChangeStarted() and fireGraphicsNodeChangeCompleted() in overridden repaint() method but I don't see any results until there is some mouse event sent to JSVGCanvas.
I've found out that UpdateManager must be somehow notified about new changes, but I can't call UpdateManager.repaint() directly because it's protected.


Thus my current solution is:
   public void repaint(long tm, int x, int y, int width, int height) {
       fireGraphicsNodeChangeStarted();
       fireGraphicsNodeChangeCompleted();
       ctx.getUpdateManager().getUpdateRunnableQueue().invokeLater(
           new Runnable() {

             public void run() {
             }
           });
     }
   }

It looks terrible, but it almost works (sometimes the component seems to be not repainted, or repainted too late). I would like to know if there is another proper way to force node to be repainted.

Regards,
Lukasz Matuszczak





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to