How to get figures seen parts [message #246411] |
Mon, 01 December 2008 14:55 |
Eclipse User |
|
|
|
Originally posted by: michael.jurke.justinmind.com
Hi all,
Is there any whay to find out what part of the figure is seen? I tried
graphics.getClip but if only a part of the figure has to be repainted it
does give a wrong value.
I have the problem having to acutualize some SWT widget on figure change:
Well, with layout listener (zoom+viewport), overriding setBounds() and a
FigureListener (scrolling inside a box with scrolling) everything worked
fine I thought, but when it is inside another box I cannot use
getBounds() to retrieve the bounds :(.
Of course, I could change the boxes to be able to recursively calculate
the intersections but there must be some way to know if a figure is
presented or hidden (outside any parents bounds), and which part is
seen. Any suggestions?
Greetings,
Michael
|
|
|
|
Re: How to get figures seen parts [message #246465 is a reply to message #246425] |
Fri, 05 December 2008 18:00 |
Eclipse User |
|
|
|
Originally posted by: michael.jurke.justinmind.com
Hi Anthony,
Thanks a lot for your answer but I guess you did not understand me well.
I have to set the widget's bounds respectively to the figure's ones and
findFigureAt will not help me in that case.
I solved the problem by iterating through the parents and intersect the
bounds. I just thought there might be already a function doing this but
did not find any.
However, much better it would be to get the non-rectangular region of
the real seen figures shape (overlapped by other figures and cutted by
its parent boxes), but it seems it has to be done manually, too,
substract all siblings on every level :(. Or is there a better solution?
Thanks,
Michael
Anthony Hunter wrote:
> Hi Michael,
>
> Check out the findFigureAt() methods on IFigure. Google to find where it is
> mentioned in the on-line help.
>
> Cheers...
> Anthony
>
> "Michael Jurke" <michael.jurke@justinmind.com> wrote in message
> news:gh0trk$v8d$1@build.eclipse.org...
>> Hi all,
>>
>> Is there any whay to find out what part of the figure is seen? I tried
>> graphics.getClip but if only a part of the figure has to be repainted it
>> does give a wrong value.
>>
>> I have the problem having to acutualize some SWT widget on figure change:
>> Well, with layout listener (zoom+viewport), overriding setBounds() and a
>> FigureListener (scrolling inside a box with scrolling) everything worked
>> fine I thought, but when it is inside another box I cannot use getBounds()
>> to retrieve the bounds :(.
>>
>> Of course, I could change the boxes to be able to recursively calculate
>> the intersections but there must be some way to know if a figure is
>> presented or hidden (outside any parents bounds), and which part is seen.
>> Any suggestions?
>>
>> Greetings,
>> Michael
>>
>
>
|
|
|
Re: How to get figures seen parts [message #246470 is a reply to message #246411] |
Sun, 07 December 2008 14:36 |
Eclipse User |
|
|
|
Originally posted by: shady_86.sify.com
<i>but when it is inside another box I cannot use
getBounds() to retrieve the bounds</i>
here do you mean that when your figure is a child to another figure? and when you try to get bounds you get bounds relative to its parent?
if above is the case then add the bounds of the parent figure with the bounds of child figure.
|
|
|
Powered by
FUDForum. Page generated in 0.03193 seconds