Rhombus with centered text [message #151286] |
Thu, 16 September 2004 22:51 |
Eclipse User |
|
|
|
Originally posted by: seasnake.gmx.li
Hi,
now I want to draw a rhombus with text centered in bounds of the figure.
Currently I'm using a Polygon with BorderLayout and I'm adding a FlowPage
with BorderLayout.CENTER constraint. Like this:
f.add(flowPage, BorderLayout.CENTER);
This FlowPage has a TextFlow as child and its horizontal alignment is set
to CENTER, too.
There is no problem in displying this figure until the whole figure is
moved. Then the rhombus (Polygon) is moved and the FlowPage stay still in
place. I've solved this problem by creating a new FlowPage each time the
whole figure is moved and adding a new FlowPage again. Like this:
outline.setPoints(vertices);
FlowPage flowPage = new FlowPage();
TextFlow textFlow = new TextFlow();
// adding LayoutManager and text to textFlow here
flowPage.setHorizontalAligment(PositionConstants.CENTER);
flowPage.add(textFlow);
outline.add(flowPage, BorderLayout.CENTER);
Could anyone explain this behavior or make a suggestion how a could solve
this problem in anothor way? I'm asking because there is the same problem
with the CellEditor when I add the direct edit capability to my Edit part.
Thanks in advance!
Best regards
Ilja
|
|
|
Re: Rhombus with centered text [message #151439 is a reply to message #151286] |
Mon, 20 September 2004 14:33 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
Don't use Polygon figure. It is not intended to be used in this way.
"Ilja" <seasnake@gmx.li> wrote in message news:cid5e8$t1j$1@eclipse.org...
> Hi,
>
> now I want to draw a rhombus with text centered in bounds of the figure.
> Currently I'm using a Polygon with BorderLayout and I'm adding a FlowPage
> with BorderLayout.CENTER constraint. Like this:
>
> f.add(flowPage, BorderLayout.CENTER);
>
> This FlowPage has a TextFlow as child and its horizontal alignment is set
> to CENTER, too.
>
> There is no problem in displying this figure until the whole figure is
> moved. Then the rhombus (Polygon) is moved and the FlowPage stay still in
> place. I've solved this problem by creating a new FlowPage each time the
> whole figure is moved and adding a new FlowPage again. Like this:
>
> outline.setPoints(vertices);
>
> FlowPage flowPage = new FlowPage();
> TextFlow textFlow = new TextFlow();
> // adding LayoutManager and text to textFlow here
> flowPage.setHorizontalAligment(PositionConstants.CENTER);
> flowPage.add(textFlow);
>
> outline.add(flowPage, BorderLayout.CENTER);
>
> Could anyone explain this behavior or make a suggestion how a could solve
> this problem in anothor way? I'm asking because there is the same problem
> with the CellEditor when I add the direct edit capability to my Edit part.
>
> Thanks in advance!
>
> Best regards
> Ilja
>
|
|
|
Re: Rhombus with centered text [message #151892 is a reply to message #151439] |
Thu, 23 September 2004 23:23 |
Eclipse User |
|
|
|
Originally posted by: seasnake.gmx.li
Hi Randy,
what should I do? I need a rhombus with a label inside. What would you
suggest?
Additionally I need a rectagele with a rhomubs and a label inside. I
solved the letter problem by putting a rhombus as a child of a Figure with
a XYLayout.
Best regards.
Ilja
|
|
|
|
Powered by
FUDForum. Page generated in 0.03831 seconds