logo       

Please help with repaint problem..: msg#00103

Subject: 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.

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


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
boot-loaders.gr...    php.pear.genera...    debugging.valgr...    kde.redhat.user...    text.xml.xsl.ge...    culture.languag...    hardware.microc...    java.servicemix...    redhat.release....    web.zope.plone....    user-groups.lin...    opendarwin.webk...    video.mjpeg.use...    sysutils.bcfg2....    encryption.gpg....    lx-office.devel...    xfree86.forum/2...    mail.mutt.devel...    acpi.devel/2003...    qnx.openqnx.dev...    network.irc.irs...    freebsd.devel.m...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe