Explorar el Código

Added bold fontData for State Names

Andreas Mülder hace 14 años
padre
commit
2300c96ce8

+ 15 - 7
plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/editparts/StateNameEditPart.java

@@ -13,6 +13,8 @@ package org.yakindu.sct.ui.editor.editparts;
 import org.eclipse.draw2d.IFigure;
 import org.eclipse.emf.common.notify.Notification;
 import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.FontData;
 import org.yakindu.base.base.BasePackage;
 import org.yakindu.sct.model.sgraph.SGraphPackage;
 import org.yakindu.sct.model.sgraph.State;
@@ -47,27 +49,33 @@ public class StateNameEditPart extends TextAwareLabelEditPart {
 	public State resolveSemanticElement() {
 		return (State) super.resolveSemanticElement();
 	}
-	
+
+	@Override
+	protected void setFont(FontData fontData) {
+		super.setFont(new FontData(fontData.getName(), fontData.getHeight(),
+				fontData.getStyle() | SWT.BOLD));
+	}
+
 	@Override
 	protected void updateLabelText() {
-		if (resolveSemanticElement().getSubstatechart()!=null) {
+		if (resolveSemanticElement().getSubstatechart() != null) {
 			StringBuilder builder = new StringBuilder();
 			builder.append(getEditText());
 			builder.append("::");
-			Statechart substatechart = resolveSemanticElement().getSubstatechart();
+			Statechart substatechart = resolveSemanticElement()
+					.getSubstatechart();
 			if (substatechart != null) {
 				builder.append(substatechart.getName());
 			} else {
 				builder.append("<Unknown>");
 			}
 			getWrappingLabel().setText(builder.toString());
-		}
-		else {
+		} else {
 			super.updateLabelText();
 		}
-		
+
 	};
-	
+
 	@Override
 	public void notifyChanged(Notification notification) {
 		super.notifyChanged(notification);