There’s no need of continuing this
discussion because the magic of UpdateManager.runWithUpdate(Runnnable) fixed
the problemJ
Thanks,
taki
From: gef-dev-bounces@xxxxxxxxxxx
[mailto:gef-dev-bounces@xxxxxxxxxxx] On
Behalf Of Randy Hudson
Sent: Wednesday, July 27, 2005
3:03 PM
To: GEF development
Subject: Re: [gef-dev] problem
with the size change for DefaultRangeModel
Please continue this discussion on the newsgroup with
the following addional information:
What
are you typing on? A native widget or figures?
Have
you tried using UpdateManager.runWithUpdate(Runnable)? I think this is how we
place the caret. You won't be able to calculate where to place the caret in
notification of validate because the figures have not done their layout yet.
-Randy
"Takahiro Kato"
<Takahiro.Kato@xxxxxxxxxxxxxxxxxxx>
Sent
by: gef-dev-bounces@xxxxxxxxxxx
07/27/2005 05:28 PM
Please
respond to
GEF development
|
|
To
|
<gef-dev@xxxxxxxxxxx>
|
cc
|
|
Subject
|
[gef-dev] problem with the size change for
DefaultRangeModel
|
|
Hi,
I have
been working on the gef’s text sample code to enhance its functionality.
While I was working on scrolling, I have encountered a problem. The
problem is that when a user types a character at the end of a line AND at the
end of the viewport (that means the viewport should ‘move’ to right
so that the typed character gets displayed on the screen), I can’t scroll
the viewport properly. After some debugging, I have found that when I try
to scroll the viewport, the horizontal range model still has the previous size.
I’m using FigureCanvas.scrollToX (int) to do the scrolling.
This method though, checks the size of the horizontal range model, and
returns the max location of the viewport I can set. But at this point,
the range model still contains the size without the new character inserted;
therefore, the viewport is always off by the new character typed.
Here’s
how I’m implementing the scrolling. I have created a class that
implements UpdateListener. This one gets registered to the UpdateManager
and my notifyValidating does all the work (it’s exactly the same work
flow as refreshing the caret). The event gets fired in
DeferredUpdateManager.validateFigures() by the call to fireValidating() method.
But the problem is that the size of the horizontal range model is updated
in IFigure.validate() in DeferredUpdateManager.validateFigures() which occurs
AFTER fireValidating()!
Since
there doesn’t seem to be a way to do anything after IFigure.validate() in
DeferredUpdateManager.validateFigures(), I’m stuck with this problem.
Is this a bug? Shouldn’t the range model updated earlier?
Or is there a workaround that I could use?
BTW, I
have fixed other scrolling and caret location problems.
Thanks
in advance,
Takahiro
Kato_______________________________________________
gef-dev mailing list
gef-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/gef-dev