protected int addLabelBox( String text, int xPos, int yPos, int labelWidth, int labelHeight,
int fontSize, float scaleFactor ) {
Box labelBox = ModelFactory.eINSTANCE.createBox();
labelBox.setSize(new Dimension(labelWidth, labelHeight));
labelBox.setLocation(new Point(xPos, yPos));
LabelBoxPrinter labelBoxPrinter = new LabelBoxPrinter(scaleFactor);
labelBox.setBoxPrinter(labelBoxPrinter);
labelBox.setID("Standard Label"); //$NON-NLS-1$
labelBoxPrinter.setText(text);
labelBoxPrinter.setHorizontalAlignment(SWT.CENTER);
try {
FontData data = Display.getDefault().getSystemFont().getFontData()[0];
data.setHeight(fontSize);
data.setStyle(SWT.BOLD);
Font font = AWTSWTImageUtils.swtFontToAwt(data);
labelBoxPrinter.setFont(font);
} catch (Exception e) {
// oh well don't have that font type
}
boxes.add(labelBox);