Title: Please help with repaint problem..

Hello -

I sent a mail out before but only got one response.  Somebody's got to know what's going on here....I really need some help.

I'm building an SVG WYSIWYG editor using batik 1.5 with the jdk 1.3.  The user drags SVG shapes onto an SVGCanvas, and can drag, rotate, and scale the shapes.  The code's pretty simple -

       UpdateManager updateManager = bridgeContext.getUpdateManager();
        RunnableQueue runnableQueue = updateManager.getUpdateRunnableQueue();
        try {
            runnableQueue.invokeLater(new Runnable() {
                public void run() {
                   
                    // Sets the translation matrix:
                    AffineTransform translate = AffineTransform.getTranslateInstance(x, y);
                    positionManager.setTranslation(controlNode, translate);
                    PinpointControlUtils.setTransform(controlNode, positionManager.buildMatrix(controlNode));
                   
                    if(selectionManager.isSelected(controlNode))
                        selectionManager.positionSelectionBox(controlNode);
                   
                }
            });
        }
        catch(Exception e) {
            System.err.println("Error setting translate value in control!");
            e.printStackTrace();
        }

.....

  public static void setTransform(Element controlNode, AffineTransform transform) {
       
        double values[] = new double[6];
        transform.getMatrix(values);
        String matrixTransform = SVG_MATRIX_VALUE + "(";
        for(int i = 0; i < values.length - 1; i++) {
            matrixTransform += Double.toString(values[i]) + ", ";
        }
        matrixTransform += Double.toString(values[5]) + ")";
        controlNode.setAttributeNS(null, SVG_TRANSFORM_ATTRIBUTE, matrixTransform);
       
    }


This is the code that gets called when I want to move a shape around on the canvas...it works, but it seems to me that there's an error with the dirty rect caclulations, because when the canvas gets repainted, I see little splotches of the shapes all around the canvas.  I don't know what's going on.  The problem only occurs when repaint is called.

Somebody suggested that perhaps its a size issue, but I am setting the dimension of the SVG to be more than large enough.  While debugging, I've proven that it's the renderer.getOffScreen()  that's causing the problem.  This is the image that's all jumbled up....before repaint is called, I'm assuming the rendering system is only updating the part of the screen that's been changed..but the underlying buffer is not repainted properly. 

Please, I'd appreciate any suggestions or help anybody can offer me.  I've spent a significant amount of time trying to fix this and haven't made any progress.

Thanks,
 Mike Braude



------------------------------------------------------------------------------------------------------------------------------------------------------------

Notice: This e-mail message, together with any attachments, contains information of Andover Controls Corporation and or Andover Controls LTD. which may be confidential, proprietary, copyrighted and/or legally privileged. This Email is intended solely for the use of the individual or entity named on the message. If you are not the intended recipient, and have received this message in error, please immediately return this by e-mail and then delete it.

==============================================================================


Reply via email to