Skip to main content



      Home
Home » Eclipse Projects » GEF » draw2d.text Questions
draw2d.text Questions [message #77963] Tue, 06 May 2003 07:22 Go to next message
Eclipse UserFriend
I looked into the draw2d text package whether to use it to layout some
HTML-like documents in SWT. It looks very easy to use but before I
start to implement stuff that already exist, here are my questions:

Is there a way to indent paragraphs?

And what's about enumerations, that is, my first line of a paragraph
needs a different indent than the rest.

I also need to inline images. It looks like I can't simply add a normal
figure to a FlowFigure, so I probably need to disguise a figure as a
FlowFigure somehow. I was thinking about creating a FigureFlow parallel
to the TextFlow class. That would allow to embed figure - especially
buttons, input fields etc.

Last but not least, I'd like to add borders to certain paragraphs.
While this looks simple at first, I didn't find a good way to add the
additional padding. The way the sizing and layout is done is still not
clear to me.

It also kind of bothers me, that each FlowFigures gets its default
layout instantiated and assigned while I probably most often need to
replace that default layout because it doesn't know about borders,
indents and paddings. I hate to create garbage objects :-) Perhaps
there should be a second constructor that passes the correct layout.

At the same time, the documentation forbids BOTH to subclass TextFlow or
other concrete classes and their associated layout classes.

What shall I do?


bye
--
Stefan Matthias Aust //
www.3plus4software.de // Inter Deum Et Diabolum Semper Musica Est
Re: draw2d.text Questions [message #78061 is a reply to message #77963] Tue, 06 May 2003 15:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

There is another implementation of the text figures used internally to
implement IBM's Page Designer. Obviously supporting all of CSS2 requires a
lot of work. There are no plans to open-source that code, nor is it clear
whether that code is generic and could be used for non-HTML. However, the
authors are on the gef-dev mailing list and might answer your questions.
Ideally, the draw2d.text package will mature and be able to render HTML or
WYSIWYG text. Currently its purpose is to be the minimal amount of support
needed to display the GEF Palette, so the answer to most of your questions
is no.

Would you be interested in working on these classes and layouts so that they
do respect borders, etc.? There is lots to be done, such as margins, inline
borders, line-break code, tables, etc.

"Stefan Matthias Aust" <sma@3plus4.de> wrote in message
news:b985ps$f1$1@rogue.oti.com...
> I looked into the draw2d text package whether to use it to layout some
> HTML-like documents in SWT. It looks very easy to use but before I
> start to implement stuff that already exist, here are my questions:

> Is there a way to indent paragraphs?
>
> And what's about enumerations, that is, my first line of a paragraph
> needs a different indent than the rest.
>
> I also need to inline images. It looks like I can't simply add a normal
> figure to a FlowFigure, so I probably need to disguise a figure as a
> FlowFigure somehow. I was thinking about creating a FigureFlow parallel
> to the TextFlow class. That would allow to embed figure - especially
> buttons, input fields etc.
>
> Last but not least, I'd like to add borders to certain paragraphs.
> While this looks simple at first, I didn't find a good way to add the
> additional padding. The way the sizing and layout is done is still not
> clear to me.
>
> It also kind of bothers me, that each FlowFigures gets its default
> layout instantiated and assigned while I probably most often need to
> replace that default layout because it doesn't know about borders,
> indents and paddings. I hate to create garbage objects :-) Perhaps
> there should be a second constructor that passes the correct layout.
>
> At the same time, the documentation forbids BOTH to subclass TextFlow or
> other concrete classes and their associated layout classes.
>
> What shall I do?

How about contributing to the implementation of these classes?
>
> bye
> --
> Stefan Matthias Aust //
> www.3plus4software.de // Inter Deum Et Diabolum Semper Musica Est
>
Re: draw2d.text Questions [message #78268 is a reply to message #78061] Wed, 07 May 2003 06:05 Go to previous messageGo to next message
Eclipse UserFriend
Randy Hudson wrote:

> Ideally, the draw2d.text package will mature and be able to render HTML or
> WYSIWYG text. Currently its purpose is to be the minimal amount of support
> needed to display the GEF Palette, so the answer to most of your questions
> is no.

Okay.

> Would you be interested in working on these classes and layouts so that they
> do respect borders, etc.? There is lots to be done, such as margins, inline
> borders, line-break code, tables, etc.

My first priority is to make my stuff work but yes, I'm willing to help
to improve the code.

I already created a FigureFlow class which I can donate that can show
inline figures (which cannot yet receive events so they're still passive
images) and I'm working on implementing borders and insets right now.

My idea was to implement indentation and enumerations with special
Border subclasses. However, I'm still trying to understand the inner
workings of draw2d and the text classes so progress is slow.

It seems that the PageFlow (arg, no, it's called FlowPage but has a
PageFlowLayout...) already correctly supports Borders. The BlockFlow
also expands its bounds by its insets in postValidate() but still - it
doesn't work. The border is painted outside the bounds and/or the
bounds are modified in a wrong way.


bye
--
Stefan Matthias Aust //
www.3plus4software.de // Inter Deum Et Diabolum Semper Musica Est
Re: draw2d.text Questions [message #78283 is a reply to message #78268] Wed, 07 May 2003 07:31 Go to previous messageGo to next message
Eclipse UserFriend
I think, I fixed the border issue (at least found a workaround) but it
seems there's word wrapping problem now. getTextForSpace() doesn't find
the best break but breaks too early, leaving a too large right margin.
Is this a known problem?


bye
--
Stefan Matthias Aust //
www.3plus4software.de // Inter Deum Et Diabolum Semper Musica Est
Re: draw2d.text Questions [message #78311 is a reply to message #78283] Wed, 07 May 2003 09:53 Go to previous messageGo to next message
Eclipse UserFriend
Stefan Matthias Aust wrote:
> I think, I fixed the border issue (at least found a workaround) but it
> seems there's word wrapping problem now. getTextForSpace() doesn't find
> the best break but breaks too early, leaving a too large right margin.
> Is this a known problem?

This was fixed and released into CVS yesterday.
Re: draw2d.text Questions [message #78415 is a reply to message #78311] Wed, 07 May 2003 13:57 Go to previous message
Eclipse UserFriend
Eric Bordeau wrote:

> Stefan Matthias Aust wrote:
>
>> I think, I fixed the border issue (at least found a workaround) but it
>> seems there's word wrapping problem now. getTextForSpace() doesn't
>> find the best break but breaks too early, leaving a too large right
>> margin. Is this a known problem?

> This was fixed and released into CVS yesterday.

Good to know. I just spend some time to fix that myself. Perhaps I
should use the CVS version for my work...


bye
--
Stefan Matthias Aust //
www.3plus4software.de // Inter Deum Et Diabolum Semper Musica Est
Previous Topic:draw2d.text
Next Topic:Re: Bug in AbstractTool.viewerEntered()/Exited()?
Goto Forum:
  


Current Time: Mon Jun 09 18:38:21 EDT 2025

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

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

Back to the top