|
|
Re: Making Polyline a "normal" figure [message #215681 is a reply to message #215624] |
Mon, 08 May 2006 17:10 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
"Alex Shatalin" <vano@borland.com> wrote in message
news:e3ft1j$384$1@utils.eclipse.org...
> Hello!
> Currently org.eclipse.draw2d.Polyline figure calculate it's bounds
> based on points variable. This behavior make it impossible to layout this
> figure
Right, the bounds are a function of the Points. How could setting the bounds
have any effect if this contract were maintained?
> by any layout manager. AFAIU, this was done intentionally to make it easy
> to visualize connections with this figure
> (https://bugs.eclipse.org/bugs/show_bug.cgi?id=27227,
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=18431). In the same time
> there is a "PolylineConnection" figure which is used for this purposes
> AFAIU. Can we move the functionality which calculates bounds of the
> polyline figure into PolylineConnection figure and make Polyline just a
> normal figure which
Polygon is also relying on this behavior.
> could be layouted and contains _relative_ positions of the points in it?
What you are describing should just be a totally different figure. For lack
of a better unused name, you want a rectangular "label" which displays a
line instead of a string/icon.
>
> --
> Alex Shatalin
>
|
|
|
|
Re: Making Polyline a "normal" figure [message #215733 is a reply to message #215681] |
Tue, 09 May 2006 11:41 |
Alexander Shatalin Messages: 2928 Registered: July 2009 |
Senior Member |
|
|
Hello!
> Right, the bounds are a function of the Points. How could setting the
> bounds have any effect if this contract were maintained?
I'm just suggesting to change this contract and specify relative
coordinates of the points (coordinates inside polyline/polygon figure) and
create subclass (e.g. PolylineConnnection) to support current behavior.
> Polygon is also relying on this behavior.
What about making the same subclass for polygon?
> What you are describing should just be a totally different figure. For
> lack
Yes, I agree. This figure is similar to the current polyline/polygon,
but holds relative coordinates of the points. Imagine, that you are going to
create complex GEF figure with a polyline in it - in this case it sounds
natural to layout this figure in a same way as the rest of the figures.
> of a better unused name, you want a rectangular "label" which displays a
> line instead of a string/icon.
Not a line, but a connected lines (exactly like current implementation
of polyline do ;-)). I'd say that currently existing polyline is
implementing the behavior which I'm looking for and in addition perform some
bounds translation. AFAIU these translations are important for drawing the
connections. Probably this is not the only place where this functionality is
important, but I'm not so deeply know GEF to highlight them.
I suggest to separate these two parts of functionality into two classes
say, PolylineFigure and Polyline extending this PolylineFigure and
overriding all the required methods. Definitely, I have two other options:
1. Create my own figure which will extend current Polyline and override all
the methods which was overridden in Polyline with the code taken from
Figure, but this code will be duplicated..
2. Create my own figure which will extend Figure directly and draw the
polyline in it and duplicate the code from current Polyline figure ;-)
What I'm talking about is introduction of additional Polyline/Polygon
figures into the GEF which will be layouted exactly like normal figures.
--
Alex Shatalin
|
|
|
Re: Making Polyline a "normal" figure [message #215750 is a reply to message #215733] |
Tue, 09 May 2006 13:11 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
What do you want this figure to do if the bounds are set in a way that it
isn't large enough to display the polyline? Should it ignore the
width/height? Should it scale the polyline?
"Alex Shatalin" <vano@borland.com> wrote in message
news:e3pv4o$3fi$1@utils.eclipse.org...
> Hello!
>> Right, the bounds are a function of the Points. How could setting the
>> bounds have any effect if this contract were maintained?
> I'm just suggesting to change this contract and specify relative
> coordinates of the points (coordinates inside polyline/polygon figure) and
> create subclass (e.g. PolylineConnnection) to support current behavior.
>
>> Polygon is also relying on this behavior.
> What about making the same subclass for polygon?
>
>> What you are describing should just be a totally different figure. For
>> lack
> Yes, I agree. This figure is similar to the current polyline/polygon,
> but holds relative coordinates of the points. Imagine, that you are going
> to create complex GEF figure with a polyline in it - in this case it
> sounds natural to layout this figure in a same way as the rest of the
> figures.
>
>> of a better unused name, you want a rectangular "label" which displays a
>> line instead of a string/icon.
> Not a line, but a connected lines (exactly like current implementation
> of polyline do ;-)). I'd say that currently existing polyline is
> implementing the behavior which I'm looking for and in addition perform
> some bounds translation. AFAIU these translations are important for
> drawing the connections. Probably this is not the only place where this
> functionality is important, but I'm not so deeply know GEF to highlight
> them.
> I suggest to separate these two parts of functionality into two classes
> say, PolylineFigure and Polyline extending this PolylineFigure and
> overriding all the required methods. Definitely, I have two other options:
>
> 1. Create my own figure which will extend current Polyline and override
> all the methods which was overridden in Polyline with the code taken from
> Figure, but this code will be duplicated..
> 2. Create my own figure which will extend Figure directly and draw the
> polyline in it and duplicate the code from current Polyline figure ;-)
>
> What I'm talking about is introduction of additional Polyline/Polygon
> figures into the GEF which will be layouted exactly like normal figures.
>
> --
> Alex Shatalin
>
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05757 seconds