本文整理匯總了Java中org.eclipse.draw2d.Label.setLabelAlignment方法的典型用法代碼示例。如果您正苦於以下問題:Java Label.setLabelAlignment方法的具體用法?Java Label.setLabelAlignment怎麽用?Java Label.setLabelAlignment使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.draw2d.Label
的用法示例。
在下文中一共展示了Label.setLabelAlignment方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: Position
import org.eclipse.draw2d.Label; //導入方法依賴的package包/類
public Position(Integer index) {
int width = POSITION_WIDTH;
if(model.isDecimal())
width *= 2;
GridData layoutData = new GridData(width, POSITION_WIDTH+20);
arrayLayout.setConstraint(this, layoutData);
GridLayout layout = Constants.getOneColGridLayout();
setLayoutManager(layout);
if(index != null) {
IValueModel m = model.getElementModel(index);
valueLabel = new ValueLabel(m);
layout.setConstraint(valueLabel, new GridData(width, POSITION_WIDTH));
add(valueLabel);
}else {
Label emptyLabel = new Label("...");
FontManager.setFont(this, Constants.VALUE_FONT_SIZE);
IValueModel measure = model.getElementModel(model.getLength() - 1);
setSize(measure.isDecimal() || measure.isBoolean() ? Constants.POSITION_WIDTH*2 : Constants.POSITION_WIDTH, Constants.POSITION_WIDTH);
layout.setConstraint(emptyLabel, new GridData(width, POSITION_WIDTH));
add(emptyLabel);
}
indexLabel = new Label(index == null ? "..." : Integer.toString(index));
FontManager.setFont(indexLabel, INDEX_FONT_SIZE);
indexLabel.setLabelAlignment(SWT.CENTER);
indexLabel.setForegroundColor(ColorConstants.gray);
layout.setConstraint(indexLabel, layoutCenter);
add(indexLabel);
}