A Question Regarding UpdateManager [message #155509] |
Mon, 25 October 2004 22:25 |
Eclipse User |
|
|
|
Originally posted by: zenilnh.infotech.stph.net
Hi,
Got a couple of doubts that i encountered when going through the examples.
Cna somebody please clarify??
1)
While going through the flow example ,I came across the following code,
while(GraphAnimation.step()){
parentFigure.getUpdateManager().performUpdate();
}
What does a peformUpdate() do??When is it used??Instead of the above cant
i call each child figure(of parentFigure) and say repaint()??
2)What is the diffrence b/w calling a figure.revalidate() and
figure.repaint()??
Thanks,
Zenil
|
|
|
Re: A Question Regarding UpdateManager [message #155665 is a reply to message #155509] |
Tue, 26 October 2004 15:03 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
> 1)
> While going through the flow example ,I came across the following code,
>
> while(GraphAnimation.step()){
> parentFigure.getUpdateManager().performUpdate();
> }
> What does a peformUpdate() do??When is it used??Instead of the above cant
This causes an update (layout followed by repaint) synchronously, instead of
deferred. The animation must occur while the UI is blocked to prevent
unexpected changes during the animation. Therefore, waiting for a deferred
layout is not OK.
> i call each child figure(of parentFigure) and say repaint()??
> 2)What is the diffrence b/w calling a figure.revalidate() and
> figure.repaint()??
revalidate() means that the figure hierarchy needs to be validated. For
example, if you change the text for a label, the label now wants to be
bigger, which may cause it's parent to be bigger, etc.
repaint() means that the figure needs to be repainted. For example, the
COLOR has changed.
Often, you need to call both revalidate() and repaint() because even if a
property changes, sometimes nothing moves, and there won't be a repaint
without asking for it.
|
|
|
Re: A Question Regarding UpdateManager [message #155795 is a reply to message #155665] |
Tue, 26 October 2004 23:21 |
Eclipse User |
|
|
|
Originally posted by: zenilnh.infotech.stph.net
Thanks for the clarification.
Zenil
Randy Hudson wrote:
> > 1)
> > While going through the flow example ,I came across the following code,
> >
> > while(GraphAnimation.step()){
> > parentFigure.getUpdateManager().performUpdate();
> > }
> > What does a peformUpdate() do??When is it used??Instead of the above cant
> This causes an update (layout followed by repaint) synchronously, instead of
> deferred. The animation must occur while the UI is blocked to prevent
> unexpected changes during the animation. Therefore, waiting for a deferred
> layout is not OK.
> > i call each child figure(of parentFigure) and say repaint()??
> > 2)What is the diffrence b/w calling a figure.revalidate() and
> > figure.repaint()??
> revalidate() means that the figure hierarchy needs to be validated. For
> example, if you change the text for a label, the label now wants to be
> bigger, which may cause it's parent to be bigger, etc.
> repaint() means that the figure needs to be repainted. For example, the
> COLOR has changed.
> Often, you need to call both revalidate() and repaint() because even if a
> property changes, sometimes nothing moves, and there won't be a repaint
> without asking for it.
|
|
|
Powered by
FUDForum. Page generated in 0.03205 seconds