xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Enklaar <christian.enkl...@mbs-software.de>
Subject AW: Dynamic DOM updates
Date Thu, 20 Mar 2003 09:01:19 GMT
Hi !

I have got some problems with the dynamic update too ...

some general points are that you have to set 
svgCanvas.setDocumentState(JSVGComponent.ALWAYS_DYNAMIC);

and you have to use the updateQueue to get the dynamic updates to be performed

UpdateManager um = this.getUpdateManager();
RunnableQueue rq = um.getUpdateRunnableQueue();
rq.invokeLater( new Runnable( ){
	public void run( ){
      // do your DOM-changes here
	}
});

My problem is that there "sometimes" is no updateManager for my JSVGCanvas allthough the document
is set) and that "sometimes" the updateRunnableQueue is not running when I call invokeLater.
Can I perform several changes in one call of invokeLater or do I have to call it seperately
for every single attribute change (etc.) ?
Is there a good working example for using the updateRunnableQueue - I don't mean one where
the whole document changes but where only some fragments change (like the visibility for example)
?

Greetings,
		Christian.

> -----Ursprüngliche Nachricht-----
> Von: josh [mailto:joshw@speakeasy.net]
> Gesendet: Donnerstag, 20. März 2003 06:41
> An: batik-users@xml.apache.org
> Betreff: Dynamic DOM updates
> 
> 
> Hi!
> 
> I've been crawling through the mail archives and I can't seem 
> to find an 
> answer to my question.  Please forgive me if this has been asked a 
> hojillion times already:
> 
> I'm trying to dynamically control the SVG document through the DOM 
> API.  For instance, say I have a JTextField and when the user 
> types in an 
> id, I do this:
> 
> String id = textfield.getText();
> Element elt = svgdoc.getElementById(id);
> if(elt != null){
>    elt.setAttributeNS(svgns, "visibility", "hidden");
> }
> //...
> 
> There's no errors, but I never see the display update.  I'm 
> using the 1.5b4 
> release.
> 
> Do DOM events not trigger display updates still? I found a 
> message that 
> said so, but it was dated 2001, so I figured maybe some progress had 
> occurred in that area =)
> 
> Thanks again for any help,
> 
> - josh
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Mime
View raw message