Sfoglia il codice sorgente

Allow colors for pseudo states
#110

muelder 10 anni fa
parent
commit
a09b553f4b

+ 37 - 39
plugins/de.itemis.gmf.runtime.commons/src/de/itemis/gmf/runtime/commons/editparts/EllipseFixedSizeShapeNodeEditPart.java

@@ -1,39 +1,37 @@
-/**
- * Copyright (c) 2011 itemis AG and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- * 	itemis AG - initial API and implementation
- * 
- */
-package de.itemis.gmf.runtime.commons.editparts;
-
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.View;
-
-import de.itemis.gmf.runtime.commons.figures.EllipseAnchorDefaultSizeNodeFigure;
-
-/**
- * 
- * @author andreas muelder (andreas.muelder@itemis.de)
- * 
- */
-public abstract class EllipseFixedSizeShapeNodeEditPart extends
-		FixedSizeShapeNodeEditPart {
-
-	public EllipseFixedSizeShapeNodeEditPart(View view) {
-		super(view);
-	}
-
-	@Override
-	protected NodeFigure createNodeFigure() {
-		final NodeFigure figure = new EllipseAnchorDefaultSizeNodeFigure(
-				getDefaultSize());
-		figure.setLayoutManager(getLayoutManager());
-		figure.add(getPrimaryShape());
-		return figure;
-	}
-}
+/**
+ * Copyright (c) 2011 itemis AG and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ * 	itemis AG - initial API and implementation
+ * 
+ */
+package de.itemis.gmf.runtime.commons.editparts;
+
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
+import org.eclipse.gmf.runtime.notation.View;
+
+import de.itemis.gmf.runtime.commons.figures.EllipseAnchorDefaultSizeNodeFigure;
+
+/**
+ * 
+ * @author andreas muelder (andreas.muelder@itemis.de)
+ * 
+ */
+public abstract class EllipseFixedSizeShapeNodeEditPart extends FixedSizeShapeNodeEditPart {
+
+	public EllipseFixedSizeShapeNodeEditPart(View view) {
+		super(view);
+	}
+
+	@Override
+	protected NodeFigure createNodeFigure() {
+		final NodeFigure figure = new EllipseAnchorDefaultSizeNodeFigure(getDefaultSize());
+		figure.setLayoutManager(getLayoutManager());
+		figure.add(createPrimaryShape());
+		return figure;
+	}
+}

+ 60 - 60
plugins/de.itemis.gmf.runtime.commons/src/de/itemis/gmf/runtime/commons/editparts/FixedSizeShapeNodeEditPart.java

@@ -1,60 +1,60 @@
-/**
- * Copyright (c) 2011 itemis AG and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- * 	itemis AG - initial API and implementation
- * 
- */
-package de.itemis.gmf.runtime.commons.editparts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.LayoutManager;
-import org.eclipse.draw2d.StackLayout;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableEditPolicyEx;
-import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.View;
-
-/**
- * EditPart for Shapes that should not be resized.
- * 
- * @author andreas muelder (andreas.muelder@itemis.de)
- * 
- */
-public abstract class FixedSizeShapeNodeEditPart extends ShapeNodeEditPart {
-
-	public FixedSizeShapeNodeEditPart(final View view) {
-		super(view);
-	}
-
-	public abstract Dimension getDefaultSize();
-
-	public abstract IFigure getPrimaryShape();
-
-	@Override
-	protected NodeFigure createNodeFigure() {
-		final NodeFigure figure = new DefaultSizeNodeFigure(getDefaultSize());
-		figure.setLayoutManager(getLayoutManager());
-		figure.add(getPrimaryShape());
-		return figure;
-	}
-
-	protected LayoutManager getLayoutManager() {
-		return new StackLayout();
-	}
-
-	@Override
-	protected void createDefaultEditPolicies() {
-		super.createDefaultEditPolicies();
-		installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE,
-				new NonResizableEditPolicyEx());
-	}
-
-}
+/**
+ * Copyright (c) 2011 itemis AG and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ * 	itemis AG - initial API and implementation
+ * 
+ */
+package de.itemis.gmf.runtime.commons.editparts;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.LayoutManager;
+import org.eclipse.draw2d.StackLayout;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableEditPolicyEx;
+import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * EditPart for Shapes that should not be resized.
+ * 
+ * @author andreas muelder (andreas.muelder@itemis.de)
+ * 
+ */
+public abstract class FixedSizeShapeNodeEditPart extends ShapeNodeEditPart {
+
+	public FixedSizeShapeNodeEditPart(final View view) {
+		super(view);
+	}
+
+	public abstract Dimension getDefaultSize();
+
+	public abstract IFigure createPrimaryShape();
+
+	@Override
+	protected NodeFigure createNodeFigure() {
+		final NodeFigure figure = new DefaultSizeNodeFigure(getDefaultSize());
+		figure.setLayoutManager(getLayoutManager());
+		figure.add(createPrimaryShape());
+		return figure;
+	}
+
+	protected LayoutManager getLayoutManager() {
+		return new StackLayout();
+	}
+
+	@Override
+	protected void createDefaultEditPolicies() {
+		super.createDefaultEditPolicies();
+		installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE,
+				new NonResizableEditPolicyEx());
+	}
+
+}