Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » inline/block
inline/block [message #158316] Wed, 17 November 2004 16:34 Go to next message
Eclipse UserFriend
Originally posted by: david_michonneau.hotmail.com

Hi,

I am trying to implement a layout manager that can understand the
inline/block css attributes. It is very similar to a flowlayout except that
the block element take the whole space on their line, and inline elements
can be on the same line with other inline elements. I'm having a problem
with the text:
- how can I have inline text continue on the next line like in html? Figures
have to be inside rectangle, but in that case, that's not a rectangle
anymore, but two rectangles.
- how can I have the flowpage automatically resize the text figure so that
there is no empty space in my text figure? If I set the width hint to -1 it
works, but then it doesn't know about the maximum size so it doesn't wrap
any more...

Thanks,

David
Re: inline/block [message #158334 is a reply to message #158316] Wed, 17 November 2004 18:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Finally, sounds like another person to give us feedback on our Text example.

"David Michonneau" <david_michonneau@hotmail.com> wrote in message
news:cnfuio$4ck$1@www.eclipse.org...
> Hi,
>
> I am trying to implement a layout manager that can understand the
> inline/block css attributes. It is very similar to a flowlayout except
that
> the block element take the whole space on their line, and inline elements
> can be on the same line with other inline elements. I'm having a problem
> with the text:

Have you looked at the draw2d.text package? Specifically, FlowPage,
InlineFlow, and TextFlow.

> - how can I have inline text continue on the next line like in html?
Figures
> have to be inside rectangle, but in that case, that's not a rectangle
> anymore, but two rectangles.

That's fine. There is still a rectangular bounds, but containsPoint(x,y) is
implemented to hit-test the fragments on each line.

> - how can I have the flowpage automatically resize the text figure so that
> there is no empty space in my text figure? If I set the width hint to -1
it

I'm not sure what you mean. You mean if a line does not extend to the right
margin, you want it stretched there anyway? I would imagine this is going
to be useful when hit-testing and placing the caret.

> works, but then it doesn't know about the maximum size so it doesn't wrap
> any more...
>
> Thanks,
>
> David
>
>
Re: inline/block [message #158612 is a reply to message #158334] Thu, 18 November 2004 21:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.none.com

> Finally, sounds like another person to give us feedback on our Text
> example.
>
> "David Michonneau" <david_michonneau@hotmail.com> wrote in message
> news:cnfuio$4ck$1@www.eclipse.org...
>> Hi,
>>
>> I am trying to implement a layout manager that can understand the
>> inline/block css attributes. It is very similar to a flowlayout except
> that
>> the block element take the whole space on their line, and inline elements
>> can be on the same line with other inline elements. I'm having a problem
>> with the text:
>
> Have you looked at the draw2d.text package? Specifically, FlowPage,
> InlineFlow, and TextFlow.

I did, I am actually using them.

>
>> - how can I have inline text continue on the next line like in html?
> Figures
>> have to be inside rectangle, but in that case, that's not a rectangle
>> anymore, but two rectangles.
>
> That's fine. There is still a rectangular bounds, but containsPoint(x,y)
> is
> implemented to hit-test the fragments on each line.
>

Can you explain in further details? What layout should I use, the
paragraphlayout wraps, but not the way I'm interested in. Here is an
example:

"Element 1 Element 1 Element 1 Element 1 Element 1 Element 1 Element 1
Element 1 Element 1 Element 1 Element 1" "Element 2"

If you make your email client window small enough, element 1 will be on two
lines, element 2 will start right after on the same line. How to achieve the
same layout for Element1 and 2 in GEF?

>> - how can I have the flowpage automatically resize the text figure so
>> that
>> there is no empty space in my text figure? If I set the width hint to -1
> it
>
> I'm not sure what you mean. You mean if a line does not extend to the
> right
> margin, you want it stretched there anyway? I would imagine this is going
> to be useful when hit-testing and placing the caret.
>

Ok so what happens is that the main layout gives a widthhint to the flowpage
figure. Then the flowpage figure will use all of it, even it could use a
shorter width because the text is shorter than this width. So my text figure
will take more space than the text itself.

Now if I give a widthhint of -1 it will never wrap, because it doesn't know
when to wrap, since there is no hint to tell.

>> works, but then it doesn't know about the maximum size so it doesn't wrap
>> any more...
>>
>> Thanks,
>>
>> David
>>
>>
>
>
Re: inline/block [message #158976 is a reply to message #158612] Fri, 19 November 2004 18:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

> >
> > Have you looked at the draw2d.text package? Specifically, FlowPage,
> > InlineFlow, and TextFlow.
>
> I did, I am actually using them.
>
> Can you explain in further details? What layout should I use, the
> paragraphlayout wraps, but not the way I'm interested in. Here is an
> example:
>
> "Element 1 Element 1 Element 1 Element 1 Element 1 Element 1 Element 1
> Element 1 Element 1 Element 1 Element 1" "Element 2"

Sounds like a FlowPage, with 2 TextFlows as children.
Re: inline/block [message #159029 is a reply to message #158976] Mon, 22 November 2004 12:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.none.com

">>
>> "Element 1 Element 1 Element 1 Element 1 Element 1 Element 1 Element 1
>> Element 1 Element 1 Element 1 Element 1" "Element 2"
>
> Sounds like a FlowPage, with 2 TextFlows as children.
>

Ok, but Element2 could be something else than text, like an image for
example. And both elements are linked to different EditParts, it means the
FlowPage must be the figure of the parent EditPart. So if the parent must be
a FlowPage, that means all my figures need to be FlowFigures? I looked at
the hierarchy of FlowFigure, it has BlockFlow and InlineFlow as children.
But InlineFlow should not be subclassed, so how can I have inline behaviour
with non-text figures (inline in css means the element can coexist in the
same line with other inline elements and his size is minimal, while a block
element takes the whole space and is always alone on its line)?

Thanks,

David
Re: inline/block [message #159214 is a reply to message #159029] Tue, 23 November 2004 16:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

If you want an image inside a flow, you just create some ImageFlow figure,
or FigureFlow proxy to any generic draw2d Figure. Yes, you must subclass
and violate the warnings. These figures were provided as a preview of what
is upcoming in 3.1. Your subclass will work in 3.0, but may get broken and
require changes in 3.1.

"David Michonneau" <none@none.com> wrote in message
news:cnsna0$v2i$1@www.eclipse.org...
> ">>
> >> "Element 1 Element 1 Element 1 Element 1 Element 1 Element 1 Element 1
> >> Element 1 Element 1 Element 1 Element 1" "Element 2"
> >
> > Sounds like a FlowPage, with 2 TextFlows as children.
> >
>
> Ok, but Element2 could be something else than text, like an image for
> example. And both elements are linked to different EditParts, it means the
> FlowPage must be the figure of the parent EditPart. So if the parent must
be
> a FlowPage, that means all my figures need to be FlowFigures? I looked at
> the hierarchy of FlowFigure, it has BlockFlow and InlineFlow as children.
> But InlineFlow should not be subclassed, so how can I have inline
behaviour
> with non-text figures (inline in css means the element can coexist in the
> same line with other inline elements and his size is minimal, while a
block
> element takes the whole space and is always alone on its line)?
>
> Thanks,
>
> David
>
>
Re: inline/block [message #159549 is a reply to message #159214] Mon, 29 November 2004 11:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.none.com

Ok, when is 3.1 scheduled?

Thanks,

David


"Randy Hudson" <none@us.ibm.com> wrote in message
news:cnvof5$od3$1@www.eclipse.org...
> If you want an image inside a flow, you just create some ImageFlow figure,
> or FigureFlow proxy to any generic draw2d Figure. Yes, you must subclass
> and violate the warnings. These figures were provided as a preview of
> what
> is upcoming in 3.1. Your subclass will work in 3.0, but may get broken
> and
> require changes in 3.1.
>
> "David Michonneau" <none@none.com> wrote in message
> news:cnsna0$v2i$1@www.eclipse.org...
>> ">>
>> >> "Element 1 Element 1 Element 1 Element 1 Element 1 Element 1 Element 1
>> >> Element 1 Element 1 Element 1 Element 1" "Element 2"
>> >
>> > Sounds like a FlowPage, with 2 TextFlows as children.
>> >
>>
>> Ok, but Element2 could be something else than text, like an image for
>> example. And both elements are linked to different EditParts, it means
>> the
>> FlowPage must be the figure of the parent EditPart. So if the parent must
> be
>> a FlowPage, that means all my figures need to be FlowFigures? I looked at
>> the hierarchy of FlowFigure, it has BlockFlow and InlineFlow as children.
>> But InlineFlow should not be subclassed, so how can I have inline
> behaviour
>> with non-text figures (inline in css means the element can coexist in the
>> same line with other inline elements and his size is minimal, while a
> block
>> element takes the whole space and is always alone on its line)?
>>
>> Thanks,
>>
>> David
>>
>>
>
>
Re: inline/block [message #160135 is a reply to message #159549] Thu, 02 December 2004 16:50 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Refer to the platform's 3.1 plan. We follow the same schedule.

"David Michonneau" <none@none.com> wrote in message
news:cof19n$45c$1@www.eclipse.org...
> Ok, when is 3.1 scheduled?
>
> Thanks,
>
> David
>
Previous Topic:draw2d.text indent strategy
Next Topic:Figure
Goto Forum:
  


Current Time: Thu Apr 18 16:49:47 GMT 2024

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

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

Back to the top