[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.modeling.gmf] Re: Center a Label in a Node
|
- From: Cayla Sha <cayla_sha@xxxxxxx>
- Date: Sat, 03 Jan 2009 11:28:59 +0100
- Newsgroups: eclipse.modeling.gmf
- Organization: EclipseCorner
- User-agent: Thunderbird 2.0.0.14 (Windows/20080421)
Hello Cecilia,
sorry for being so late, I don`t know if you still have this problem. I
had the same problem, and now I found a solution. Perhaps this helps
others, too.
I use GridLayout for the figure with this parameters:
GridLayout layoutThis = new GridLayout();
layoutThis.numColumns = 1;
layoutThis.makeColumnsEqualWidth = true;
layoutThis.horizontalSpacing = 0;
layoutThis.verticalSpacing = 0;
layoutThis.marginWidth = 0;
layoutThis.marginHeight = 0;
And for the Label I use this GridLayoutData:
GridData gd = new GridData();
gd.verticalAlignment = GridData.CENTER;
gd.horizontalAlignment = GridData.CENTER;
gd.horizontalIndent = 0;
gd.horizontalSpan = 1;
gd.verticalSpan = 1;
gd.grabExcessHorizontalSpace = true;
gd.grabExcessVerticalSpace = true;
With this parameters the Label is always in the center of the figure.
Best wishes
Julia