Skip to main content



      Home
Home » Eclipse Projects » GEF » Gef: how to make some Editparts fixed on screen, even when scrolling ?
Gef: how to make some Editparts fixed on screen, even when scrolling ? [message #132271] Sun, 16 May 2004 08:58 Go to next message
Eclipse UserFriend
Originally posted by: rlemaigr.ulb.ac.be

Hi,

I'm trying to build a graphical editor. I use a =

ScalableFreeformRootEditPart because I need scrolling and zooming. My "t=
op =

editpart" has a FreeformLayer with a FreeformLayout. So when I use the =

scrollbars, all the EditParts move. That works perfectly well.

Here is my problem :

I want that some EditParts:
1) stay always available to the user in such a way that when he uses =

scrollbars to see another portion of the diagram, these EditParts stay =

visible, and always at the same place (in the upper left corner of the =

"screen" in fact). In other words, they should be insensible to scrollin=
g.
2) are always on top of the other EditParts, but below the handle layer =
=

and the feedback layer,
3) are insensible to zooming,
4) don't appear when printing.

I've solve the points 2), 3) and 4) by extending =

ScalableFreeformRootEditPart and by adding a new freeformlayer juste bel=
ow =

the feedback layer and the handle layer. I redefine the method =

registerVisuals() in some EditParts to add them to that layer and it =

works. I've not put any layout manager in my new layer. I just specify t=
he =

location of the EditParts by calling setLocation(). I don't know if it's=
=

important.
This part of the solution seems to work.

But I can't solve the point 1) !

I really don't know how to do that. I've tried many things and some work=
=

but not well.
For example, I've tried listening to the RangeModel of the viewport, or =
to =

the viewport itself to detect scrolling, and when scrolling occurs, I =

relocate the EditParts that should stay fixed. But that don't work well:=
=

for a reason unknown, when I use the scrollbars, the fixed (or should be=
) =

EditParts "tremble". That's some kind of flickering. It's seems like the=
=

EditParts are painted once before their relocation at the good position =
=

(wich causes flickering), and once after the relocation at the good =

position. You may say that it's just a detail but unfortunatly this =

flickering problem it is not acceptable in may case...

If you have any idea on that, even if you're unsure, please tell me so =

that I can try it.

Help would be really appreciated !

Thanks,

rlemaigr

