Home » Eclipse Projects » GEF » Text filing
Text filing [message #151902] |
Fri, 24 September 2004 08:00 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Antony![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=antonymist%40hotmail.com) Messages: 34 Registered: July 2009 |
Member |
|
|
I'm going mad with this.
Hi guys, if you can solve this I really love you!
The blocks in my diagram are labelled with their name. I used the same
kind of objects of the Logic Labels for this purpose, but the text is not
centered.
Then I created a method in BlockFigure named refreshMarginBorder(), called
by paintFigure(...). This method tries to center the text like this (not
exactly like this, but I make it simple for the sake of understandability):
int left = textFlow.x,
top = textFlow.y,
right = textFlow.width,
bottom = textFlow.height;
return new MarginBorder(left, top, right, bottom);
Of course this method is not correct 'cause it gives a lot of problems.
Then I tried to put some of the variables to a constant value (for
instance, new MarginBorder(left, top, 10, 10)). The result is that the
text is perfectly centered, but direct edit is horrible!
I don't know what else I can do, I even tried to attach a FocusListener to
the TextFlow or the TextPage, but they doesn't seem to notice it.
Ok now, see what can you do with that. Thank you,
Antony
|
|
|
Re: Text filing [message #151912 is a reply to message #151902] |
Fri, 24 September 2004 11:20 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: ellinas_anogia.hotmail.com
First case:
If the problem is that the textFlow isn't centered inside his parent
you must put the follow code when you define the layout for the parent
layout.setMinorAlignment(FlowLayout.ALIGN_CENTER); where layout is
your layout and instead of FlowLayout put your layout type
Second Case:
If the problem is that the text inside the textFlow isn't centered then set
a layout manager to your textFlow ( yourTextFlow.setLayoutmanager(
layout) ) and follow the case 1
"Antony" <antonymist@hotmail.com> wrote in message
news:cj0k6j$f8a$1@eclipse.org...
> I'm going mad with this.
> Hi guys, if you can solve this I really love you!
> The blocks in my diagram are labelled with their name. I used the same
> kind of objects of the Logic Labels for this purpose, but the text is not
> centered.
>
> Then I created a method in BlockFigure named refreshMarginBorder(), called
> by paintFigure(...). This method tries to center the text like this (not
> exactly like this, but I make it simple for the sake of
understandability):
>
> int left = textFlow.x,
> top = textFlow.y,
> right = textFlow.width,
> bottom = textFlow.height;
>
> return new MarginBorder(left, top, right, bottom);
>
> Of course this method is not correct 'cause it gives a lot of problems.
> Then I tried to put some of the variables to a constant value (for
> instance, new MarginBorder(left, top, 10, 10)). The result is that the
> text is perfectly centered, but direct edit is horrible!
> I don't know what else I can do, I even tried to attach a FocusListener to
> the TextFlow or the TextPage, but they doesn't seem to notice it.
>
> Ok now, see what can you do with that. Thank you,
>
> Antony
>
|
|
|
Re: Text filing [message #151955 is a reply to message #151912] |
Fri, 24 September 2004 16:01 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: none.us.ibm.com
Actually, the flow page support centered alignment just call
page.setHorizontalAligment(CENTER)
"Dakanalis" <ellinas_anogia@hotmail.com> wrote in message
news:cj0v4e$568$1@eclipse.org...
> First case:
>
> If the problem is that the textFlow isn't centered inside his parent
> you must put the follow code when you define the layout for the parent
>
> layout.setMinorAlignment(FlowLayout.ALIGN_CENTER); where layout is
> your layout and instead of FlowLayout put your layout type
>
> Second Case:
>
> If the problem is that the text inside the textFlow isn't centered then
set
> a layout manager to your textFlow ( yourTextFlow.setLayoutmanager(
> layout) ) and follow the case 1
>
>
>
>
>
>
>
>
>
>
>
>
> "Antony" <antonymist@hotmail.com> wrote in message
> news:cj0k6j$f8a$1@eclipse.org...
> > I'm going mad with this.
> > Hi guys, if you can solve this I really love you!
> > The blocks in my diagram are labelled with their name. I used the same
> > kind of objects of the Logic Labels for this purpose, but the text is
not
> > centered.
> >
> > Then I created a method in BlockFigure named refreshMarginBorder(),
called
> > by paintFigure(...). This method tries to center the text like this (not
> > exactly like this, but I make it simple for the sake of
> understandability):
> >
> > int left = textFlow.x,
> > top = textFlow.y,
> > right = textFlow.width,
> > bottom = textFlow.height;
> >
> > return new MarginBorder(left, top, right, bottom);
> >
> > Of course this method is not correct 'cause it gives a lot of problems.
> > Then I tried to put some of the variables to a constant value (for
> > instance, new MarginBorder(left, top, 10, 10)). The result is that the
> > text is perfectly centered, but direct edit is horrible!
> > I don't know what else I can do, I even tried to attach a FocusListener
to
> > the TextFlow or the TextPage, but they doesn't seem to notice it.
> >
> > Ok now, see what can you do with that. Thank you,
> >
> > Antony
> >
>
>
|
|
|
Goto Forum:
Current Time: Fri Aug 23 09:37:12 GMT 2024
Powered by FUDForum. Page generated in 0.02826 seconds
|