use of org.eclipse.gmf.runtime.notation.DecorationNode in project statecharts by Yakindu.
the class FactoryUtils method createLabel.
/**
* Creates a Label view
*
* @param owner
* @param hint
* @return
*/
@SuppressWarnings("unchecked")
public static Node createLabel(View owner, String hint) {
DecorationNode nameLabel = NotationFactory.eINSTANCE.createDecorationNode();
nameLabel.setType(hint);
ShapeStyle style = NotationFactory.eINSTANCE.createShapeStyle();
style.setFontColor(FigureUtilities.RGBToInteger(ColorConstants.black.getRGB()));
nameLabel.getStyles().add(style);
ViewUtil.insertChildView(owner, nameLabel, ViewUtil.APPEND, true);
nameLabel.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
return nameLabel;
}
Aggregations