Search in sources :

Example 1 with DecorationNode

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;
}
Also used : ShapeStyle(org.eclipse.gmf.runtime.notation.ShapeStyle) DecorationNode(org.eclipse.gmf.runtime.notation.DecorationNode)

Aggregations

DecorationNode (org.eclipse.gmf.runtime.notation.DecorationNode)1 ShapeStyle (org.eclipse.gmf.runtime.notation.ShapeStyle)1