Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Editable multiline lable with center-aligned text
Editable multiline lable with center-aligned text [message #150666] Mon, 13 September 2004 01:52 Go to next message
Eclipse UserFriend
Originally posted by: seasnake.gmx.li

Hi!

I have an EditPart consiting of a simple rectangle. It should be possible
to create a name for it. What I want to do is similar to the LogicLable,
but the text in the Figure should be placed in the middle of the figure
and it should be possible to make the text multi-line and keep centered.


I would be thankful for any help.

Best regards
Ilja
Re: Editable multiline lable with center-aligned text [message #150719 is a reply to message #150666] Mon, 13 September 2004 16:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Try FlowPage(BlockFlow)#setHorizontalAlignment(CENTER)

"Ilja" <seasnake@gmx.li> wrote in message news:ci2ug4$2au$1@eclipse.org...
> Hi!
>
> I have an EditPart consiting of a simple rectangle. It should be possible
> to create a name for it. What I want to do is similar to the LogicLable,
> but the text in the Figure should be placed in the middle of the figure
> and it should be possible to make the text multi-line and keep centered.
>
>
> I would be thankful for any help.
>
> Best regards
> Ilja
>
Re: Editable multiline lable with center-aligned text [message #150725 is a reply to message #150719] Mon, 13 September 2004 17:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: seasnake.gmx.li

Thank you very much Randy!!! It works fine. The BorderLayout in the parent
figure is responsible for the centered vertical alignment and your
suggestion aligns the FlowPage centered vertical.

Just a remark, when I put a LineBorder around the TextFlow, I get a
feeling that the text is one pixel left shifted, because the vertical line
of the first letter is in the same position as the border line.

Thank you for your fast help.

Best regards
Ilja
Re: Editable multiline lable with center-aligned text [message #150730 is a reply to message #150725] Mon, 13 September 2004 18:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

I'm not sure if inline flow figures like textflow expect to have borders.
You should be able to set the border on the page or other "block" text
figures.

"Ilja" <seasnake@gmx.li> wrote in message news:ci4ju6$rrq$1@eclipse.org...
> Thank you very much Randy!!! It works fine. The BorderLayout in the parent
> figure is responsible for the centered vertical alignment and your
> suggestion aligns the FlowPage centered vertical.
>
> Just a remark, when I put a LineBorder around the TextFlow, I get a
> feeling that the text is one pixel left shifted, because the vertical line
> of the first letter is in the same position as the border line.
>
> Thank you for your fast help.
>
> Best regards
> Ilja
>
Re: Editable multiline lable with center-aligned text [message #150742 is a reply to message #150730] Mon, 13 September 2004 19:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: seasnake.gmx.li

It's not really a problem, but it looks some strange. It happens only with
a certain width of the parent figure (RectangularFigure in my case). My
TextFlow is in a FlowPage and the flow page has horizontal alignment set
to CENTER. As you suggested. The RectangularFigure has an BorderLayout and
the FlowPage is added with CENTER constraint. At some width of my rect
happens following:

Instead of:
|
| E...
|

I see only:

|
E
|

and this looks strange.

I'm not using any borders at all, but if I add a border to my text flow, I
can see it permanently.

Best regards
Ilja
Re: Editable multiline lable with center-aligned text [message #150837 is a reply to message #150742] Tue, 14 September 2004 18:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

RectangleFigure does not expect to have children. None of the shapes change
their client area based on their line thickesses.

Are you using RectangleFigure, or a Figure+LineBorder? Use the latter and
it should work.

"Ilja" <seasnake@gmx.li> wrote in message news:ci4s6s$c6p$1@eclipse.org...
> It's not really a problem, but it looks some strange. It happens only with
> a certain width of the parent figure (RectangularFigure in my case). My
> TextFlow is in a FlowPage and the flow page has horizontal alignment set
> to CENTER. As you suggested. The RectangularFigure has an BorderLayout and
> the FlowPage is added with CENTER constraint. At some width of my rect
> happens following:
>
> Instead of:
> |
> | E...
> |
>
> I see only:
>
> |
> E
> |
>
> and this looks strange.
>
> I'm not using any borders at all, but if I add a border to my text flow, I
> can see it permanently.
>
> Best regards
> Ilja
>
Re: Editable multiline lable with center-aligned text [message #150854 is a reply to message #150837] Tue, 14 September 2004 20:49 Go to previous message
Eclipse UserFriend
Originally posted by: seasnake.gmx.li

Thanks, it works fine!!!

Best regards
Ilja
Previous Topic:CompoundDirectedGraphLayout
Next Topic:Connection clipping current state of the art
Goto Forum:
  


Current Time: Wed Feb 05 06:59:29 GMT 2025

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

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

Back to the top