Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » using Polylines in GEF for "normal" Figures, not for connections ?
using Polylines in GEF for "normal" Figures, not for connections ? [message #146473] Wed, 04 August 2004 15:22 Go to next message
Eclipse UserFriend
Originally posted by: rlemaigr.ulb.ac.be

Hi,

A friend of mine have to build a GEF editor and asked me to help him sol=
ve =

his problem but
I am not sure about how to do it. So I will explain it to you !

Here is the problem:

In his editor, there are three kinds of model objects and they must be =

represented
as lines, polylines and rectangles. This looks very simple but here is =

what confuses me:

The background figure will be a FreeformLayer and the root editpart will=
be
ScalableFreeformRootEditPart because we will most likely need scrolling =
=

and zooming. In
order to make the scrollbars work properly when elements are moved, I =

assume a layout manager
is needed for the FreeformLayer to calculate the preferred size of the =

diagram or something
like that. So far, in my previous GEF editors, I have only used =

FreeformLayout and that
worked well.

The problem is, this time there is Polylines in the primary layer. So I =
=

don't think I can
use FreeformLayout and Rectangle constraints stored in the model this =

time. The user should
be able to move the polylines (and probably also change their bendpoints=
) =

just like any other
object in the diagram and scrollbars should update accordingly.


Do you have any advice to achieve this goal ?

Any help will be very appreciated,

Thanks in advance,

r=E9gis
Re: using Polylines in GEF for "normal" Figures, not for connections ? [message #146499 is a reply to message #146473] Wed, 04 August 2004 15:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

What about a FreeformLayout which performs an instanceof check to see if the
constraint is a PointList instead of a Rectangle. The only downside is that
Polyline always repaints when you call setPoints() (which allows you to
avoid newing up extra lists), so you'd have to avoid unnecessary calls or
just set points immediately from the layout manager when setConstraint(...)
is called with a poinylist.

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

A friend of mine have to build a GEF editor and asked me to help him solve
his problem but
I am not sure about how to do it. So I will explain it to you !

Here is the problem:

In his editor, there are three kinds of model objects and they must be
represented
as lines, polylines and rectangles. This looks very simple but here is
what confuses me:

The background figure will be a FreeformLayer and the root editpart will be
ScalableFreeformRootEditPart because we will most likely need scrolling
and zooming. In
order to make the scrollbars work properly when elements are moved, I
assume a layout manager
is needed for the FreeformLayer to calculate the preferred size of the
diagram or something
like that. So far, in my previous GEF editors, I have only used
FreeformLayout and that
worked well.

The problem is, this time there is Polylines in the primary layer. So I
don't think I can
use FreeformLayout and Rectangle constraints stored in the model this
time. The user should
be able to move the polylines (and probably also change their bendpoints)
just like any other
object in the diagram and scrollbars should update accordingly.


Do you have any advice to achieve this goal ?

Any help will be very appreciated,

Thanks in advance,

r
Re: using Polylines in GEF for "normal" Figures, not for connections ? [message #146528 is a reply to message #146499] Wed, 04 August 2004 17:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rlemaigr.ulb.ac.be

> What about a FreeformLayout which performs an instanceof check to see =
if =

> the
> constraint is a PointList instead of a Rectangle.

Ok we will try to search in that direction.


> The only downside is that
> Polyline always repaints when you call setPoints() (which allows you t=
o
> avoid newing up extra lists), so you'd have to avoid unnecessary calls=
or
> just set points immediately from the layout manager when =

> setConstraint(...)
> is called with a poinylist.

That makes me wonder if we really need constraints for the polylines...
Shouldn't it be okay to use absolute positionning for their pointlists ?=
=

And
calculate the preferred size based on the current position of the =

pointlists instead
on the constraints ? I mean, instead of calling setConstraint(...) we =

would directly call
setPoints(...) ?

Another question is: do we have to take into account the freeform aspect=
s =

(I don't
understand very well all that) ? How does it influence the code we
have to write ? Anyway, we will try and if we have problems we will post=
=

them.

Thank you very much for your answer !

r=E9gis
Re: using Polylines in GEF for "normal" Figures, not for connections ? [message #146542 is a reply to message #146528] Wed, 04 August 2004 17:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

That's right, you don't need to hold onto the pointlist constraint because
you would be applying it immediately. But, I still think it is better to do
it via setConstraint because this means that invalidate() is called, which
throws out the cached freeformExtent.
Re: using Polylines in GEF for "normal" Figures, not for connections ? [message #146621 is a reply to message #146542] Thu, 05 August 2004 14:16 Go to previous message
Eclipse UserFriend
Originally posted by: rlemaigr.ulb.ac.be

Ok we will try that.
Thank you !

> That's right, you don't need to hold onto the pointlist constraint =

> because
> you would be applying it immediately. But, I still think it is better=
=

> to do
> it via setConstraint because this means that invalidate() is called, =

> which
> throws out the cached freeformExtent.
Previous Topic:Label location with main figure
Next Topic:Automatic scrolling
Goto Forum:
  


Current Time: Fri Apr 26 00:09:24 GMT 2024

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

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

Back to the top