| using Polylines in GEF for "normal" Figures, not for connections ? [message #146473] | 
Wed, 04 August 2004 11:22   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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 11:55    | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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 #146621 is a reply to message #146542] | 
Thu, 05 August 2004 10:16   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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.
 |  
 |  
  | 
Powered by 
FUDForum. Page generated in 0.05039 seconds