Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » problem with flowLayoutEditPolicy
problem with flowLayoutEditPolicy [message #89514] Thu, 31 July 2003 15:26 Go to next message
Eclipse UserFriend
Originally posted by: brian.fernandes.codito.com

For one of my objects, I'm using a flowLayoutEditPolicy.

So far I've overridden the getCreateCommand similar to that in
LogicFlowEditPolicy.

What I need is to position my children objects such that they are within the
parent. (obviously) So am I supposed to get the location of the parent and
then position the child ? Should I do this in the createFigure of the
childrens edit parts ? What about the repositioning of the other edit parts
? or is it that everytime an element gets added, we go call refreshVisuals
which goes through all the children and repositions them according to their
indices ? (would there be a problem accomodating objects of different sizes
here ? )


Flow layout is supposed to detect the index automatically, so how does it
manage this ? If I manage to position the child object properly, just using
createFigure, is that enough for the edit policy ? Also, the marker that
needs to be drawn is being drawn at the top left corner of the screen (a
short thick diagonal line), irrespective of where the object (which has the
flowLayoutEditPolicy) is being drawn.
This seems to indicate that I'm doing something wrong with this object... or
with the children perhaps ?

Thanks,
Brian.
Re: problem with flowLayoutEditPolicy [message #89530 is a reply to message #89514] Thu, 31 July 2003 18:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

FlowLayoutEditPolicy should be used with either FlowLayout or ToolbarLayout.
In both cases, you never call setBounds() on a figure, only the layout does
this.

"Brian Fernandes" <brian.fernandes@codito.com> wrote in message
news:bgbep2$6ji$1@eclipse.org...
> For one of my objects, I'm using a flowLayoutEditPolicy.
>
> So far I've overridden the getCreateCommand similar to that in
> LogicFlowEditPolicy.
>
> What I need is to position my children objects such that they are within
the
> parent. (obviously) So am I supposed to get the location of the parent and
> then position the child ? Should I do this in the createFigure of the
> childrens edit parts ? What about the repositioning of the other edit
parts
> ? or is it that everytime an element gets added, we go call refreshVisuals
> which goes through all the children and repositions them according to
their
> indices ? (would there be a problem accomodating objects of different
sizes
> here ? )
>
>
> Flow layout is supposed to detect the index automatically, so how does it
> manage this ? If I manage to position the child object properly, just
using
> createFigure, is that enough for the edit policy ? Also, the marker that
> needs to be drawn is being drawn at the top left corner of the screen (a
> short thick diagonal line), irrespective of where the object (which has
the
> flowLayoutEditPolicy) is being drawn.
> This seems to indicate that I'm doing something wrong with this object...
or
> with the children perhaps ?
>
> Thanks,
> Brian.
>
>
>
>
>
>
>
>
>
>
>
Re: problem with flowLayoutEditPolicy [message #89560 is a reply to message #89514] Fri, 01 August 2003 13:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: brian.fernandes.codito.com

I've got the flowlayoutworking, I wasn't setting the layout of the container
figure to flowLayout.

I wanted the parent to expand to the size of it's children, so I set it's
size to -1,-1.. then it uses the preferred size. However, I had to override
getpreferred size in the figure, so that initially if the figure had no
children, it would not appear as a single black dot. Is that correct ?

I'm setting the alignment of the layout to CENTER for both Major or minor
axes. However it does not seem to layout properly along the minor axis. I'm
using a vertical flow and the children align vertically, but not
horizontally. They appear stuck to the left of the container. I went throug
the flow layout code, and it seemed to be because of this.

minorAdjustment = data.rowHeight - data.bounds[j].height;

Below I'm talking according to the code (which transposes the dimensions)
Now data.rowHeight is set to the maximum height in the layout() method. As a
result, if all my elements are of the same height, say 40, then
minorAdjustment becomes 0. So they don't get aligned at all.

Is it necessary for me to introduce a dummy object or somethign that has a
height (rather width) equal to that of the container for it to align
properly ?



Thanks,

Brian.
Re: problem with flowLayoutEditPolicy [message #172992 is a reply to message #89530] Tue, 22 March 2005 14:50 Go to previous messageGo to next message
Hao Zhang is currently offline Hao ZhangFriend
Messages: 161
Registered: July 2009
Senior Member
Hello Randy:
I want to use FlowLayoutEditPolicy with ToolbarLayout, but it throws a
ClassCastException. I have to override isHorizontal() to avoid this, now it
works fine. I wonder if it it the proper way.

Regards
Hao


"Randy Hudson" <none@us.ibm.com> д
Re: problem with flowLayoutEditPolicy [message #173030 is a reply to message #172992] Tue, 22 March 2005 15:27 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Open a feature request. These two layout could implement a common interface
used by the editpolicy.

"Hao Zhang" <bjzhanghao@21cn.com> wrote in message
news:d1pge6$u2e$1@news.eclipse.org...
> Hello Randy:
> I want to use FlowLayoutEditPolicy with ToolbarLayout, but it throws a
> ClassCastException. I have to override isHorizontal() to avoid this, now
> it
> works fine. I wonder if it it the proper way.
>
> Regards
> Hao
>
>
> "Randy Hudson" <none@us.ibm.com> д
Previous Topic:editor background color
Next Topic:IndexOutOfBoundsException in
Goto Forum:
  


Current Time: Fri Apr 26 23:35:15 GMT 2024

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

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

Back to the top