logical zoom [message #195606] |
Mon, 12 September 2005 09:54 |
Eclipse User |
|
|
|
Originally posted by: alnospammajor.noboxspamspoon.com
i'm trying to implement a "logical zoom" in GEF. i.e. when i zoom in on
the diagram, a greater level of detail (more/different model parts) are
available, and when i zoom out, there is less detail but a bigger picture.
the current GEF zoommanager is a graphical zoom which basically shows
the same picture with more or less pixels.
i could re-implement ZoomManager, but it seems like i would then have to
rewrite parts of (essentially replace) ScalableRootEditPart as well
since the ZoomManager is hard wired in.
is there a better way to go?
thanks and regards,
am
|
|
|
Re: logical zoom [message #195621 is a reply to message #195606] |
Mon, 12 September 2005 14:28 |
Eclipse User |
|
|
|
Originally posted by: harsh.ti.com
Unfortunately, there is no better way. That work needs to be done if you
need a "custom" ZoomManager.
As for what you are tring to achieve, I am looking into something similar
as well. What's your email address? Maybe we can share ideas.
Harsh
|
|
|
Re: logical zoom [message #195629 is a reply to message #195606] |
Mon, 12 September 2005 14:28 |
Eclipse User |
|
|
|
Originally posted by: zx.us.ibm.com
Al Major wrote:
> i'm trying to implement a "logical zoom" in GEF. i.e. when i zoom in on
> the diagram, a greater level of detail (more/different model parts) are
> available, and when i zoom out, there is less detail but a bigger picture.
>
> the current GEF zoommanager is a graphical zoom which basically shows
> the same picture with more or less pixels.
>
> i could re-implement ZoomManager, but it seems like i would then have to
> rewrite parts of (essentially replace) ScalableRootEditPart as well
> since the ZoomManager is hard wired in.
>
> is there a better way to go?
>
> thanks and regards,
>
> am
Hrmm, I'd be interested to see if someone actually implements the
zooming aspect of this but to throw my couple cents in... I gave my
models the ability to adapt to personas. I'd have a set list of personas
and then the models would be notified on a change of persona and then
adapt properly to the change (models were responsible for this). It's
not the cleanest implementation, but it works on my end.
It would be cool to combine the animated zooming capabilities found in
one of the GMF contributions with some type of drill down model
capability :)
Cheers,
~ Chris
|
|
|
Re: logical zoom [message #195661 is a reply to message #195606] |
Mon, 12 September 2005 16:08 |
Eclipse User |
|
|
|
Originally posted by: none.unknown.com
How about the EditParts listen to the ZoomManager and change the figure
detail accordingly?
"Al Major" <alnospammajor@noboxspamspoon.com> wrote in message
news:dg3j99$dsj$1@news.eclipse.org...
> i'm trying to implement a "logical zoom" in GEF. i.e. when i zoom in on
> the diagram, a greater level of detail (more/different model parts) are
> available, and when i zoom out, there is less detail but a bigger picture.
>
> the current GEF zoommanager is a graphical zoom which basically shows
> the same picture with more or less pixels.
>
> i could re-implement ZoomManager, but it seems like i would then have to
> rewrite parts of (essentially replace) ScalableRootEditPart as well
> since the ZoomManager is hard wired in.
>
> is there a better way to go?
>
> thanks and regards,
>
> am
|
|
|
Re: logical zoom [message #195711 is a reply to message #195606] |
Tue, 13 September 2005 06:19 |
Eclipse User |
|
|
|
Originally posted by: alnospammajor.noboxspamspoon.com
sounds like the approach i suggested is the way to go. i'll give it a
whirl and see how far it gets me.
i'll report back on my experience when i get a chance.
thx for the responses,
regards,
al
|
|
|
Re: logical zoom [message #195922 is a reply to message #195661] |
Wed, 14 September 2005 13:45 |
Eclipse User |
|
|
|
Originally posted by: wjancz.\/\/asko.pl(change \/\/ with w)
> How about the EditParts listen to the ZoomManager and change the figure
> detail accordingly?
I am exactly doing like this :)
This feature + State Design Pattern = everything what I need to code my
needs :)
I am using a SDP to describe two states of my figures (simple and complex).
Simple one is used in zoom < 100% and complex one is used in zoom >= 100%.
in editpart on propertyChange() listening on zoom property when the zoom is
< 100% i am doing:
figure.setState(SIMPLE)
and when zoom is >= 100%:
figure.setState(COMPLEX)
after refreshVisuals() everything is OK :))))
Pratik & Randy - GEF is GREAT! Thanks!!!!!!!
...::WojT::..
|
|
|
Re: logical zoom [message #195945 is a reply to message #195922] |
Wed, 14 September 2005 14:36 |
Eclipse User |
|
|
|
Originally posted by: zx.us.ibm.com
WojT wrote:
>>How about the EditParts listen to the ZoomManager and change the figure
>>detail accordingly?
>
>
> I am exactly doing like this :)
> This feature + State Design Pattern = everything what I need to code my
> needs :)
>
> I am using a SDP to describe two states of my figures (simple and complex).
> Simple one is used in zoom < 100% and complex one is used in zoom >= 100%.
> in editpart on propertyChange() listening on zoom property when the zoom is
> < 100% i am doing:
> figure.setState(SIMPLE)
> and when zoom is >= 100%:
> figure.setState(COMPLEX)
> after refreshVisuals() everything is OK :))))
>
> Pratik & Randy - GEF is GREAT! Thanks!!!!!!!
>
> ..::WojT::..
>
>
That's kind of clever :) I'm going to play with that.
Cheers,
~ Chris
|
|
|
forcing size recalculations [message #196264 is a reply to message #195606] |
Sat, 17 September 2005 09:51 |
Eclipse User |
|
|
|
Originally posted by: alnospammajor.noboxspamspoon.com
in the process of writing the logical zoom, i've run into a small issue
with cached figure sizes.
when i change the zoom factor, i have to change the size of the
top-level figure, in order to keep all the figures at lower levels in
the correct proportion.
to do this, i need to get the layout managers to lose all the cached
data for the old sizes. i figured out that i need to invalidate the
figure associated with the root edit part. i.e. do a
((ScrollableRootEditPart)getRootEditPart()).getFigure().inva lidateTree();
this will flush the caches, but new sizes now need to be recomputed.
i attempted to do this by calling layout() on the top level composite. i
assumed that this would force everything below it to re-layout with the
new sizes.
unfortunately, this doesn't seem to happen. the only way the sizes are
re-calculated is when the viewer window is physically resized.
how do i force a size recalculation without an actual physical resize?
using a public API?
i'm sure this is not an uncommon problem, so i'm probably just missing
something obvious.
regards,
al
|
|
|
Re: forcing size recalculations [message #196272 is a reply to message #196264] |
Sat, 17 September 2005 10:01 |
Eclipse User |
|
|
|
Originally posted by: alnospammajor.noboxspamspoon.com
duh! it turned out the answer was in a message Pratik posted to a
different thread.
just have to call
validate()
on the root figure.
is this a fantastic newsgroup, or what!
al
|
|
|
Re: logical zoom [message #196781 is a reply to message #195606] |
Tue, 27 September 2005 07:37 |
Eclipse User |
|
|
|
Originally posted by: alnospammajor.noboxspamspoon.com
i finished up the implementation of the logical zoom. as a couple of
people seemed to suggest, the implementation turned out to be
independent of the existing GEF physical zoom. none of the existing zoom
infrastructure was used or touched in any way. if i was using the GEF
rulers, i can see i might have had some issues, so that's the one area
to be wary of.
it boiled down to having figures that draw themselves differently at
different "zoom" levels. so it's very application specific: not the kind
of thing that can be generalized into GEF (at least that i could see).
thanks for all the suggestions.
regards,
al
|
|
|
|
Re: logical zoom [message #196898 is a reply to message #196872] |
Wed, 28 September 2005 04:49 |
Eclipse User |
|
|
|
Originally posted by: alnospammajor.noboxspamspoon.com
harsh, unfortunately there's too much code (mostly non GEF code) to
post. but in any case, it wouldn't help anyone else. as i mentioned, it
is very model specific. the general outline i provided was about all i
could abstract. if you have specific questions, i can try to answer
them. but the short summary is the one that WojT provided earlier in
this thread. the figures know about zoom-levels and draw themselves
differently. exactly what they do will depend on the app. sorry i can't
be more helpful.
regards,
al
Harsh wrote:
> Al,
>
> Do you mind sharing the implementation?
>
> Thank you,
> Harsh
>
|
|
|
Re: logical zoom [message #197189 is a reply to message #195629] |
Fri, 30 September 2005 00:28 |
Eclipse User |
|
|
|
Originally posted by: alnospammajor.noboxspamspoon.com
>
> It would be cool to combine the animated zooming capabilities found in
> one of the GMF contributions with some type of drill down model
> capability :)
>
i was interested in the animation you mentioned. i looked at the GMF
site, but couldn't find any code contributions. is it someplace else?
thx,
al
|
|
|
Powered by
FUDForum. Page generated in 0.03610 seconds