[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.gef] Re: Extending FlowFigure

You want to create a wrapper flow figure capable of wrapping any generic
figure.

This shouldn't be hard.  Create a flowwrapper which when it lays out,
constructs a box with the desired width and height for the normal inner
figure.  If you want the figure to fill up the containing block, you can
request a newline, then get the amount of available space on the newline,
and use that as the box's width.  Then add the box to the current line, and
endline again.  On postlayout, your box will be adjusted (although probably
it won't move since it fills block width), then you just reposition the
wrapped figure to be inside the box.

"David Michonneau" <none@xxxxxxxx> wrote in message
news:conf5d$rfq$1@xxxxxxxxxxxxxxxxxx
> Hi,
>
> I am trying to extend FlowFigure to simulate a flow layout similar to
html,
> where the text could wrap to the next line (like TextFlow does, when
inside
> PageFlow). I need to mix text (inline or block) with other kinds of
controls
> (always block).
>
> I can't afford to have all my figures extend FlowFigure, so instead I
> created a generic class FlowFigureLeaf that derives from FlowFigure and
acts
> as a container of any single Figure. My problem is how to implement this
> FlowFigureLeaf to have its child figure render/layout properly, so far the
> FlowFigure mechanisms remain cryptic and it doesn't work. Any
> hint/suggestion would be welcomed. Do I need a FlowLayoutManager or not?
If
> yes what would it need to do, if not what should the FlowFigureLeaf.layout
> function do? FlowFigureLeaf has only one child, and it's not a FlowFigure,
> but any generic Figure.
>
> Thanks,
>
> David
>
>