(excuse my english)
Re: Gef: how to make some Editparts fixed on screen, even when scrolling ? [message #132300 is a reply to message #132271] Sun, 16 May 2004 12:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rlemaigr.ulb.ac.be

Now, I think the problem comes from the FigureCanvas and native scrollin=
g.

If it was a draw2d scrolling, I would have add to the figures of the =

"fixed" EditParts an AncestorListener wich listens to the movements of t=
he =

viewport and update the location of the figures if the viewport moves. I=
t =

would have worked fine...

I'm beginning to wondering if there is a solution to this problem...Mayb=
e =

I should find another strategy to "fix" my EditParts but I don't see =

another one...if you see another strategy please tell me...

Please help...:'''(


PS: "I redefine the method registerVisuals() in some EditParts to add th=
em =

to that layer and it works." was a mistake, in fact I redefine =

addChildVisuals() in the parent editpart and not registerVisuals. sorry.=
Re: how to make some Editparts fixed on screen, even when scrolling ? [message #132362 is a reply to message #132271] Mon, 17 May 2004 09:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

You need to do this at a much higher point in the figure hierarchy. Maybe
as a second child of the Viewport figure. However, it wouldn't be between
two layers like you mentioned. What are trying to do? What is the
"overall" problem being solved?

<rlemaigr@ulb.ac.be> wrote in message
news:opr73fn605xn9g2u@xn--pcrgis-dva.mshome.net...
Hi,

I'm trying to build a graphical editor. I use a
ScalableFreeformRootEditPart because I need scrolling and zooming. My "top
editpart" has a FreeformLayer with a FreeformLayout. So when I use the
scrollbars, all the EditParts move. That works perfectly well.

Here is my problem :

I want that some EditParts:
1) stay always available to the user in such a way that when he uses
scrollbars to see another portion of the diagram, these EditParts stay
visible, and always at the same place (in the upper left corner of the
"screen" in fact). In other words, they should be insensible to scrolling.
2) are always on top of the other EditParts, but below the handle layer
and the feedback layer,
3) are insensible to zooming,
4) don't appear when printing.

I've solve the points 2), 3) and 4) by extending
ScalableFreeformRootEditPart and by adding a new freeformlayer juste below
the feedback layer and the handle layer. I redefine the method
registerVisuals() in some EditParts to add them to that layer and it
works. I've not put any layout manager in my new layer. I just specify the
location of the EditParts by calling setLocation(). I don't know if it's
important.
This part of the solution seems to work.

But I can't solve the point 1) !

I really don't know how to do that. I've tried many things and some work
but not well.
For example, I've tried listening to the RangeModel of the viewport, or to
the viewport itself to detect scrolling, and when scrolling occurs, I
relocate the EditParts that should stay fixed. But that don't work well:
for a reason unknown, when I use the scrollbars, the fixed (or should be)
EditParts "tremble". That's some kind of flickering. It's seems like the
EditParts are painted once before their relocation at the good position
(wich causes flickering), and once after the relocation at the good
position. You may say that it's just a detail but unfortunatly this
flickering problem it is not acceptable in may case...

If you have any idea on that, even if you're unsure, please tell me so
that I can try it.

Help would be really appreciated !

Thanks,

rlemaigr

(excuse my english)
Re: how to make some Editparts fixed on screen, even when scrolling ? [message #132400 is a reply to message #132362] Mon, 17 May 2004 11:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rlemaigr.ulb.ac.be

Here is a screen capture of what I'm trying to do:

http://users.skynet.be/mon.mignon.petit.site/capt.gif

This is an editor of some kind of entity-relationship diagram.
For all the diagram, the user can define objects called "representations=
". =

These objects are represented by colored squares.
Once he has defined representations, the user can assign them to the oth=
er =

objects in the diagram (to entities and relations).
(by doing that, the user can define in wich reprentations the entity or =
=

the relation will be present)

I have put all the representations defined for the diagram in an editpar=
t. =

On the screen capture, it is in the upper left corner of the diagram.
The user can expand or reduce this EditPart figure by clicking on the =

little button with the arrow.
The user can drag and drop representations from this EditPart to the oth=
er =

objects in the diagram to assign them to entities and relations.

So my editpart-distributor-of-representations act like some kind of =

palette.


You may ask why I'm not making this editpart a part of the palette, in a=
=

way or the other.
Reason 1 is I have no idea about how I can personnalize the palette that=
=

much and I have no time to learn...but I will if there is no other =

solution...
Reason 2 is I want my distributor of representations to be tightly =

integrated in the diagram. I want source feedbak appears when I drag and=
=

drop the representations, I want handles appear on the representations o=
f =

the distributor when I select them, etc....

So the problem is:
1) to fix my distributor editpart at the upper left corner of the "scree=
n",
2) to make it appear always on top of the other EditParts but below the =
=

handle layer and the feedback layer, because I need feedback and handles=
=

appear on it.

Currently my solution is:
1) to listen to the Viewport to detect when it moves, but this make my =

distributor EditPart "tremble" when scrolling occurs,
2) to add my distributor EditPart in a particular layer, but it makes th=
e =

AbstractGraphicalEditPart class go crazy because one child editpart is n=
ot =

in the content pane of its parent like the other children.

If there is no simple way to do that, I will find another solution but i=
t =

will not be as "cool" as this :)

Thanks for your help and your time,

r=E9gis

ps: the solution of adding a layer below the handle layer and the feedba=
ck =

layer and

On Mon, 17 May 2004 09:37:22 -0400, Randy Hudson <none@us.ibm.com> wrote=
:

> You need to do this at a much higher point in the figure hierarchy. =

> Maybe
> as a second child of the Viewport figure. However, it wouldn't be =

> between
> two layers like you mentioned. What are trying to do? What is the
> "overall" problem being solved?
Re: how to make some Editparts fixed on screen, even when scrolling ? [message #132424 is a reply to message #132400] Mon, 17 May 2004 12:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

I think you are making things harder than necessary. Why not use multiple
Controls and just overlay them one on top of the other. This is how the
palette is done in recent builds of GEF. You can use multiple
GraphicalViewers, and use native Drag-and-Drop between them. The palette
shows how to do this also. You should start by using the PaletteView and
finding out what it doesn't do that you need.


<rlemaigr@ulb.ac.be> wrote in message
news:opr75go2naxn9g2u@xn--pcrgis-dva.mshome.net...
Here is a screen capture of what I'm trying to do:

http://users.skynet.be/mon.mignon.petit.site/capt.gif

This is an editor of some kind of entity-relationship diagram.
For all the diagram, the user can define objects called "representations".
These objects are represented by colored squares.
Once he has defined representations, the user can assign them to the other
objects in the diagram (to entities and relations).
(by doing that, the user can define in wich reprentations the entity or
the relation will be present)

I have put all the representations defined for the diagram in an editpart.
On the screen capture, it is in the upper left corner of the diagram.
The user can expand or reduce this EditPart figure by clicking on the
little button with the arrow.
The user can drag and drop representations from this EditPart to the other
objects in the diagram to assign them to entities and relations.

So my editpart-distributor-of-representations act like some kind of
palette.


You may ask why I'm not making this editpart a part of the palette, in a
way or the other.
Reason 1 is I have no idea about how I can personnalize the palette that
much and I have no time to learn...but I will if there is no other
solution...
Reason 2 is I want my distributor of representations to be tightly
integrated in the diagram. I want source feedbak appears when I drag and
drop the representations, I want handles appear on the representations of
the distributor when I select them, etc....

So the problem is:
1) to fix my distributor editpart at the upper left corner of the "screen",
2) to make it appear always on top of the other EditParts but below the
handle layer and the feedback layer, because I need feedback and handles
appear on it.

Currently my solution is:
1) to listen to the Viewport to detect when it moves, but this make my
distributor EditPart "tremble" when scrolling occurs,
2) to add my distributor EditPart in a particular layer, but it makes the
AbstractGraphicalEditPart class go crazy because one child editpart is not
in the content pane of its parent like the other children.

If there is no simple way to do that, I will find another solution but it
will not be as "cool" as this :)

Thanks for your help and your time,

r
Re: how to make some Editparts fixed on screen, even when scrolling ? [message #132462 is a reply to message #132424] Mon, 17 May 2004 14:01 Go to previous message
Eclipse UserFriend
Originally posted by: rlemaigr.ulb.ac.be

Yeah I have a natural tendancy to complicate things...that's my burden..=
..:D

Placing a second graphical viewer on top of the one with the diagram, or=
=

something like that, and using native drag and drop between them is a go=
od =

idea.
I could place my "distributor editpart" and other useful things in it.
I hadn't think to this. I had forgotten that gef allow the use of multip=
le =

graphical viewers.
Now I have to learn about native drag and drop and hope this is not too =
=

complicated.

Thanks for your help.


On Mon, 17 May 2004 12:55:34 -0400, Randy Hudson <none@us.ibm.com> wrote=
:

> I think you are making things harder than necessary. Why not use =

> multiple
> Controls and just overlay them one on top of the other. This is how t=
he
> palette is done in recent builds of GEF. You can use multiple
> GraphicalViewers, and use native Drag-and-Drop between them. The pale=
tte
> shows how to do this also. You should start by using the PaletteView =
and
> finding out what it doesn't do that you need.
Previous Topic:ConnectionEditPolicy and requests besides DELETE
Next Topic:Layers and Policies
Goto Forum:
  


Current Time: Wed May 21 13:53:20 EDT 2025

Powered by FUDForum. Page generated in 0.05446 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top