How to place Label above Ellipse? [message #633546] |
Mon, 18 October 2010 07:19  |
Eclipse User |
|
|
|
Hello Experts 
I am trying to place a Label above an Ellipse shape, but each time refreshVisuals is called from the EditPart the figure shrinks. My paintFigure method looks like the following:
Rectangle r = this.getBounds().getCopy();
setConstraint(getLabelFigure(), new Rectangle(0, 0, (int)(r.width*0.9), (int)(r.height*0.1)));
getLabelFigure().invalidate();
// ellipse starts where label ends and fill the rest 90% in height and width
setConstraint(getEllipseFigure(), new Rectangle(0, (int)(r.height*0.1), (int)(r.width*0.9), (int)(r.height*0.9)));
getEllipseFigure().invalidate();
It seems that I can't use the constraints in this way, so how do I place the Label figure right above the Ellipse.
I am using normal draw2D label and a normal draw2D Ellipse shape.
Thanks in advantage.
Regards Mikkel
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.64443 seconds