Hi Thomas,
> Synchronize can mean many things. I think you mean that you
> don't want the main thread to continue until the runnable in the
> UpdateManager has completed.
Yes. This same thing I want in my application.
> Synchronize can mean many things. I think you mean that you
> don't want the main thread to continue until the runnable in the
> UpdateManager has completed.
Is there any work around to achieve this functionality?
> Please answer this question, or I can't help you: Why do you want
> the swing thread to block until the runnable completes?
Class ExApp extends {
Public void update() {
try {
UpdateManager um = getUpdateManager();
um.getUpdateRunnableQueue().invokeLater(new Runnable() {
public void run() {
render(redraw);
}
});
} catch (Exception ex) {}
}
// render(false) will create the Elements in the SVGDocument
// render(true) will update the Elements in the SVGDocument
// Update will happen only for changed/modified elements. Since I am
having large
// amount elements, updating each element takes long time. So I have added
“isChanged”
// flag to check whether corresponding element to be modified or not. Once
the element is
// updated, the “isChanged” flag has been reset. So while calling “render”
method next
// time, it won’t redraw this element. It will modify based on “isChanged”
flag.
synchronized void render(boolean redraw) {
.
.
.
}
Public static void main(String[] args) {
ExApp app = new ExApp();
// Changing the SVG Elements attributes
.
.
.
app.update(); // --------------------(1)
// Changing the SVG Elements attributes
.
.
.
app.update(); // --------------------(2)
.
.
.
}
}
First “app.update ()” will update/modify the elements’ attributes based on
the “isChanged” flag. Since it is not synchronized with main thread, it will
update and reset the flags based on statements, which are after first
“app.update ()”. So the second “app.update ()” is not updating properly.
Also I need to show the progress bar for completed status. So if it is
“synchronized” with main thread, it would be useful for me to resolve above
problems.
So please give better solutions to resolve my problems.
Thanks,
Sudhakar
--
View this message in context:
http://www.nabble.com/Problem-in-invokeAndWait-tf2124331.html#a5919539
Sent from the Batik - Users forum at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]