scaleBox.setSize(new Dimension(scaleWidth, scaleHeight));
boxes.add(scaleBox);
}
private int addLabelBox( Map map, int width, final int labelWidth) {
Box labelBox = ModelFactory.eINSTANCE.createBox();
LabelBoxPrinter labelBoxPrinter = new LabelBoxPrinter();
labelBoxPrinter.setText(formatName(map.getName()));
labelBoxPrinter.setHorizontalAlignment(SWT.CENTER);
try {
FontData data = Display.getDefault().getSystemFont().getFontData()[0];
data.setHeight( 18 );
data.setStyle( SWT.BOLD );
Font font = AWTSWTImageUtils.swtFontToAwt(data);
labelBoxPrinter.setFont(font);
} catch (Exception e) {
// oh well don't have that font type
}
labelBox.setBoxPrinter(labelBoxPrinter);
labelBox.setID("Standard Label"); //$NON-NLS-1$
// TODO base it on the font
int labelHeight = 30+LabelBoxPrinter.INSET*2;
labelBox.setSize(new Dimension(labelWidth, labelHeight));
labelBox.setLocation(new Point((width - labelWidth) / 2, MARGIN));
boxes.add(labelBox);
return labelHeight;
}