### Eclipse Workspace Patch 1.0
#P org.eclipse.gmf.bridge
Index: src/org/eclipse/gmf/bridge/genmodel/DefaultViewmapProducer.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.bridge/src/org/eclipse/gmf/bridge/genmodel/DefaultViewmapProducer.java,v
retrieving revision 1.7
diff -u -r1.7 DefaultViewmapProducer.java
--- src/org/eclipse/gmf/bridge/genmodel/DefaultViewmapProducer.java 23 May 2006 21:09:42 -0000 1.7
+++ src/org/eclipse/gmf/bridge/genmodel/DefaultViewmapProducer.java 19 Jun 2006 11:02:32 -0000
@@ -14,6 +14,7 @@
import org.eclipse.gmf.codegen.gmfgen.FigureViewmap;
import org.eclipse.gmf.codegen.gmfgen.GMFGenFactory;
import org.eclipse.gmf.codegen.gmfgen.ResizeConstraints;
+import org.eclipse.gmf.codegen.gmfgen.StyleAttributes;
import org.eclipse.gmf.codegen.gmfgen.Viewmap;
import org.eclipse.gmf.codegen.gmfgen.ViewmapLayoutType;
import org.eclipse.gmf.gmfgraph.Canvas;
@@ -21,6 +22,7 @@
import org.eclipse.gmf.gmfgraph.Connection;
import org.eclipse.gmf.gmfgraph.DiagramLabel;
import org.eclipse.gmf.gmfgraph.Direction;
+import org.eclipse.gmf.gmfgraph.Figure;
import org.eclipse.gmf.gmfgraph.FigureHandle;
import org.eclipse.gmf.gmfgraph.FlowLayout;
import org.eclipse.gmf.gmfgraph.Layout;
@@ -87,6 +89,31 @@
ViewmapLayoutType type = myLayoutTypeSwitch.getLayoutType(((Layoutable) figure).getLayout());
viewmap.setLayoutType(type);
}
+
+ protected final void setupGeneratedProperties(Viewmap viewmap, FigureHandle handle){
+ if (viewmap == null || false == handle instanceof Figure){
+ return;
+ }
+ Figure figure = (Figure)handle;
+ StyleAttributes attributes = GMFGenFactory.eINSTANCE.createStyleAttributes();
+ boolean fixedSomething = false;
+ if (figure.getFont() != null){
+ attributes.setFixedFont(true);
+ fixedSomething = true;
+ }
+ if (figure.getForegroundColor() != null){
+ attributes.setFixedForeground(true);
+ fixedSomething = true;
+ }
+ if (figure.getBackgroundColor() != null){
+ attributes.setFixedBackground(true);
+ fixedSomething = true;
+ }
+
+ if (fixedSomething){
+ viewmap.getAttributes().add(attributes);
+ }
+ }
private static class LayoutTypeSwitch extends GMFGraphSwitch {
Index: src/org/eclipse/gmf/bridge/genmodel/InnerClassViewmapProducer.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.bridge/src/org/eclipse/gmf/bridge/genmodel/InnerClassViewmapProducer.java,v
retrieving revision 1.20
diff -u -r1.20 InnerClassViewmapProducer.java
--- src/org/eclipse/gmf/bridge/genmodel/InnerClassViewmapProducer.java 30 May 2006 13:15:00 -0000 1.20
+++ src/org/eclipse/gmf/bridge/genmodel/InnerClassViewmapProducer.java 19 Jun 2006 11:02:33 -0000
@@ -98,7 +98,7 @@
return createViewmap(compartment.getFigure());
}
- private Viewmap createViewmap(Figure figure) {
+ private Viewmap createFigureViewmap(Figure figure) {
Viewmap result;
if (EcoreUtil.isAncestor(processedFigures, figure.getParent())) {
// we generated code for parent, thus (if figure generation logic not changed)
@@ -132,15 +132,19 @@
}
private Viewmap createViewmap(FigureHandle figure) {
+ Viewmap result;
if (figure instanceof Figure) {
- return createViewmap((Figure) figure);
+ result = createFigureViewmap((Figure) figure);
} else if (figure instanceof FigureAccessor) {
- return createViewmap((FigureAccessor) figure);
+ result = createFigureAccessorViewmap((FigureAccessor) figure);
+ } else {
+ throw new IllegalStateException();
}
- throw new IllegalStateException();
+ setupGeneratedProperties(result, figure);
+ return result;
}
- private Viewmap createViewmap(FigureAccessor figureAccess) {
+ private Viewmap createFigureAccessorViewmap(FigureAccessor figureAccess) {
ParentAssignedViewmap v = GMFGenFactory.eINSTANCE.createParentAssignedViewmap();
v.setGetterName(figureAccess.getAccessor());
if (figureAccess.getTypedFigure() != null) {
#P org.eclipse.gmf.codegen.edit
Index: src/org/eclipse/gmf/codegen/gmfgen/provider/GMFGenItemProviderAdapterFactory.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.edit/src/org/eclipse/gmf/codegen/gmfgen/provider/GMFGenItemProviderAdapterFactory.java,v
retrieving revision 1.36
diff -u -r1.36 GMFGenItemProviderAdapterFactory.java
--- src/org/eclipse/gmf/codegen/gmfgen/provider/GMFGenItemProviderAdapterFactory.java 9 Jun 2006 12:31:21 -0000 1.36
+++ src/org/eclipse/gmf/codegen/gmfgen/provider/GMFGenItemProviderAdapterFactory.java 19 Jun 2006 11:02:34 -0000
@@ -602,6 +602,28 @@
}
/**
+ * This keeps track of the one adapter used for all {@link org.eclipse.gmf.codegen.gmfgen.StyleAttributes} instances.
+ *
+ *
+ * @generated
+ */
+ protected StyleAttributesItemProvider styleAttributesItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.gmf.codegen.gmfgen.StyleAttributes}.
+ *
+ *
+ * @generated
+ */
+ public Adapter createStyleAttributesAdapter() {
+ if (styleAttributesItemProvider == null) {
+ styleAttributesItemProvider = new StyleAttributesItemProvider(this);
+ }
+
+ return styleAttributesItemProvider;
+ }
+
+ /**
* This keeps track of the one adapter used for all {@link org.eclipse.gmf.codegen.gmfgen.ResizeConstraints} instances.
*
*
@@ -1337,6 +1359,7 @@
if (compositeFeatureLabelModelFacetItemProvider != null) compositeFeatureLabelModelFacetItemProvider.dispose();
if (designLabelModelFacetItemProvider != null) designLabelModelFacetItemProvider.dispose();
if (colorAttributesItemProvider != null) colorAttributesItemProvider.dispose();
+ if (styleAttributesItemProvider != null) styleAttributesItemProvider.dispose();
if (resizeConstraintsItemProvider != null) resizeConstraintsItemProvider.dispose();
if (defaultSizeAttributesItemProvider != null) defaultSizeAttributesItemProvider.dispose();
if (labelOffsetAttributesItemProvider != null) labelOffsetAttributesItemProvider.dispose();
Index: src/org/eclipse/gmf/codegen/gmfgen/provider/ViewmapItemProvider.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.edit/src/org/eclipse/gmf/codegen/gmfgen/provider/ViewmapItemProvider.java,v
retrieving revision 1.7
diff -u -r1.7 ViewmapItemProvider.java
--- src/org/eclipse/gmf/codegen/gmfgen/provider/ViewmapItemProvider.java 17 May 2006 14:22:35 -0000 1.7
+++ src/org/eclipse/gmf/codegen/gmfgen/provider/ViewmapItemProvider.java 19 Jun 2006 11:02:34 -0000
@@ -183,6 +183,11 @@
newChildDescriptors.add
(createChildParameter
(GMFGenPackage.eINSTANCE.getViewmap_Attributes(),
+ GMFGenFactory.eINSTANCE.createStyleAttributes()));
+
+ newChildDescriptors.add
+ (createChildParameter
+ (GMFGenPackage.eINSTANCE.getViewmap_Attributes(),
GMFGenFactory.eINSTANCE.createResizeConstraints()));
newChildDescriptors.add
Index: plugin.properties
===================================================================
RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.edit/plugin.properties,v
retrieving revision 1.106
diff -u -r1.106 plugin.properties
--- plugin.properties 9 Jun 2006 12:31:21 -0000 1.106
+++ plugin.properties 19 Jun 2006 11:02:34 -0000
@@ -450,5 +450,9 @@
_UI_GenLanguage_nregexp_literal = nregexp
-_UI_BatchValidation_validationDecoratorProviderPriority_feature = Validation Decorator Provider Priority
+_UI_BatchValidation_validationDecoratorProviderPriority_feature = Validation Decorator Provider Priority
_UI_DesignLabelModelFacet_type = Design Label Model Facet
+_UI_StyleAttributes_type = Style Attributes
+_UI_StyleAttributes_fixedFont_feature = Fixed Font
+_UI_StyleAttributes_fixedForeground_feature = Fixed Foreground
+_UI_StyleAttributes_fixedBackground_feature = Fixed Background
Index: src/org/eclipse/gmf/codegen/gmfgen/provider/StyleAttributesItemProvider.java
===================================================================
RCS file: src/org/eclipse/gmf/codegen/gmfgen/provider/StyleAttributesItemProvider.java
diff -N src/org/eclipse/gmf/codegen/gmfgen/provider/StyleAttributesItemProvider.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/eclipse/gmf/codegen/gmfgen/provider/StyleAttributesItemProvider.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,202 @@
+/**
+ *
+ *
+ *
+ * $Id$
+ */
+package org.eclipse.gmf.codegen.gmfgen.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+
+import org.eclipse.gmf.codegen.gmfgen.GMFGenPackage;
+import org.eclipse.gmf.codegen.gmfgen.StyleAttributes;
+
+import org.eclipse.gmf.codegen.gmfgen.presentation.EditorPlugin;
+
+/**
+ * This is the item provider adapter for a {@link org.eclipse.gmf.codegen.gmfgen.StyleAttributes} object.
+ *
+ *
+ * @generated
+ */
+public class StyleAttributesItemProvider
+ extends ItemProviderAdapter
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ *
+ *
+ * @generated
+ */
+ public StyleAttributesItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ *
+ *
+ * @generated
+ */
+ public List getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addFixedFontPropertyDescriptor(object);
+ addFixedForegroundPropertyDescriptor(object);
+ addFixedBackgroundPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Fixed Font feature.
+ *
+ *
+ * @generated
+ */
+ protected void addFixedFontPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_StyleAttributes_fixedFont_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_StyleAttributes_fixedFont_feature", "_UI_StyleAttributes_type"),
+ GMFGenPackage.eINSTANCE.getStyleAttributes_FixedFont(),
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Fixed Foreground feature.
+ *
+ *
+ * @generated
+ */
+ protected void addFixedForegroundPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_StyleAttributes_fixedForeground_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_StyleAttributes_fixedForeground_feature", "_UI_StyleAttributes_type"),
+ GMFGenPackage.eINSTANCE.getStyleAttributes_FixedForeground(),
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Fixed Background feature.
+ *
+ *
+ * @generated
+ */
+ protected void addFixedBackgroundPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_StyleAttributes_fixedBackground_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_StyleAttributes_fixedBackground_feature", "_UI_StyleAttributes_type"),
+ GMFGenPackage.eINSTANCE.getStyleAttributes_FixedBackground(),
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This returns StyleAttributes.gif.
+ *
+ *
+ * @generated
+ */
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/StyleAttributes"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ *
+ *
+ * @generated
+ */
+ public String getText(Object object) {
+ StyleAttributes styleAttributes = (StyleAttributes)object;
+ return getString("_UI_StyleAttributes_type") + " " + styleAttributes.isFixedFont();
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ *
+ *
+ * @generated
+ */
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(StyleAttributes.class)) {
+ case GMFGenPackage.STYLE_ATTRIBUTES__FIXED_FONT:
+ case GMFGenPackage.STYLE_ATTRIBUTES__FIXED_FOREGROUND:
+ case GMFGenPackage.STYLE_ATTRIBUTES__FIXED_BACKGROUND:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing all of the children that can be created under this object.
+ *
+ *
+ * @generated
+ */
+ protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ *
+ *
+ * @generated
+ */
+ public ResourceLocator getResourceLocator() {
+ return EditorPlugin.INSTANCE;
+ }
+
+}
#P org.eclipse.gmf.tests
Index: src/org/eclipse/gmf/tests/gef/DiagramNodeTest.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.gmf/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/gef/DiagramNodeTest.java,v
retrieving revision 1.16
diff -u -r1.16 DiagramNodeTest.java
--- src/org/eclipse/gmf/tests/gef/DiagramNodeTest.java 15 Jun 2006 10:50:50 -0000 1.16
+++ src/org/eclipse/gmf/tests/gef/DiagramNodeTest.java 19 Jun 2006 11:02:38 -0000
@@ -11,6 +11,8 @@
*/
package org.eclipse.gmf.tests.gef;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.PolylineConnection;
import org.eclipse.draw2d.PositionConstants;
import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Point;
@@ -20,6 +22,11 @@
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.requests.ChangeBoundsRequest;
import org.eclipse.gmf.codegen.gmfgen.GenLink;
+import org.eclipse.gmf.gmfgraph.Color;
+import org.eclipse.gmf.gmfgraph.Connection;
+import org.eclipse.gmf.gmfgraph.Figure;
+import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
+import org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants;
import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
import org.eclipse.gmf.runtime.notation.Edge;
import org.eclipse.gmf.runtime.notation.FillStyle;
@@ -29,10 +36,13 @@
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.Size;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.tests.gen.GenericFigureCheck;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.swt.graphics.RGB;
public class DiagramNodeTest extends DiagramTestBase {
-
+ private final GenericFigureCheck.ColorTransformer ourColorTransformer = new GenericFigureCheck.ColorTransformer();
private final Point myMoveDelta = new Point(10, 20);
private final Dimension mySizeDelta = new Dimension(100, 50);
@@ -45,6 +55,25 @@
View nodeB = getNotation(getNodeEditPartB());
ConnectionEditPart linkByClass = createAndCheckLink(nodeA, nodeB, getSetup().getGenModel().getLinkC());
assertNotNull(linkByClass);
+
+ //there is already linkByRef between a and b, use new target
+ nodeB = createNode(getSetup().getGenModel().getNodeB(), getDiagram());
+ ConnectionEditPart linkByRef = createAndCheckLink(nodeA, nodeB, getSetup().getGenModel().getLinkD());
+ assertNotNull(linkByRef);
+ }
+
+ public void testNotColoredLink(){
+ View nodeA = getNotation(getNodeEditPartA());
+ View nodeB = getNotation(getNodeEditPartB());
+ ConnectionEditPart linkByClass = createAndCheckLink(nodeA, nodeB, getSetup().getGenModel().getLinkC());
+ checkLinkColor(linkByClass, getSetup().getMapModel().getClassLink().getDiagramLink());
+ }
+
+ public void testColoredLink(){
+ View nodeA = createNode(getSetup().getGenModel().getNodeA(), getDiagram());
+ View nodeB = createNode(getSetup().getGenModel().getNodeB(), getDiagram());
+ ConnectionEditPart linkByRef = createAndCheckLink(nodeA, nodeB, getSetup().getGenModel().getLinkD());
+ checkLinkColor(linkByRef, getSetup().getMapModel().getReferenceLink().getDiagramLink());
}
private ConnectionEditPart createAndCheckLink(View source, View target, GenLink genLinkType){
@@ -59,6 +88,19 @@
assertNotNull(newLinkEditPart);
return newLinkEditPart;
}
+
+ private void checkLinkColor(ConnectionEditPart newLinkEditPart, Connection gmfGraphConnection){
+ IFigure actual = newLinkEditPart.getFigure();
+ assertTrue(actual instanceof PolylineConnection);
+ Figure gmfFigure = (Figure)gmfGraphConnection.getFigure();
+ Color gmfColor = gmfFigure.getForegroundColor();
+ RGB expectedRGB = gmfColor == null ? getDefaultLinkColor() : ourColorTransformer.gmf2swt(gmfColor);
+ assertEquals(expectedRGB, actual.getForegroundColor().getRGB());
+ }
+
+ private RGB getDefaultLinkColor() {
+ return PreferenceConverter.getColor(getDefaults(), IPreferenceConstants.PREF_LINE_COLOR);
+ }
public void testChangeBounds() {
final EditPart editPart = getNodeEditPartA();
@@ -172,4 +214,7 @@
assertEquals("Background color doesn't match after [" + assertTag + ']', expectedBackgroundColor, getBackgroundColor(notation));
}
+ private IPreferenceStore getDefaults() {
+ return (IPreferenceStore) PreferencesHint.USE_DEFAULTS.getPreferenceStore();
+ }
}
Index: src/org/eclipse/gmf/tests/setup/RTSource.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.gmf/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/setup/RTSource.java,v
retrieving revision 1.3
diff -u -r1.3 RTSource.java
--- src/org/eclipse/gmf/tests/setup/RTSource.java 6 Jun 2006 17:48:30 -0000 1.3
+++ src/org/eclipse/gmf/tests/setup/RTSource.java 19 Jun 2006 11:02:39 -0000
@@ -23,5 +23,6 @@
Diagram getCanvas();
Node getNodeA();
Node getNodeB();
- Edge getLink();
+ Edge getLinkByClass();
+ Edge getLinkByRef();
}
Index: src/org/eclipse/gmf/tests/setup/CompartmentsSessionSetup.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.gmf/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/setup/CompartmentsSessionSetup.java,v
retrieving revision 1.2
diff -u -r1.2 CompartmentsSessionSetup.java
--- src/org/eclipse/gmf/tests/setup/CompartmentsSessionSetup.java 6 Jun 2006 17:48:30 -0000 1.2
+++ src/org/eclipse/gmf/tests/setup/CompartmentsSessionSetup.java 19 Jun 2006 11:02:39 -0000
@@ -24,12 +24,18 @@
import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.gmf.gmfgraph.Canvas;
+import org.eclipse.gmf.gmfgraph.Color;
+import org.eclipse.gmf.gmfgraph.ColorConstants;
import org.eclipse.gmf.gmfgraph.Compartment;
+import org.eclipse.gmf.gmfgraph.Connection;
+import org.eclipse.gmf.gmfgraph.ConnectionFigure;
+import org.eclipse.gmf.gmfgraph.ConstantColor;
import org.eclipse.gmf.gmfgraph.DiagramLabel;
import org.eclipse.gmf.gmfgraph.Figure;
import org.eclipse.gmf.gmfgraph.FigureGallery;
import org.eclipse.gmf.gmfgraph.GMFGraphFactory;
import org.eclipse.gmf.gmfgraph.Node;
+import org.eclipse.gmf.gmfgraph.Rectangle;
import org.eclipse.gmf.mappings.ChildReference;
import org.eclipse.gmf.mappings.CompartmentMapping;
import org.eclipse.gmf.mappings.GMFMapFactory;
@@ -95,6 +101,16 @@
* @return compartment, hasTitle = false, collapsible = false
*/
public Compartment getCompartmentB();
+
+ /**
+ * @return node, foreground = red, background = blue
+ */
+ public Node getColoredNode();
+
+ /**
+ * @return connection, foreground = orange
+ */
+ public Connection getColoredConnection();
}
public static interface DomainModelSourceExtension extends DomainModelSource {
@@ -105,17 +121,39 @@
protected static class DiaDefSetupWithCompartments extends DiaDefSetup implements DiaDefSourceExtension {
private Compartment myCollapsibleCompartmentWithTitle;
private Compartment myCompartmentNoTitleNoCollapse;
+ private Node myColoredNode;
+ private Connection myColoredConnection;
public void setupCanvasDef(Canvas canvasDef) {
FigureGallery oneMoreGallery = GMFGraphFactory.eINSTANCE.createFigureGallery();
canvasDef.getFigures().add(oneMoreGallery);
Figure compartmentFigure = GMFGraphFactory.eINSTANCE.createRectangle();
+ compartmentFigure.setName("CompartmentFigure");
oneMoreGallery.getFigures().add(compartmentFigure);
myCollapsibleCompartmentWithTitle = createCompartment(compartmentFigure, "Compartment_Title_Collapse", true, true);
canvasDef.getCompartments().add(myCollapsibleCompartmentWithTitle);
myCompartmentNoTitleNoCollapse = createCompartment(compartmentFigure, "Compartment_NoTitle_No_Collapse", false, false);
canvasDef.getCompartments().add(myCompartmentNoTitleNoCollapse);
+
+ Rectangle colored = GMFGraphFactory.eINSTANCE.createRectangle();
+ colored.setForegroundColor(createColor(ColorConstants.RED_LITERAL));
+ colored.setBackgroundColor(createColor(ColorConstants.BLUE_LITERAL));
+ colored.setName("ColoredRectangle");
+ oneMoreGallery.getFigures().add(colored);
+ myColoredNode = GMFGraphFactory.eINSTANCE.createNode();
+ myColoredNode.setName("ColoredRectangleNode");
+ myColoredNode.setFigure(colored);
+ getCanvasDef().getNodes().add(myColoredNode);
+
+ ConnectionFigure connectionLink = GMFGraphFactory.eINSTANCE.createPolylineConnection();
+ connectionLink.setName("ColoredLink");
+ connectionLink.setForegroundColor(createColor(ColorConstants.ORANGE_LITERAL));
+ oneMoreGallery.getFigures().add(connectionLink);
+ myColoredConnection = GMFGraphFactory.eINSTANCE.createConnection();
+ myColoredConnection.setName("ColoredLinkConnection");
+ myColoredConnection.setFigure(connectionLink);
+ getCanvasDef().getConnections().add(myColoredConnection);
}
protected void setupNodeDef(Node nodeDef) {
@@ -131,6 +169,14 @@
return myCompartmentNoTitleNoCollapse;
}
+ public Connection getColoredConnection() {
+ return myColoredConnection;
+ }
+
+ public Node getColoredNode() {
+ return myColoredNode;
+ }
+
private Compartment createCompartment(Figure figure, String name, boolean collapsible, boolean needsTitle){
Compartment result = GMFGraphFactory.eINSTANCE.createCompartment();
result.setFigure(figure);
@@ -139,6 +185,12 @@
result.setCollapsible(collapsible);
return result;
}
+
+ private Color createColor(ColorConstants color){
+ ConstantColor result = GMFGraphFactory.eINSTANCE.createConstantColor();
+ result.setValue(color);
+ return result;
+ }
}
protected static class DomainSetupWithChildren extends DomainModelSetup implements DomainModelSourceExtension {
@@ -194,6 +246,9 @@
MapSetup result = super.init(ddSource, domainSource, toolDef);
+ getNodeB().setDiagramNode(diaDefSetupWithCompartments.getColoredNode());
+ getReferenceLink().setDiagramLink(diaDefSetupWithCompartments.getColoredConnection());
+
setupReferenceAndCompartment(ddSource, diaDefSetupWithCompartments.getCompartmentA(), domainWithChildren.getChildOfA(), result.getNodeA());
setupReferenceAndCompartment(ddSource, diaDefSetupWithCompartments.getCompartmentB(), domainWithChildren.getChildOfB(), result.getNodeB());
Index: src/org/eclipse/gmf/tests/setup/RTSetup.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.gmf/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/setup/RTSetup.java,v
retrieving revision 1.26
diff -u -r1.26 RTSetup.java
--- src/org/eclipse/gmf/tests/setup/RTSetup.java 12 Jun 2006 14:45:35 -0000 1.26
+++ src/org/eclipse/gmf/tests/setup/RTSetup.java 19 Jun 2006 11:02:39 -0000
@@ -34,6 +34,7 @@
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.emf.workspace.AbstractEMFOperation;
+import org.eclipse.gmf.codegen.gmfgen.FeatureLinkModelFacet;
import org.eclipse.gmf.codegen.gmfgen.GenNode;
import org.eclipse.gmf.codegen.gmfgen.TypeLinkModelFacet;
import org.eclipse.gmf.runtime.diagram.core.DiagramEditingDomainFactory;
@@ -56,7 +57,8 @@
private Diagram myCanvas;
private Node myNodeA;
private Node myNodeB;
- private Edge myLink;
+ private Edge myLinkByClass;
+ private Edge myLinkByRef;
private EObject myDiagramElement;
@@ -87,23 +89,30 @@
myNodeA = setupNotationNode(genSource.getNodeA(), instanceProducer);
myNodeB = setupNotationNode(genSource.getNodeB(), instanceProducer);
- myLink = NotationFactory.eINSTANCE.createEdge();
- myCanvas.getPersistedEdges().add(myLink);
+ myLinkByClass = NotationFactory.eINSTANCE.createEdge();
+ myCanvas.getPersistedEdges().add(myLinkByClass);
//myNode.setVisualID(genSource.getGenNode().getVisualID());
- TypeLinkModelFacet mf = (TypeLinkModelFacet) genSource.getLinkC().getModelFacet();
- EObject linkElement = instanceProducer.createInstance(mf.getMetaClass());
- instanceProducer.setFeatureValue(myNodeA.getElement(), linkElement, mf.getContainmentMetaFeature());
- instanceProducer.setFeatureValue(linkElement, myNodeB.getElement(), mf.getTargetMetaFeature());
- myLink.setElement(linkElement);
- myLink.setType(String.valueOf(genSource.getLinkC().getVisualID()));
- myLink.setSource(myNodeA);
- myLink.setTarget(myNodeB);
+ TypeLinkModelFacet byClassFacet = (TypeLinkModelFacet) genSource.getLinkC().getModelFacet();
+ EObject linkElement = instanceProducer.createInstance(byClassFacet.getMetaClass());
+ instanceProducer.setFeatureValue(myNodeA.getElement(), linkElement, byClassFacet.getContainmentMetaFeature());
+ instanceProducer.setFeatureValue(linkElement, myNodeB.getElement(), byClassFacet.getTargetMetaFeature());
+ myLinkByClass.setElement(linkElement);
+ myLinkByClass.setType(String.valueOf(genSource.getLinkC().getVisualID()));
+ myLinkByClass.setSource(myNodeA);
+ myLinkByClass.setTarget(myNodeB);
+ setBendpoints(myLinkByClass);
+
+ FeatureLinkModelFacet byRefFacet = (FeatureLinkModelFacet) genSource.getLinkD().getModelFacet();
+ Assert.assertNotNull(byRefFacet);
+ instanceProducer.setFeatureValue(myNodeA.getElement(), myNodeB.getElement(), byRefFacet.getMetaFeature());
+ myLinkByRef = NotationFactory.eINSTANCE.createEdge();
+ myCanvas.getPersistedEdges().add(myLinkByRef);
+ myLinkByRef.setType(String.valueOf(genSource.getLinkD().getVisualID()));
+ myLinkByRef.setSource(myNodeA);
+ myLinkByRef.setTarget(myNodeB);
+ setBendpoints(myLinkByRef);
- myLink.setBendpoints(NotationFactory.eINSTANCE.createRelativeBendpoints());
-
- //myLink.setVisualID(genSource.getGenLink().getVisualID());
-
myCanvas.setType(genSource.getGenDiagram().getEditorGen().getDomainGenModel().getModelName());
/*
@@ -119,6 +128,10 @@
*/
}
+ private void setBendpoints(Edge edge){
+ edge.setBendpoints(NotationFactory.eINSTANCE.createRelativeBendpoints());
+ }
+
private Node setupNotationNode(GenNode genNode, DomainInstanceProducer instanceProducer){
Node result = NotationFactory.eINSTANCE.createNode();
myCanvas.getPersistedChildren().add(result);
@@ -176,8 +189,12 @@
return myNodeB;
}
- public Edge getLink() {
- return myLink;
+ public Edge getLinkByClass() {
+ return myLinkByClass;
+ }
+
+ public Edge getLinkByRef() {
+ return myLinkByRef;
}
protected EObject getDiagramElement(){
Index: src/org/eclipse/gmf/tests/gen/GenericFigureCheck.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.gmf/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/gen/GenericFigureCheck.java,v
retrieving revision 1.5
diff -u -r1.5 GenericFigureCheck.java
--- src/org/eclipse/gmf/tests/gen/GenericFigureCheck.java 17 May 2006 11:30:51 -0000 1.5
+++ src/org/eclipse/gmf/tests/gen/GenericFigureCheck.java 19 Jun 2006 11:02:38 -0000
@@ -47,6 +47,7 @@
public class GenericFigureCheck extends FigureCodegenTestBase.FigureCheck {
private final Figure myGMFRootFigure;
+ private static final ColorTransformer ourColorConstantTransformer = new ColorTransformer();
public GenericFigureCheck(Figure eFigure){
myGMFRootFigure = eFigure;
@@ -186,14 +187,7 @@
assertNotNull(swtColor);
assertNotNull(eColor);
- RGB expectedRGB;
- if (eColor instanceof ConstantColor){
- expectedRGB = transformConstantColor((ConstantColor)eColor).getRGB();
- } else if (eColor instanceof RGBColor){
- expectedRGB = transformRGBColor((RGBColor)eColor);
- } else {
- throw new IllegalStateException("Unknown color: " + eColor);
- }
+ RGB expectedRGB = ourColorConstantTransformer.gmf2swt(eColor);
assertEquals(expectedRGB, swtColor.getRGB());
}
@@ -231,14 +225,7 @@
}
}
- private org.eclipse.swt.graphics.Color transformConstantColor(ConstantColor color) {
- Class d2dClass = org.eclipse.draw2d.ColorConstants.class;
- Object d2dValue = getStaticFieldValue("Unknown color: " + color, d2dClass, color.getValue().getLiteral());
- assertTrue(d2dValue instanceof org.eclipse.swt.graphics.Color);
- return (org.eclipse.swt.graphics.Color)d2dValue;
- }
-
- private Object getStaticFieldValue(String failureMessage, Class clazz, String fieldName){
+ private static Object getStaticFieldValue(String failureMessage, Class clazz, String fieldName){
try {
Field constant = clazz.getField(fieldName);
assertNotNull(failureMessage, constant);
@@ -251,10 +238,6 @@
}
}
- private RGB transformRGBColor(RGBColor color) {
- return new RGB(color.getRed(), color.getGreen(), color.getBlue());
- }
-
protected void checkPreferredSize(Figure gmfFigure, IFigure figure) {
if (gmfFigure.eIsSet(GMFGraphPackage.eINSTANCE.getFigure_PreferredSize())){
Dimension ePreferredSize = gmfFigure.getPreferredSize();
@@ -345,5 +328,29 @@
assertNotNull(eInsets);
assertEquals(new org.eclipse.draw2d.geometry.Insets(eInsets.getTop(), eInsets.getLeft(), eInsets.getBottom(), eInsets.getRight()), d2dInsets);
}
+
+ public static class ColorTransformer {
+ public RGB gmf2swt(Color color){
+ if (color instanceof ConstantColor){
+ return gmfConstant2swt((ConstantColor)color);
+ }
+ if (color instanceof RGBColor){
+ return gmfRGB2swt((RGBColor)color);
+ }
+ throw new IllegalArgumentException("Unknown color:" + color);
+ }
+
+ public RGB gmfConstant2swt(ConstantColor gmfColor){
+ Class d2dClass = org.eclipse.draw2d.ColorConstants.class;
+ Object d2dValue = getStaticFieldValue("Unknown color: " + gmfColor, d2dClass, gmfColor.getValue().getLiteral());
+ assertTrue(d2dValue instanceof org.eclipse.swt.graphics.Color);
+ return ((org.eclipse.swt.graphics.Color)d2dValue).getRGB();
+ }
+
+ public RGB gmfRGB2swt(RGBColor gmfColor){
+ return new RGB(gmfColor.getRed(), gmfColor.getGreen(), gmfColor.getBlue());
+ }
+
+ }
}
Index: src/org/eclipse/gmf/tests/gen/ViewmapProducersTest.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.gmf/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/gen/ViewmapProducersTest.java,v
retrieving revision 1.13
diff -u -r1.13 ViewmapProducersTest.java
--- src/org/eclipse/gmf/tests/gen/ViewmapProducersTest.java 7 Jun 2006 09:52:48 -0000 1.13
+++ src/org/eclipse/gmf/tests/gen/ViewmapProducersTest.java 19 Jun 2006 11:02:39 -0000
@@ -24,11 +24,15 @@
import org.eclipse.gmf.codegen.gmfgen.InnerClassViewmap;
import org.eclipse.gmf.codegen.gmfgen.ParentAssignedViewmap;
import org.eclipse.gmf.codegen.gmfgen.ResizeConstraints;
+import org.eclipse.gmf.codegen.gmfgen.StyleAttributes;
import org.eclipse.gmf.codegen.gmfgen.Viewmap;
import org.eclipse.gmf.codegen.gmfgen.ViewmapLayoutType;
+import org.eclipse.gmf.gmfgraph.BasicFont;
+import org.eclipse.gmf.gmfgraph.Color;
import org.eclipse.gmf.gmfgraph.ColorConstants;
import org.eclipse.gmf.gmfgraph.Compartment;
import org.eclipse.gmf.gmfgraph.Connection;
+import org.eclipse.gmf.gmfgraph.ConnectionFigure;
import org.eclipse.gmf.gmfgraph.ConstantColor;
import org.eclipse.gmf.gmfgraph.CustomConnection;
import org.eclipse.gmf.gmfgraph.CustomFigure;
@@ -38,6 +42,7 @@
import org.eclipse.gmf.gmfgraph.FigureAccessor;
import org.eclipse.gmf.gmfgraph.FigureGallery;
import org.eclipse.gmf.gmfgraph.FlowLayout;
+import org.eclipse.gmf.gmfgraph.FontStyle;
import org.eclipse.gmf.gmfgraph.GMFGraphFactory;
import org.eclipse.gmf.gmfgraph.Label;
import org.eclipse.gmf.gmfgraph.Layout;
@@ -374,6 +379,72 @@
checker.check(toolbar, ViewmapLayoutType.TOOLBAR_LAYOUT_LITERAL);
}
+ public void testGeneratedPropertiesAttributes(){
+ class Checker {
+ public void check(Viewmap viewmap, boolean font, boolean fore, boolean back){
+ StyleAttributes attributes = (StyleAttributes) viewmap.find(StyleAttributes.class);
+ if (font || fore || back){
+ assertNotNull(attributes);
+ assertEquals(font, attributes.isFixedFont());
+ assertEquals(fore, attributes.isFixedForeground());
+ assertEquals(back, attributes.isFixedBackground());
+ } else {
+ assertNull(attributes);
+ }
+ }
+
+ public void check(Node node, boolean font, boolean fore, boolean back){
+ Viewmap viewmap = getProducer().create(node);
+ check(viewmap, font, fore, back);
+ }
+
+ public void check(Connection link, boolean font, boolean fore, boolean back){
+ Viewmap viewmap = getProducer().create(link);
+ check(viewmap, font, fore, back);
+ }
+ }
+
+ Checker checker = new Checker();
+
+ checker.check(createNode("NODE_Empty", GMFGraphFactory.eINSTANCE.createRectangle()), false, false, false);
+ checker.check(createLink("LINK_Empty", GMFGraphFactory.eINSTANCE.createPolylineConnection()), false, false, false);
+
+ Figure hasFont = GMFGraphFactory.eINSTANCE.createRectangle();
+ BasicFont font = GMFGraphFactory.eINSTANCE.createBasicFont();
+ font.setFaceName("Arial");
+ font.setHeight(12);
+ font.setStyle(FontStyle.BOLD_LITERAL);
+ hasFont.setFont(font);
+ checker.check(createNode("NODE_Font", hasFont), true, false, false);
+
+ Figure hasFore = GMFGraphFactory.eINSTANCE.createRectangle();
+ hasFore.setForegroundColor(createColor(ColorConstants.GRAY_LITERAL));
+ checker.check(createNode("NODE_Fore_Color", hasFore), false, true, false);
+
+ Figure hasBack = GMFGraphFactory.eINSTANCE.createRectangle();
+ hasBack.setBackgroundColor(createColor(ColorConstants.LIGHT_BLUE_LITERAL)) ;
+ checker.check(createNode("NODE_Back_Color", hasBack), false, false, true);
+
+ ConnectionFigure polylineWithFont = GMFGraphFactory.eINSTANCE.createPolylineConnection();
+ polylineWithFont.setFont(font);
+ checker.check(createLink("Link_Font", polylineWithFont), true, false, false);
+
+ ConnectionFigure polylineWithColor = GMFGraphFactory.eINSTANCE.createPolylineConnection();
+ polylineWithColor.setForegroundColor(createColor(ColorConstants.RED_LITERAL));
+ checker.check(createLink("Link_Font", polylineWithColor), false, true, false);
+
+ Figure parent = GMFGraphFactory.eINSTANCE.createRoundedRectangle();
+ parent.setName("ParentNoColor");
+ Figure child = GMFGraphFactory.eINSTANCE.createEllipse();
+ child.setName("ChildWithColor");
+ child.setForegroundColor(createColor(ColorConstants.GREEN_LITERAL));
+ parent.getChildren().add(child);
+
+ //only properties of top-level figure should be considered
+ checker.check(createNode("ParentOfColoredChild", parent), false, false, false);
+ }
+
+
private TypeDeclaration parseFirstType(String classContents) {
ASTParser p = ASTParser.newParser(AST.JLS3);
p.setSource(classContents.toCharArray());
@@ -391,6 +462,14 @@
return createNode(name, figure, null);
}
+ private Connection createLink(String name, ConnectionFigure connectionFigure) {
+ Connection connection = GMFGraphFactory.eINSTANCE.createConnection();
+ connectionFigure.setName(name);
+ connection.setName(name);
+ connection.setFigure(connectionFigure);
+ return connection;
+ }
+
private Compartment createCompartment(String name, Figure figure){
assertNotNull(name);
assertNotNull(figure);
@@ -405,6 +484,7 @@
assertNotNull(figure);
Node result = GMFGraphFactory.eINSTANCE.createNode();
result.setName(name);
+ figure.setName(name);
result.setFigure(figure);
if (optionalConstaint != null){
result.setResizeConstraint(optionalConstaint);
@@ -415,6 +495,12 @@
protected ViewmapProducer getProducer() {
return myProducer;
}
+
+ private Color createColor(ColorConstants color) {
+ ConstantColor result = GMFGraphFactory.eINSTANCE.createConstantColor();
+ result.setValue(color);
+ return result;
+ }
private class ResizeConstraintsChecker {
private final List myExpectedNames;
#P org.eclipse.gmf.codegen
Index: src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenPackageImpl.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenPackageImpl.java,v
retrieving revision 1.139
diff -u -r1.139 GMFGenPackageImpl.java
--- src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenPackageImpl.java 13 Jun 2006 15:10:43 -0000 1.139
+++ src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenPackageImpl.java 19 Jun 2006 11:02:49 -0000
@@ -95,6 +95,7 @@
import org.eclipse.gmf.codegen.gmfgen.Shortcuts;
import org.eclipse.gmf.codegen.gmfgen.SnippetViewmap;
import org.eclipse.gmf.codegen.gmfgen.SpecializationType;
+import org.eclipse.gmf.codegen.gmfgen.StyleAttributes;
import org.eclipse.gmf.codegen.gmfgen.ToolEntry;
import org.eclipse.gmf.codegen.gmfgen.ToolGroup;
import org.eclipse.gmf.codegen.gmfgen.ToolGroupItem;
@@ -419,6 +420,13 @@
*
* @generated
*/
+ private EClass styleAttributesEClass = null;
+
+ /**
+ *
+ *
+ * @generated
+ */
private EClass resizeConstraintsEClass = null;
/**
@@ -2680,6 +2688,42 @@
*
* @generated
*/
+ public EClass getStyleAttributes() {
+ return styleAttributesEClass;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EAttribute getStyleAttributes_FixedFont() {
+ return (EAttribute)styleAttributesEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EAttribute getStyleAttributes_FixedForeground() {
+ return (EAttribute)styleAttributesEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EAttribute getStyleAttributes_FixedBackground() {
+ return (EAttribute)styleAttributesEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
public EClass getResizeConstraints() {
return resizeConstraintsEClass;
}
@@ -4067,6 +4111,11 @@
createEAttribute(colorAttributesEClass, COLOR_ATTRIBUTES__FOREGROUND_COLOR);
createEAttribute(colorAttributesEClass, COLOR_ATTRIBUTES__BACKGROUND_COLOR);
+ styleAttributesEClass = createEClass(STYLE_ATTRIBUTES);
+ createEAttribute(styleAttributesEClass, STYLE_ATTRIBUTES__FIXED_FONT);
+ createEAttribute(styleAttributesEClass, STYLE_ATTRIBUTES__FIXED_FOREGROUND);
+ createEAttribute(styleAttributesEClass, STYLE_ATTRIBUTES__FIXED_BACKGROUND);
+
resizeConstraintsEClass = createEClass(RESIZE_CONSTRAINTS);
createEAttribute(resizeConstraintsEClass, RESIZE_CONSTRAINTS__RESIZE_HANDLES);
createEAttribute(resizeConstraintsEClass, RESIZE_CONSTRAINTS__NON_RESIZE_HANDLES);
@@ -4302,6 +4351,7 @@
compositeFeatureLabelModelFacetEClass.getESuperTypes().add(this.getLabelModelFacet());
designLabelModelFacetEClass.getESuperTypes().add(this.getLabelModelFacet());
colorAttributesEClass.getESuperTypes().add(this.getAttributes());
+ styleAttributesEClass.getESuperTypes().add(this.getAttributes());
resizeConstraintsEClass.getESuperTypes().add(this.getAttributes());
defaultSizeAttributesEClass.getESuperTypes().add(this.getAttributes());
labelOffsetAttributesEClass.getESuperTypes().add(this.getAttributes());
@@ -4742,6 +4792,11 @@
initEAttribute(getColorAttributes_ForegroundColor(), ecorePackage.getEString(), "foregroundColor", null, 0, 1, ColorAttributes.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getColorAttributes_BackgroundColor(), ecorePackage.getEString(), "backgroundColor", null, 0, 1, ColorAttributes.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEClass(styleAttributesEClass, StyleAttributes.class, "StyleAttributes", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getStyleAttributes_FixedFont(), ecorePackage.getEBoolean(), "fixedFont", "false", 0, 1, StyleAttributes.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getStyleAttributes_FixedForeground(), ecorePackage.getEBoolean(), "fixedForeground", "false", 0, 1, StyleAttributes.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getStyleAttributes_FixedBackground(), ecorePackage.getEBoolean(), "fixedBackground", "false", 0, 1, StyleAttributes.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
initEClass(resizeConstraintsEClass, ResizeConstraints.class, "ResizeConstraints", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getResizeConstraints_ResizeHandles(), ecorePackage.getEInt(), "resizeHandles", "0", 0, 1, ResizeConstraints.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getResizeConstraints_NonResizeHandles(), ecorePackage.getEInt(), "nonResizeHandles", "0", 0, 1, ResizeConstraints.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
@@ -5024,7 +5079,7 @@
"constraints", "http://www.eclipse.org/gmf/2005/constraints",
"meta", "http://www.eclipse.org/gmf/2005/constraints/meta",
"deprecated", "http://www.eclipse.org/gmf/2006/deprecated"
- });
+ });
}
/**
@@ -5138,7 +5193,7 @@
new String[] {
"ocl", "not targetMetaFeature.oclIsUndefined() implies targetMetaFeature.genClass.ecoreClass.isSuperTypeOf(metaClass.ecoreClass)",
"description", "Link \'Target Meta Feature\' must be owned by link \'Meta Class\' or its super-class"
- });
+ });
addAnnotation
(genFeatureValueSpecEClass,
source,
@@ -5218,7 +5273,7 @@
new String[] {
"def", "context",
"ocl", "metaClass.ecoreClass"
- });
+ });
addAnnotation
(valueExpressionEClass,
source,
Index: src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenFactoryImpl.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenFactoryImpl.java,v
retrieving revision 1.52
diff -u -r1.52 GMFGenFactoryImpl.java
--- src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenFactoryImpl.java 9 Jun 2006 12:31:18 -0000 1.52
+++ src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenFactoryImpl.java 19 Jun 2006 11:02:46 -0000
@@ -135,6 +135,7 @@
case GMFGenPackage.COMPOSITE_FEATURE_LABEL_MODEL_FACET: return createCompositeFeatureLabelModelFacet();
case GMFGenPackage.DESIGN_LABEL_MODEL_FACET: return createDesignLabelModelFacet();
case GMFGenPackage.COLOR_ATTRIBUTES: return createColorAttributes();
+ case GMFGenPackage.STYLE_ATTRIBUTES: return createStyleAttributes();
case GMFGenPackage.RESIZE_CONSTRAINTS: return createResizeConstraints();
case GMFGenPackage.DEFAULT_SIZE_ATTRIBUTES: return createDefaultSizeAttributes();
case GMFGenPackage.LABEL_OFFSET_ATTRIBUTES: return createLabelOffsetAttributes();
@@ -457,6 +458,16 @@
*
* @generated
*/
+ public StyleAttributes createStyleAttributes() {
+ StyleAttributesImpl styleAttributes = new StyleAttributesImpl();
+ return styleAttributes;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
public ResizeConstraints createResizeConstraints() {
ResizeConstraintsImpl resizeConstraints = new ResizeConstraintsImpl();
return resizeConstraints;
Index: src-templates/org/eclipse/gmf/codegen/templates/providers/ViewFactoryGenerator.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/providers/ViewFactoryGenerator.java,v
retrieving revision 1.44
diff -u -r1.44 ViewFactoryGenerator.java
--- src-templates/org/eclipse/gmf/codegen/templates/providers/ViewFactoryGenerator.java 6 Jun 2006 17:48:31 -0000 1.44
+++ src-templates/org/eclipse/gmf/codegen/templates/providers/ViewFactoryGenerator.java 19 Jun 2006 11:02:42 -0000
@@ -28,82 +28,92 @@
protected final String TEXT_9 = NL + " ";
protected final String TEXT_10 = " " + NL + "\t";
protected final String TEXT_11 = NL + "\t";
- protected final String TEXT_12 = NL + "{" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */";
- protected final String TEXT_13 = NL + "\tprotected void decorateView(View view, IAdaptable semanticAdapter, String diagramKind){" + NL + "\t\tsuper.decorateView(view, semanticAdapter, diagramKind);";
- protected final String TEXT_14 = NL + "\tprotected void decorateView(View containerView, View view, IAdaptable semanticAdapter," + NL + "\t\t\tString semanticHint, int index, boolean persisted) {" + NL + "\t\tif (semanticHint == null) { ";
- protected final String TEXT_15 = NL + "\t\t\tsemanticHint = ";
- protected final String TEXT_16 = ".getType(";
- protected final String TEXT_17 = ".VISUAL_ID);" + NL + "\t\t\tview.setType(semanticHint);" + NL + "\t\t}";
- protected final String TEXT_18 = NL + "\t\tsuper.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);";
- protected final String TEXT_19 = NL + "\t\tsetupCompartmentTitle(view);" + NL + "\t\tsetupCompartmentCollapsed(view);";
- protected final String TEXT_20 = "\t\t" + NL + "\t\tif (!";
- protected final String TEXT_21 = ".MODEL_ID.equals(";
- protected final String TEXT_22 = ".getModelID(containerView))) {" + NL + "\t\t\t";
- protected final String TEXT_23 = " shortcutAnnotation = ";
- protected final String TEXT_24 = ".eINSTANCE.createEAnnotation();" + NL + "\t\t\tshortcutAnnotation.setSource(\"Shortcut\"); //$NON-NLS-1$" + NL + "\t\t\tshortcutAnnotation.getDetails().put(\"modelID\", ";
- protected final String TEXT_25 = ".MODEL_ID); //$NON-NLS-1$" + NL + "\t\t\tview.getEAnnotations().add(shortcutAnnotation);" + NL + "\t\t}";
- protected final String TEXT_26 = NL + "\t\t";
- protected final String TEXT_27 = ".setStructuralFeatureValue(view, ";
- protected final String TEXT_28 = ".eINSTANCE.getLineStyle_LineColor()," + NL + "\t\t\t";
- protected final String TEXT_29 = ".colorToInteger(";
- protected final String TEXT_30 = ".";
- protected final String TEXT_31 = "));";
- protected final String TEXT_32 = NL + "\t\t";
- protected final String TEXT_33 = ".setStructuralFeatureValue(view, ";
- protected final String TEXT_34 = ".eINSTANCE.getFillStyle_FillColor()," + NL + "\t\t\t";
- protected final String TEXT_35 = ".colorToInteger(";
- protected final String TEXT_36 = ".";
- protected final String TEXT_37 = "));";
- protected final String TEXT_38 = NL + "\t\tgetViewService().createNode(semanticAdapter, view, ";
+ protected final String TEXT_12 = NL + "{" + NL + "" + NL + "\t/*" + NL + "\t * @generated " + NL + "\t */" + NL + "\tprotected List createStyles(View view) {" + NL + "\t\t";
+ protected final String TEXT_13 = " styles = new ";
+ protected final String TEXT_14 = "();";
+ protected final String TEXT_15 = NL + "\t\tstyles.add(";
+ protected final String TEXT_16 = ".eINSTANCE.createRoutingStyle());";
+ protected final String TEXT_17 = NL + "\t\tstyles.add(";
+ protected final String TEXT_18 = ".eINSTANCE.createLineStyle());";
+ protected final String TEXT_19 = NL + "\t\tstyles.add(";
+ protected final String TEXT_20 = ".eINSTANCE.createPageStyle());" + NL + "\t\tstyles.add(";
+ protected final String TEXT_21 = ".eINSTANCE.createGuideStyle());" + NL + "\t\tstyles.add(";
+ protected final String TEXT_22 = ".eINSTANCE.createDescriptionStyle());";
+ protected final String TEXT_23 = NL + "\t\tstyles.add(";
+ protected final String TEXT_24 = ".eINSTANCE.createDrawerStyle());";
+ protected final String TEXT_25 = "\t" + NL + "\t\tstyles.add(";
+ protected final String TEXT_26 = ".eINSTANCE.createTitleStyle());";
+ protected final String TEXT_27 = "\t" + NL + "\t\tstyles.add(";
+ protected final String TEXT_28 = ".eINSTANCE.createSortingStyle());" + NL + "\t\tstyles.add(";
+ protected final String TEXT_29 = ".eINSTANCE.createFilteringStyle());";
+ protected final String TEXT_30 = NL + "\t\tstyles.add(";
+ protected final String TEXT_31 = ".eINSTANCE.createFontStyle());" + NL + "\t\tstyles.add(";
+ protected final String TEXT_32 = ".eINSTANCE.createDescriptionStyle());" + NL + "\t\tstyles.add(";
+ protected final String TEXT_33 = ".eINSTANCE.createFillStyle());" + NL + "\t\tstyles.add(";
+ protected final String TEXT_34 = ".eINSTANCE.createLineStyle());";
+ protected final String TEXT_35 = NL + "\t\treturn styles;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */";
+ protected final String TEXT_36 = NL + "\tprotected void decorateView(View view, IAdaptable semanticAdapter, String diagramKind){" + NL + "\t\tsuper.decorateView(view, semanticAdapter, diagramKind);";
+ protected final String TEXT_37 = NL + "\tprotected void decorateView(View containerView, View view, IAdaptable semanticAdapter," + NL + "\t\t\tString semanticHint, int index, boolean persisted) {" + NL + "\t\tif (semanticHint == null) { ";
+ protected final String TEXT_38 = NL + "\t\t\tsemanticHint = ";
protected final String TEXT_39 = ".getType(";
- protected final String TEXT_40 = ".VISUAL_ID)," + NL + "\t\t\t";
- protected final String TEXT_41 = ".APPEND, true, getPreferencesHint());";
- protected final String TEXT_42 = NL + "\t\tgetViewService().createNode(semanticAdapter, view, ";
- protected final String TEXT_43 = ".getType(";
- protected final String TEXT_44 = ".VISUAL_ID)," + NL + "\t\t\t";
- protected final String TEXT_45 = ".APPEND, true, getPreferencesHint());";
- protected final String TEXT_46 = NL + "\t\tgetViewService().createNode(semanticAdapter, view, ";
- protected final String TEXT_47 = ".getType(";
- protected final String TEXT_48 = ".VISUAL_ID)," + NL + "\t\t\t";
- protected final String TEXT_49 = ".APPEND, true, getPreferencesHint());";
- protected final String TEXT_50 = NL + "\t}";
- protected final String TEXT_51 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_52 = " createStyles(View view) {" + NL + "\t\t";
- protected final String TEXT_53 = " styles = super.createStyles(view);" + NL + "\t\tstyles.add(";
- protected final String TEXT_54 = ".eINSTANCE.createShapeStyle());" + NL + "\t\treturn styles;" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_55 = " createLayoutConstraint() {" + NL + "\t\treturn ";
- protected final String TEXT_56 = ".eINSTANCE.createBounds();" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void initializeFromPreferences(View view) {" + NL + "\t\tsuper.initializeFromPreferences(view);" + NL + "" + NL + "\t\t";
- protected final String TEXT_57 = " store = (";
- protected final String TEXT_58 = ") getPreferencesHint().getPreferenceStore();" + NL + "" + NL + "\t\t// fill color" + NL + "\t\t";
- protected final String TEXT_59 = " fillRGB = ";
- protected final String TEXT_60 = ".getColor(store, ";
- protected final String TEXT_61 = ".PREF_FILL_COLOR);" + NL + "\t\t";
- protected final String TEXT_62 = ".setStructuralFeatureValue(view, ";
- protected final String TEXT_63 = ".eINSTANCE.getFillStyle_FillColor(), ";
- protected final String TEXT_64 = ".RGBToInteger(fillRGB));" + NL + "\t}";
- protected final String TEXT_65 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_66 = " getMeasurementUnit() {" + NL + "\t\treturn ";
- protected final String TEXT_67 = ".";
- protected final String TEXT_68 = "_LITERAL;" + NL + "\t}";
- protected final String TEXT_69 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void setupCompartmentTitle(View view) {" + NL + "\t\t";
- protected final String TEXT_70 = " titleStyle = (";
- protected final String TEXT_71 = ")view.getStyle(";
- protected final String TEXT_72 = ".eINSTANCE.getTitleStyle());";
- protected final String TEXT_73 = "\t\t" + NL + "\t\tif (titleStyle == null){" + NL + "\t\t\ttitleStyle = (";
- protected final String TEXT_74 = ") view.createStyle(";
- protected final String TEXT_75 = ".eINSTANCE.getTitleStyle());" + NL + "\t\t}" + NL + "\t\ttitleStyle.setShowTitle(true);";
- protected final String TEXT_76 = NL + "\t\tif (titleStyle != null){" + NL + "\t\t\tview.getStyles().remove(titleStyle);" + NL + "\t\t}";
- protected final String TEXT_77 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void setupCompartmentCollapsed(View view) {" + NL + "\t\t";
- protected final String TEXT_78 = " drawerStyle = (";
- protected final String TEXT_79 = ")view.getStyle(";
- protected final String TEXT_80 = ".eINSTANCE.getDrawerStyle());";
- protected final String TEXT_81 = "\t\t" + NL + "\t\tif (drawerStyle == null){" + NL + "\t\t\tdrawerStyle = (";
- protected final String TEXT_82 = ") view.createStyle(";
- protected final String TEXT_83 = ".eINSTANCE.getDrawerStyle());" + NL + "\t\t}" + NL + "\t\tdrawerStyle.setCollapsed(false);";
- protected final String TEXT_84 = NL + "\t\tif (drawerStyle != null){" + NL + "\t\t\tview.getStyles().remove(drawerStyle);" + NL + "\t\t}";
- protected final String TEXT_85 = NL + "\t}" + NL;
- protected final String TEXT_86 = NL + "}";
- protected final String TEXT_87 = NL;
+ protected final String TEXT_40 = ".VISUAL_ID);" + NL + "\t\t\tview.setType(semanticHint);" + NL + "\t\t}";
+ protected final String TEXT_41 = NL + "\t\tsuper.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);";
+ protected final String TEXT_42 = NL + "\t\tsetupCompartmentTitle(view);" + NL + "\t\tsetupCompartmentCollapsed(view);";
+ protected final String TEXT_43 = "\t\t" + NL + "\t\tif (!";
+ protected final String TEXT_44 = ".MODEL_ID.equals(";
+ protected final String TEXT_45 = ".getModelID(containerView))) {" + NL + "\t\t\t";
+ protected final String TEXT_46 = " shortcutAnnotation = ";
+ protected final String TEXT_47 = ".eINSTANCE.createEAnnotation();" + NL + "\t\t\tshortcutAnnotation.setSource(\"Shortcut\"); //$NON-NLS-1$" + NL + "\t\t\tshortcutAnnotation.getDetails().put(\"modelID\", ";
+ protected final String TEXT_48 = ".MODEL_ID); //$NON-NLS-1$" + NL + "\t\t\tview.getEAnnotations().add(shortcutAnnotation);" + NL + "\t\t}";
+ protected final String TEXT_49 = NL + "\t\t";
+ protected final String TEXT_50 = ".setStructuralFeatureValue(view, ";
+ protected final String TEXT_51 = ".eINSTANCE.getLineStyle_LineColor()," + NL + "\t\t\t";
+ protected final String TEXT_52 = ".colorToInteger(";
+ protected final String TEXT_53 = ".";
+ protected final String TEXT_54 = "));";
+ protected final String TEXT_55 = NL + "\t\t";
+ protected final String TEXT_56 = ".setStructuralFeatureValue(view, ";
+ protected final String TEXT_57 = ".eINSTANCE.getFillStyle_FillColor()," + NL + "\t\t\t";
+ protected final String TEXT_58 = ".colorToInteger(";
+ protected final String TEXT_59 = ".";
+ protected final String TEXT_60 = "));";
+ protected final String TEXT_61 = NL + "\t\tgetViewService().createNode(semanticAdapter, view, ";
+ protected final String TEXT_62 = ".getType(";
+ protected final String TEXT_63 = ".VISUAL_ID)," + NL + "\t\t\t";
+ protected final String TEXT_64 = ".APPEND, true, getPreferencesHint());";
+ protected final String TEXT_65 = NL + "\t\tgetViewService().createNode(semanticAdapter, view, ";
+ protected final String TEXT_66 = ".getType(";
+ protected final String TEXT_67 = ".VISUAL_ID)," + NL + "\t\t\t";
+ protected final String TEXT_68 = ".APPEND, true, getPreferencesHint());";
+ protected final String TEXT_69 = NL + "\t\tgetViewService().createNode(semanticAdapter, view, ";
+ protected final String TEXT_70 = ".getType(";
+ protected final String TEXT_71 = ".VISUAL_ID)," + NL + "\t\t\t";
+ protected final String TEXT_72 = ".APPEND, true, getPreferencesHint());";
+ protected final String TEXT_73 = NL + "\t}";
+ protected final String TEXT_74 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
+ protected final String TEXT_75 = " createLayoutConstraint() {" + NL + "\t\treturn ";
+ protected final String TEXT_76 = ".eINSTANCE.createBounds();" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void initializeFromPreferences(View view) {" + NL + "\t\tsuper.initializeFromPreferences(view);" + NL + "" + NL + "\t\t";
+ protected final String TEXT_77 = " store = (";
+ protected final String TEXT_78 = ") getPreferencesHint().getPreferenceStore();" + NL + "" + NL + "\t\t// fill color" + NL + "\t\t";
+ protected final String TEXT_79 = " fillRGB = ";
+ protected final String TEXT_80 = ".getColor(store, ";
+ protected final String TEXT_81 = ".PREF_FILL_COLOR);" + NL + "\t\t";
+ protected final String TEXT_82 = ".setStructuralFeatureValue(view, ";
+ protected final String TEXT_83 = ".eINSTANCE.getFillStyle_FillColor(), ";
+ protected final String TEXT_84 = ".RGBToInteger(fillRGB));" + NL + "\t}";
+ protected final String TEXT_85 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
+ protected final String TEXT_86 = " getMeasurementUnit() {" + NL + "\t\treturn ";
+ protected final String TEXT_87 = ".";
+ protected final String TEXT_88 = "_LITERAL;" + NL + "\t}";
+ protected final String TEXT_89 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void setupCompartmentTitle(View view) {" + NL + "\t\t";
+ protected final String TEXT_90 = " titleStyle = (";
+ protected final String TEXT_91 = ")view.getStyle(";
+ protected final String TEXT_92 = ".eINSTANCE.getTitleStyle());" + NL + "\t\tif (titleStyle != null){" + NL + "\t\t\ttitleStyle.setShowTitle(true);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void setupCompartmentCollapsed(View view) {" + NL + "\t\t";
+ protected final String TEXT_93 = " drawerStyle = (";
+ protected final String TEXT_94 = ")view.getStyle(";
+ protected final String TEXT_95 = ".eINSTANCE.getDrawerStyle());" + NL + "\t\tif (drawerStyle != null){" + NL + "\t\t\tdrawerStyle.setCollapsed(false);" + NL + "\t\t}" + NL + "\t}";
+ protected final String TEXT_96 = NL + NL + "}";
+ protected final String TEXT_97 = NL;
public String generate(Object argument)
{
@@ -130,11 +140,14 @@
importManager.markImportLocation(stringBuffer);
+final boolean isLink = genElement instanceof GenLink;
+final boolean isLabel = genElement instanceof GenChildLabelNode;
+final boolean isDiagram = genElement instanceof GenDiagram;
+final boolean isCompartment = genElement instanceof GenCompartment;
+final boolean isShape = !isLink && !isLabel && !isDiagram && !isCompartment; // captures else
+assert isLink || isLabel || isDiagram || isCompartment || isShape;
-boolean isLink = genElement instanceof GenLink;
-boolean isDiagram = genElement instanceof GenDiagram;
-boolean isCompartment = genElement instanceof GenCompartment;
-boolean isNode = !isLink && !isDiagram && !isCompartment;
+final boolean isNode = !isLink && !isDiagram && !isCompartment;
boolean isCompartmentWithOwnBounds = false;
if (isCompartment){
GenCompartment genCompartment = (GenCompartment)genElement;
@@ -147,7 +160,7 @@
if (isLink) {
stringBuffer.append(TEXT_7);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.view.factories.ConnectionViewFactory"));
- } else if (genElement instanceof GenChildLabelNode) {
+ } else if (isLabel) {
stringBuffer.append(TEXT_8);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory"));
} else if (isCompartment) {
@@ -156,99 +169,176 @@
} else if (isDiagram) {
stringBuffer.append(TEXT_10);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.view.factories.DiagramViewFactory"));
- } else {
+ } else if (isShape) {
stringBuffer.append(TEXT_11);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractShapeViewFactory"));
- }
+ } else {
+ throw new IllegalStateException("Unknown case for " + genElement);
+}
stringBuffer.append(TEXT_12);
+ stringBuffer.append(importManager.getImportedName("java.util.List"));
+ stringBuffer.append(TEXT_13);
+ stringBuffer.append(importManager.getImportedName("java.util.ArrayList"));
+ stringBuffer.append(TEXT_14);
+if (isLink) {
+
+ stringBuffer.append(TEXT_15);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
+ stringBuffer.append(TEXT_16);
+
+ Viewmap viewmap = genElement.getViewmap();
+ StyleAttributes styleAttributes = (viewmap == null) ? null : (StyleAttributes)viewmap.find(StyleAttributes.class);
+ boolean fixedForeground = styleAttributes != null && styleAttributes.isFixedForeground();
+ if (!fixedForeground) {
+
+ stringBuffer.append(TEXT_17);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
+ stringBuffer.append(TEXT_18);
+
+ } //fixedForeground
+}
+if (isLabel) {
+ //no styles for label
+}
if (isDiagram) {
- stringBuffer.append(TEXT_13);
+ stringBuffer.append(TEXT_19);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
+ stringBuffer.append(TEXT_20);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
+ stringBuffer.append(TEXT_21);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
+ stringBuffer.append(TEXT_22);
+
+}
+if (isCompartment) {
+ GenCompartment genCompartment = (GenCompartment)genElement;
+ if (genCompartment.isCanCollapse()){
+
+ stringBuffer.append(TEXT_23);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
+ stringBuffer.append(TEXT_24);
+
+ }
+ if (genCompartment.isNeedsTitle()){
+
+ stringBuffer.append(TEXT_25);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
+ stringBuffer.append(TEXT_26);
+
+ }
+
+ stringBuffer.append(TEXT_27);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
+ stringBuffer.append(TEXT_28);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
+ stringBuffer.append(TEXT_29);
+
+}
+if (isShape || isCompartmentWithOwnBounds) {
+
+ stringBuffer.append(TEXT_30);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
+ stringBuffer.append(TEXT_31);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
+ stringBuffer.append(TEXT_32);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
+ stringBuffer.append(TEXT_33);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
+ stringBuffer.append(TEXT_34);
+
+}
+
+ stringBuffer.append(TEXT_35);
+
+if (isDiagram) {
+
+ stringBuffer.append(TEXT_36);
} else {
- stringBuffer.append(TEXT_14);
+ stringBuffer.append(TEXT_37);
/* [++] important for the create shortcut functionality*/
- stringBuffer.append(TEXT_15);
+ stringBuffer.append(TEXT_38);
stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
- stringBuffer.append(TEXT_16);
+ stringBuffer.append(TEXT_39);
stringBuffer.append(genElement.getEditPartQualifiedClassName());
- stringBuffer.append(TEXT_17);
+ stringBuffer.append(TEXT_40);
/* [--] important for the create shortcut functionality*/
- stringBuffer.append(TEXT_18);
+ stringBuffer.append(TEXT_41);
if (isCompartment){
- stringBuffer.append(TEXT_19);
+ stringBuffer.append(TEXT_42);
}
- stringBuffer.append(TEXT_20);
+ stringBuffer.append(TEXT_43);
stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_21);
+ stringBuffer.append(TEXT_44);
stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
- stringBuffer.append(TEXT_22);
+ stringBuffer.append(TEXT_45);
stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAnnotation"));
- stringBuffer.append(TEXT_23);
+ stringBuffer.append(TEXT_46);
stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EcoreFactory"));
- stringBuffer.append(TEXT_24);
+ stringBuffer.append(TEXT_47);
stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_25);
+ stringBuffer.append(TEXT_48);
}
ColorAttributes colorAttrs = genElement.getViewmap() != null ? (ColorAttributes) genElement.getViewmap().find(ColorAttributes.class) : null;
if (colorAttrs != null && colorAttrs.getForegroundColor() != null && colorAttrs.getForegroundColor().trim().length() > 0) {
- stringBuffer.append(TEXT_26);
+ stringBuffer.append(TEXT_49);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil"));
- stringBuffer.append(TEXT_27);
+ stringBuffer.append(TEXT_50);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_28);
+ stringBuffer.append(TEXT_51);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities"));
- stringBuffer.append(TEXT_29);
+ stringBuffer.append(TEXT_52);
stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ColorConstants"));
- stringBuffer.append(TEXT_30);
+ stringBuffer.append(TEXT_53);
stringBuffer.append(colorAttrs.getForegroundColor());
- stringBuffer.append(TEXT_31);
+ stringBuffer.append(TEXT_54);
}
if (isNode) {
GenNode genNode = (GenNode) genElement;
if (colorAttrs != null && colorAttrs.getBackgroundColor() != null && colorAttrs.getBackgroundColor().trim().length() > 0) {
- stringBuffer.append(TEXT_32);
+ stringBuffer.append(TEXT_55);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil"));
- stringBuffer.append(TEXT_33);
+ stringBuffer.append(TEXT_56);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_34);
+ stringBuffer.append(TEXT_57);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities"));
- stringBuffer.append(TEXT_35);
+ stringBuffer.append(TEXT_58);
stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ColorConstants"));
- stringBuffer.append(TEXT_36);
+ stringBuffer.append(TEXT_59);
stringBuffer.append(colorAttrs.getBackgroundColor());
- stringBuffer.append(TEXT_37);
+ stringBuffer.append(TEXT_60);
}
List labels = genNode.getLabels();
for (int j = 0; j < labels.size(); j++) {
GenNodeLabel label = (GenNodeLabel) labels.get(j);
- stringBuffer.append(TEXT_38);
+ stringBuffer.append(TEXT_61);
stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
- stringBuffer.append(TEXT_39);
+ stringBuffer.append(TEXT_62);
stringBuffer.append(importManager.getImportedName(label.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_40);
+ stringBuffer.append(TEXT_63);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil"));
- stringBuffer.append(TEXT_41);
+ stringBuffer.append(TEXT_64);
}
List genChildContainers = genNode.getCompartments();
for (int j = 0; j < genChildContainers.size(); j++) {
GenCompartment genChildContainer = (GenCompartment) genChildContainers.get(j);
- stringBuffer.append(TEXT_42);
+ stringBuffer.append(TEXT_65);
stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
- stringBuffer.append(TEXT_43);
+ stringBuffer.append(TEXT_66);
stringBuffer.append(importManager.getImportedName(genChildContainer.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_44);
+ stringBuffer.append(TEXT_67);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil"));
- stringBuffer.append(TEXT_45);
+ stringBuffer.append(TEXT_68);
}
} else if (isLink) {
@@ -257,55 +347,49 @@
for (int j = 0; j < labels.size(); j++) {
GenLinkLabel label = (GenLinkLabel) labels.get(j);
- stringBuffer.append(TEXT_46);
+ stringBuffer.append(TEXT_69);
stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
- stringBuffer.append(TEXT_47);
+ stringBuffer.append(TEXT_70);
stringBuffer.append(importManager.getImportedName(label.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_48);
+ stringBuffer.append(TEXT_71);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil"));
- stringBuffer.append(TEXT_49);
+ stringBuffer.append(TEXT_72);
}
}
- stringBuffer.append(TEXT_50);
+ stringBuffer.append(TEXT_73);
if (isCompartmentWithOwnBounds) {
- stringBuffer.append(TEXT_51);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
- stringBuffer.append(TEXT_52);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
- stringBuffer.append(TEXT_53);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
- stringBuffer.append(TEXT_54);
+ stringBuffer.append(TEXT_74);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.LayoutConstraint"));
- stringBuffer.append(TEXT_55);
+ stringBuffer.append(TEXT_75);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
- stringBuffer.append(TEXT_56);
+ stringBuffer.append(TEXT_76);
stringBuffer.append(importManager.getImportedName("org.eclipse.jface.preference.IPreferenceStore"));
- stringBuffer.append(TEXT_57);
+ stringBuffer.append(TEXT_77);
stringBuffer.append(importManager.getImportedName("org.eclipse.jface.preference.IPreferenceStore"));
- stringBuffer.append(TEXT_58);
+ stringBuffer.append(TEXT_78);
stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.RGB"));
- stringBuffer.append(TEXT_59);
+ stringBuffer.append(TEXT_79);
stringBuffer.append(importManager.getImportedName("org.eclipse.jface.preference.PreferenceConverter"));
- stringBuffer.append(TEXT_60);
+ stringBuffer.append(TEXT_80);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants"));
- stringBuffer.append(TEXT_61);
+ stringBuffer.append(TEXT_81);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil"));
- stringBuffer.append(TEXT_62);
+ stringBuffer.append(TEXT_82);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_63);
+ stringBuffer.append(TEXT_83);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities"));
- stringBuffer.append(TEXT_64);
+ stringBuffer.append(TEXT_84);
}
if (isDiagram && genDiagram.getUnits() != null && genDiagram.getUnits().trim().length() > 0) {
- stringBuffer.append(TEXT_65);
+ stringBuffer.append(TEXT_85);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.MeasurementUnit"));
- stringBuffer.append(TEXT_66);
+ stringBuffer.append(TEXT_86);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.MeasurementUnit"));
- stringBuffer.append(TEXT_67);
+ stringBuffer.append(TEXT_87);
stringBuffer.append(genDiagram.getUnits().toUpperCase());
- stringBuffer.append(TEXT_68);
+ stringBuffer.append(TEXT_88);
}
if (isCompartment) {
@@ -314,47 +398,23 @@
String notationPackageFQN = importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage");
GenCompartment genCompartment = (GenCompartment)genElement;
- stringBuffer.append(TEXT_69);
+ stringBuffer.append(TEXT_89);
stringBuffer.append(titleStyleFQN);
- stringBuffer.append(TEXT_70);
+ stringBuffer.append(TEXT_90);
stringBuffer.append(titleStyleFQN);
- stringBuffer.append(TEXT_71);
+ stringBuffer.append(TEXT_91);
stringBuffer.append(notationPackageFQN);
- stringBuffer.append(TEXT_72);
-
-if(genCompartment.isNeedsTitle()){
-
- stringBuffer.append(TEXT_73);
- stringBuffer.append(titleStyleFQN);
- stringBuffer.append(TEXT_74);
- stringBuffer.append(notationPackageFQN);
- stringBuffer.append(TEXT_75);
- } else {
- stringBuffer.append(TEXT_76);
- }
- stringBuffer.append(TEXT_77);
+ stringBuffer.append(TEXT_92);
stringBuffer.append(drawerStyleFQN);
- stringBuffer.append(TEXT_78);
+ stringBuffer.append(TEXT_93);
stringBuffer.append(drawerStyleFQN);
- stringBuffer.append(TEXT_79);
+ stringBuffer.append(TEXT_94);
stringBuffer.append(notationPackageFQN);
- stringBuffer.append(TEXT_80);
-
-if(genCompartment.isCanCollapse()){
-
- stringBuffer.append(TEXT_81);
- stringBuffer.append(drawerStyleFQN);
- stringBuffer.append(TEXT_82);
- stringBuffer.append(notationPackageFQN);
- stringBuffer.append(TEXT_83);
- } else {
- stringBuffer.append(TEXT_84);
- }
- stringBuffer.append(TEXT_85);
+ stringBuffer.append(TEXT_95);
}
- stringBuffer.append(TEXT_86);
+ stringBuffer.append(TEXT_96);
importManager.emitSortedImports();
- stringBuffer.append(TEXT_87);
+ stringBuffer.append(TEXT_97);
return stringBuffer.toString();
}
}
Index: src/org/eclipse/gmf/codegen/gmfgen/ColorAttributes.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/ColorAttributes.java,v
retrieving revision 1.1
diff -u -r1.1 ColorAttributes.java
--- src/org/eclipse/gmf/codegen/gmfgen/ColorAttributes.java 11 Oct 2005 12:25:35 -0000 1.1
+++ src/org/eclipse/gmf/codegen/gmfgen/ColorAttributes.java 19 Jun 2006 11:02:42 -0000
@@ -12,6 +12,10 @@
* A representation of the model object 'Color Attributes'.
*
*
+ *
+ * Deprecated, use StyleAttributes instead
+ *
+ *
*
* The following features are supported:
*
Index: src/org/eclipse/gmf/codegen/gmfgen/GMFGenPackage.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GMFGenPackage.java,v
retrieving revision 1.114
diff -u -r1.114 GMFGenPackage.java
--- src/org/eclipse/gmf/codegen/gmfgen/GMFGenPackage.java 9 Jun 2006 12:31:18 -0000 1.114
+++ src/org/eclipse/gmf/codegen/gmfgen/GMFGenPackage.java 19 Jun 2006 11:02:46 -0000
@@ -4250,7 +4250,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getViewmap()
* @generated
*/
- int VIEWMAP = 45;
+ int VIEWMAP = 46;
/**
* The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.Attributes Attributes}' class.
@@ -4309,6 +4309,52 @@
int COLOR_ATTRIBUTES_FEATURE_COUNT = ATTRIBUTES_FEATURE_COUNT + 2;
/**
+ * The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.impl.StyleAttributesImpl Style Attributes}' class.
+ *
+ *
+ * @see org.eclipse.gmf.codegen.gmfgen.impl.StyleAttributesImpl
+ * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getStyleAttributes()
+ * @generated
+ */
+ int STYLE_ATTRIBUTES = 42;
+
+ /**
+ * The feature id for the 'Fixed Font' attribute.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int STYLE_ATTRIBUTES__FIXED_FONT = ATTRIBUTES_FEATURE_COUNT + 0;
+
+ /**
+ * The feature id for the 'Fixed Foreground' attribute.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int STYLE_ATTRIBUTES__FIXED_FOREGROUND = ATTRIBUTES_FEATURE_COUNT + 1;
+
+ /**
+ * The feature id for the 'Fixed Background' attribute.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int STYLE_ATTRIBUTES__FIXED_BACKGROUND = ATTRIBUTES_FEATURE_COUNT + 2;
+
+ /**
+ * The number of structural features of the 'Style Attributes' class.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int STYLE_ATTRIBUTES_FEATURE_COUNT = ATTRIBUTES_FEATURE_COUNT + 3;
+
+ /**
* The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.impl.ResizeConstraintsImpl Resize Constraints}' class.
*
*
@@ -4316,7 +4362,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getResizeConstraints()
* @generated
*/
- int RESIZE_CONSTRAINTS = 42;
+ int RESIZE_CONSTRAINTS = 43;
/**
* The feature id for the 'Resize Handles' attribute.
@@ -4353,7 +4399,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getDefaultSizeAttributes()
* @generated
*/
- int DEFAULT_SIZE_ATTRIBUTES = 43;
+ int DEFAULT_SIZE_ATTRIBUTES = 44;
/**
* The feature id for the 'Width' attribute.
@@ -4390,7 +4436,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getLabelOffsetAttributes()
* @generated
*/
- int LABEL_OFFSET_ATTRIBUTES = 44;
+ int LABEL_OFFSET_ATTRIBUTES = 45;
/**
* The feature id for the 'X' attribute.
@@ -4463,7 +4509,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getFigureViewmap()
* @generated
*/
- int FIGURE_VIEWMAP = 46;
+ int FIGURE_VIEWMAP = 47;
/**
* The feature id for the 'Attributes' containment reference list.
@@ -4518,7 +4564,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getSnippetViewmap()
* @generated
*/
- int SNIPPET_VIEWMAP = 47;
+ int SNIPPET_VIEWMAP = 48;
/**
* The feature id for the 'Attributes' containment reference list.
@@ -4573,7 +4619,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getInnerClassViewmap()
* @generated
*/
- int INNER_CLASS_VIEWMAP = 48;
+ int INNER_CLASS_VIEWMAP = 49;
/**
* The feature id for the 'Attributes' containment reference list.
@@ -4637,7 +4683,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getParentAssignedViewmap()
* @generated
*/
- int PARENT_ASSIGNED_VIEWMAP = 49;
+ int PARENT_ASSIGNED_VIEWMAP = 50;
/**
* The feature id for the 'Attributes' containment reference list.
@@ -4710,7 +4756,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getPalette()
* @generated
*/
- int PALETTE = 52;
+ int PALETTE = 53;
/**
* The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.impl.EntryBaseImpl Entry Base}' class.
@@ -4720,7 +4766,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getEntryBase()
* @generated
*/
- int ENTRY_BASE = 53;
+ int ENTRY_BASE = 54;
/**
* The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.impl.ToolEntryImpl Tool Entry}' class.
@@ -4730,7 +4776,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getToolEntry()
* @generated
*/
- int TOOL_ENTRY = 54;
+ int TOOL_ENTRY = 55;
/**
* The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.impl.ToolGroupImpl Tool Group}' class.
@@ -4740,7 +4786,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getToolGroup()
* @generated
*/
- int TOOL_GROUP = 57;
+ int TOOL_GROUP = 58;
/**
* The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.impl.ValueExpressionImpl Value Expression}' class.
@@ -4750,7 +4796,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getValueExpression()
* @generated
*/
- int VALUE_EXPRESSION = 50;
+ int VALUE_EXPRESSION = 51;
/**
* The feature id for the 'Body' attribute.
@@ -4796,7 +4842,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenConstraint()
* @generated
*/
- int GEN_CONSTRAINT = 51;
+ int GEN_CONSTRAINT = 52;
/**
* The feature id for the 'Body' attribute.
@@ -5058,7 +5104,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getToolGroupItem()
* @generated
*/
- int TOOL_GROUP_ITEM = 55;
+ int TOOL_GROUP_ITEM = 56;
/**
* The number of structural features of the 'Tool Group Item' class.
@@ -5077,7 +5123,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getSeparator()
* @generated
*/
- int SEPARATOR = 56;
+ int SEPARATOR = 57;
/**
* The number of structural features of the 'Separator' class.
@@ -5186,7 +5232,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenElementInitializer()
* @generated
*/
- int GEN_ELEMENT_INITIALIZER = 58;
+ int GEN_ELEMENT_INITIALIZER = 59;
/**
* The feature id for the 'Type Model Facet' container reference.
@@ -5214,7 +5260,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenFeatureSeqInitializer()
* @generated
*/
- int GEN_FEATURE_SEQ_INITIALIZER = 59;
+ int GEN_FEATURE_SEQ_INITIALIZER = 60;
/**
* The feature id for the 'Type Model Facet' container reference.
@@ -5251,7 +5297,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenFeatureValueSpec()
* @generated
*/
- int GEN_FEATURE_VALUE_SPEC = 60;
+ int GEN_FEATURE_VALUE_SPEC = 61;
/**
* The feature id for the 'Body' attribute.
@@ -5315,7 +5361,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenLinkConstraints()
* @generated
*/
- int GEN_LINK_CONSTRAINTS = 61;
+ int GEN_LINK_CONSTRAINTS = 62;
/**
* The feature id for the 'Link' container reference.
@@ -5361,7 +5407,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenRuleContainerBase()
* @generated
*/
- int GEN_RULE_CONTAINER_BASE = 62;
+ int GEN_RULE_CONTAINER_BASE = 63;
/**
* The feature id for the 'Editor' reference.
@@ -5389,7 +5435,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenAuditContainer()
* @generated
*/
- int GEN_AUDIT_CONTAINER = 63;
+ int GEN_AUDIT_CONTAINER = 64;
/**
* The feature id for the 'Editor' reference.
@@ -5471,7 +5517,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenRuleBase()
* @generated
*/
- int GEN_RULE_BASE = 64;
+ int GEN_RULE_BASE = 65;
/**
* The feature id for the 'Name' attribute.
@@ -5508,7 +5554,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenAuditRule()
* @generated
*/
- int GEN_AUDIT_RULE = 65;
+ int GEN_AUDIT_RULE = 66;
/**
* The feature id for the 'Name' attribute.
@@ -5608,7 +5654,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenRuleTarget()
* @generated
*/
- int GEN_RULE_TARGET = 66;
+ int GEN_RULE_TARGET = 67;
/**
* The number of structural features of the 'Gen Rule Target' class.
@@ -5627,7 +5673,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenAuditable()
* @generated
*/
- int GEN_AUDITABLE = 74;
+ int GEN_AUDITABLE = 75;
/**
* The number of structural features of the 'Gen Auditable' class.
@@ -5646,7 +5692,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenDomainElementTarget()
* @generated
*/
- int GEN_DOMAIN_ELEMENT_TARGET = 67;
+ int GEN_DOMAIN_ELEMENT_TARGET = 68;
/**
* The feature id for the 'Element' reference.
@@ -5674,7 +5720,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenDiagramElementTarget()
* @generated
*/
- int GEN_DIAGRAM_ELEMENT_TARGET = 68;
+ int GEN_DIAGRAM_ELEMENT_TARGET = 69;
/**
* The feature id for the 'Element' reference list.
@@ -5702,7 +5748,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenDomainAttributeTarget()
* @generated
*/
- int GEN_DOMAIN_ATTRIBUTE_TARGET = 69;
+ int GEN_DOMAIN_ATTRIBUTE_TARGET = 70;
/**
* The feature id for the 'Attribute' reference.
@@ -5739,7 +5785,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenNotationElementTarget()
* @generated
*/
- int GEN_NOTATION_ELEMENT_TARGET = 70;
+ int GEN_NOTATION_ELEMENT_TARGET = 71;
/**
* The feature id for the 'Element' reference.
@@ -5767,7 +5813,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenMetricContainer()
* @generated
*/
- int GEN_METRIC_CONTAINER = 71;
+ int GEN_METRIC_CONTAINER = 72;
/**
* The feature id for the 'Editor' reference.
@@ -5804,7 +5850,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenMetricRule()
* @generated
*/
- int GEN_METRIC_RULE = 72;
+ int GEN_METRIC_RULE = 73;
/**
* The feature id for the 'Name' attribute.
@@ -5895,7 +5941,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenAuditedMetricTarget()
* @generated
*/
- int GEN_AUDITED_METRIC_TARGET = 73;
+ int GEN_AUDITED_METRIC_TARGET = 74;
/**
* The feature id for the 'Metric' reference.
@@ -5932,7 +5978,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenMeasurable()
* @generated
*/
- int GEN_MEASURABLE = 75;
+ int GEN_MEASURABLE = 76;
/**
* The number of structural features of the 'Gen Measurable' class.
@@ -5951,7 +5997,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenExpressionProviderContainer()
* @generated
*/
- int GEN_EXPRESSION_PROVIDER_CONTAINER = 76;
+ int GEN_EXPRESSION_PROVIDER_CONTAINER = 77;
/**
* The feature id for the 'Expressions Package Name' attribute.
@@ -6006,7 +6052,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenExpressionProviderBase()
* @generated
*/
- int GEN_EXPRESSION_PROVIDER_BASE = 77;
+ int GEN_EXPRESSION_PROVIDER_BASE = 78;
/**
* The feature id for the 'Expressions' reference list.
@@ -6043,7 +6089,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenJavaExpressionProvider()
* @generated
*/
- int GEN_JAVA_EXPRESSION_PROVIDER = 78;
+ int GEN_JAVA_EXPRESSION_PROVIDER = 79;
/**
* The feature id for the 'Expressions' reference list.
@@ -6080,7 +6126,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenExpressionInterpreter()
* @generated
*/
- int GEN_EXPRESSION_INTERPRETER = 79;
+ int GEN_EXPRESSION_INTERPRETER = 80;
/**
* The feature id for the 'Expressions' reference list.
@@ -6144,7 +6190,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getProviderPriority()
* @generated
*/
- int PROVIDER_PRIORITY = 80;
+ int PROVIDER_PRIORITY = 81;
/**
* The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.LinkLabelAlignment Link Label Alignment}' enum.
@@ -6154,7 +6200,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getLinkLabelAlignment()
* @generated
*/
- int LINK_LABEL_ALIGNMENT = 81;
+ int LINK_LABEL_ALIGNMENT = 82;
/**
* The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.ViewmapLayoutType Viewmap Layout Type}' enum.
@@ -6164,7 +6210,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getViewmapLayoutType()
* @generated
*/
- int VIEWMAP_LAYOUT_TYPE = 82;
+ int VIEWMAP_LAYOUT_TYPE = 83;
/**
* The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.GenSeverity Gen Severity}' enum.
@@ -6174,7 +6220,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenSeverity()
* @generated
*/
- int GEN_SEVERITY = 83;
+ int GEN_SEVERITY = 84;
/**
* The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.GenLanguage Gen Language}' enum.
@@ -6184,7 +6230,7 @@
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenLanguage()
* @generated
*/
- int GEN_LANGUAGE = 84;
+ int GEN_LANGUAGE = 85;
/**
@@ -8455,6 +8501,49 @@
EAttribute getColorAttributes_BackgroundColor();
/**
+ * Returns the meta object for class '{@link org.eclipse.gmf.codegen.gmfgen.StyleAttributes Style Attributes}'.
+ *
+ *
+ * @return the meta object for class 'Style Attributes'.
+ * @see org.eclipse.gmf.codegen.gmfgen.StyleAttributes
+ * @generated
+ */
+ EClass getStyleAttributes();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.gmf.codegen.gmfgen.StyleAttributes#isFixedFont Fixed Font}'.
+ *
+ *
+ * @return the meta object for the attribute 'Fixed Font'.
+ * @see org.eclipse.gmf.codegen.gmfgen.StyleAttributes#isFixedFont()
+ * @see #getStyleAttributes()
+ * @generated
+ */
+ EAttribute getStyleAttributes_FixedFont();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.gmf.codegen.gmfgen.StyleAttributes#isFixedForeground Fixed Foreground}'.
+ *
+ *
+ * @return the meta object for the attribute 'Fixed Foreground'.
+ * @see org.eclipse.gmf.codegen.gmfgen.StyleAttributes#isFixedForeground()
+ * @see #getStyleAttributes()
+ * @generated
+ */
+ EAttribute getStyleAttributes_FixedForeground();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.gmf.codegen.gmfgen.StyleAttributes#isFixedBackground Fixed Background}'.
+ *
+ *
+ * @return the meta object for the attribute 'Fixed Background'.
+ * @see org.eclipse.gmf.codegen.gmfgen.StyleAttributes#isFixedBackground()
+ * @see #getStyleAttributes()
+ * @generated
+ */
+ EAttribute getStyleAttributes_FixedBackground();
+
+ /**
* Returns the meta object for class '{@link org.eclipse.gmf.codegen.gmfgen.ResizeConstraints Resize Constraints}'.
*
*
Index: src/org/eclipse/gmf/codegen/gmfgen/GMFGenFactory.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GMFGenFactory.java,v
retrieving revision 1.35
diff -u -r1.35 GMFGenFactory.java
--- src/org/eclipse/gmf/codegen/gmfgen/GMFGenFactory.java 9 Jun 2006 12:31:18 -0000 1.35
+++ src/org/eclipse/gmf/codegen/gmfgen/GMFGenFactory.java 19 Jun 2006 11:02:42 -0000
@@ -242,6 +242,15 @@
ColorAttributes createColorAttributes();
/**
+ * Returns a new object of class 'Style Attributes'.
+ *
+ *
+ * @return a new object of class 'Style Attributes'.
+ * @generated
+ */
+ StyleAttributes createStyleAttributes();
+
+ /**
* Returns a new object of class 'Resize Constraints'.
*
*
Index: templates/providers/ViewFactory.javajet
===================================================================
RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen/templates/providers/ViewFactory.javajet,v
retrieving revision 1.35
diff -u -r1.35 ViewFactory.javajet
--- templates/providers/ViewFactory.javajet 6 Jun 2006 17:48:31 -0000 1.35
+++ templates/providers/ViewFactory.javajet 19 Jun 2006 11:02:50 -0000
@@ -14,11 +14,14 @@
importManager.markImportLocation(stringBuffer);
+final boolean isLink = genElement instanceof GenLink;
+final boolean isLabel = genElement instanceof GenChildLabelNode;
+final boolean isDiagram = genElement instanceof GenDiagram;
+final boolean isCompartment = genElement instanceof GenCompartment;
+final boolean isShape = !isLink && !isLabel && !isDiagram && !isCompartment; // captures else
+assert isLink || isLabel || isDiagram || isCompartment || isShape;
-boolean isLink = genElement instanceof GenLink;
-boolean isDiagram = genElement instanceof GenDiagram;
-boolean isCompartment = genElement instanceof GenCompartment;
-boolean isNode = !isLink && !isDiagram && !isCompartment;
+final boolean isNode = !isLink && !isDiagram && !isCompartment;
boolean isCompartmentWithOwnBounds = false;
if (isCompartment){
GenCompartment genCompartment = (GenCompartment)genElement;
@@ -32,17 +35,77 @@
public class <%=genElement.getNotationViewFactoryClassName()%> extends
<%if (isLink) {%>
<%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.view.factories.ConnectionViewFactory")%>
-<%} else if (genElement instanceof GenChildLabelNode) {%>
+<%} else if (isLabel) {%>
<%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory")%>
<%} else if (isCompartment) {%>
<%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.view.factories.ListCompartmentViewFactory")%>
<%} else if (isDiagram) {%>
<%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.view.factories.DiagramViewFactory")%>
-<%} else {%>
+<%} else if (isShape) {%>
<%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractShapeViewFactory")%>
-<%}%>
+<%} else {
+ throw new IllegalStateException("Unknown case for " + genElement);
+}%>
{
+ /*
+ * @generated
+ */
+ protected List createStyles(View view) {
+ <%=importManager.getImportedName("java.util.List")%> styles = new <%=importManager.getImportedName("java.util.ArrayList")%>();
+<%
+if (isLink) {
+%>
+ styles.add(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createRoutingStyle());
+<%
+ Viewmap viewmap = genElement.getViewmap();
+ StyleAttributes styleAttributes = (viewmap == null) ? null : (StyleAttributes)viewmap.find(StyleAttributes.class);
+ boolean fixedForeground = styleAttributes != null && styleAttributes.isFixedForeground();
+ if (!fixedForeground) {
+%>
+ styles.add(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createLineStyle());
+<%
+ } //fixedForeground
+}
+if (isLabel) {
+ //no styles for label
+}
+if (isDiagram) {
+%>
+ styles.add(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createPageStyle());
+ styles.add(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createGuideStyle());
+ styles.add(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createDescriptionStyle());
+<%
+}
+if (isCompartment) {
+ GenCompartment genCompartment = (GenCompartment)genElement;
+ if (genCompartment.isCanCollapse()){
+%>
+ styles.add(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createDrawerStyle());
+<%
+ }
+ if (genCompartment.isNeedsTitle()){
+%>
+ styles.add(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createTitleStyle());
+<%
+ }
+%>
+ styles.add(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createSortingStyle());
+ styles.add(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createFilteringStyle());
+<%
+}
+if (isShape || isCompartmentWithOwnBounds) {
+%>
+ styles.add(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createFontStyle());
+ styles.add(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createDescriptionStyle());
+ styles.add(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createFillStyle());
+ styles.add(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createLineStyle());
+<%
+}
+%>
+ return styles;
+ }
+
/**
* @generated
*/
@@ -121,15 +184,6 @@
/**
* @generated
*/
- protected <%=importManager.getImportedName("java.util.List")%> createStyles(View view) {
- <%=importManager.getImportedName("java.util.List")%> styles = super.createStyles(view);
- styles.add(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createShapeStyle());
- return styles;
- }
-
- /**
- * @generated
- */
protected <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.LayoutConstraint")%> createLayoutConstraint() {
return <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createBounds();
}
@@ -167,18 +221,9 @@
*/
protected void setupCompartmentTitle(View view) {
<%=titleStyleFQN%> titleStyle = (<%=titleStyleFQN%>)view.getStyle(<%=notationPackageFQN%>.eINSTANCE.getTitleStyle());
-<%
-if(genCompartment.isNeedsTitle()){
-%>
- if (titleStyle == null){
- titleStyle = (<%=titleStyleFQN%>) view.createStyle(<%=notationPackageFQN%>.eINSTANCE.getTitleStyle());
- }
- titleStyle.setShowTitle(true);
-<%} else {%>
if (titleStyle != null){
- view.getStyles().remove(titleStyle);
+ titleStyle.setShowTitle(true);
}
-<%}%>
}
/**
@@ -186,20 +231,11 @@
*/
protected void setupCompartmentCollapsed(View view) {
<%=drawerStyleFQN%> drawerStyle = (<%=drawerStyleFQN%>)view.getStyle(<%=notationPackageFQN%>.eINSTANCE.getDrawerStyle());
-<%
-if(genCompartment.isCanCollapse()){
-%>
- if (drawerStyle == null){
- drawerStyle = (<%=drawerStyleFQN%>) view.createStyle(<%=notationPackageFQN%>.eINSTANCE.getDrawerStyle());
- }
- drawerStyle.setCollapsed(false);
-<%} else {%>
if (drawerStyle != null){
- view.getStyles().remove(drawerStyle);
+ drawerStyle.setCollapsed(false);
}
-<%}%>
}
-
<%}%>
+
}
<%importManager.emitSortedImports();%>
Index: models/gmfgen.genmodel
===================================================================
RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen/models/gmfgen.genmodel,v
retrieving revision 1.121
diff -u -r1.121 gmfgen.genmodel
--- models/gmfgen.genmodel 13 Jun 2006 15:10:43 -0000 1.121
+++ models/gmfgen.genmodel 19 Jun 2006 11:02:42 -0000
@@ -360,6 +360,11 @@
+
+
+
+
+
Index: models/gmfgen.ecore
===================================================================
RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen/models/gmfgen.ecore,v
retrieving revision 1.136
diff -u -r1.136 gmfgen.ecore
--- models/gmfgen.ecore 13 Jun 2006 15:10:43 -0000 1.136
+++ models/gmfgen.ecore 19 Jun 2006 11:02:42 -0000
@@ -773,9 +773,20 @@
+
+
+
+
+
+
+
+
Index: src/org/eclipse/gmf/codegen/gmfgen/util/GMFGenSwitch.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/util/GMFGenSwitch.java,v
retrieving revision 1.48
diff -u -r1.48 GMFGenSwitch.java
--- src/org/eclipse/gmf/codegen/gmfgen/util/GMFGenSwitch.java 9 Jun 2006 12:31:18 -0000 1.48
+++ src/org/eclipse/gmf/codegen/gmfgen/util/GMFGenSwitch.java 19 Jun 2006 11:02:50 -0000
@@ -480,6 +480,13 @@
if (result == null) result = defaultCase(theEObject);
return result;
}
+ case GMFGenPackage.STYLE_ATTRIBUTES: {
+ StyleAttributes styleAttributes = (StyleAttributes)theEObject;
+ Object result = caseStyleAttributes(styleAttributes);
+ if (result == null) result = caseAttributes(styleAttributes);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
case GMFGenPackage.RESIZE_CONSTRAINTS: {
ResizeConstraints resizeConstraints = (ResizeConstraints)theEObject;
Object result = caseResizeConstraints(resizeConstraints);
@@ -1394,6 +1401,21 @@
}
/**
+ * Returns the result of interpretting the object as an instance of 'Style Attributes'.
+ *
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ *
+ * @param object the target of the switch.
+ * @return the result of interpretting the object as an instance of 'Style Attributes'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public Object caseStyleAttributes(StyleAttributes object) {
+ return null;
+ }
+
+ /**
* Returns the result of interpretting the object as an instance of 'Resize Constraints'.
*
* This implementation returns null;
Index: src/org/eclipse/gmf/codegen/gmfgen/util/GMFGenAdapterFactory.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/util/GMFGenAdapterFactory.java,v
retrieving revision 1.48
diff -u -r1.48 GMFGenAdapterFactory.java
--- src/org/eclipse/gmf/codegen/gmfgen/util/GMFGenAdapterFactory.java 9 Jun 2006 12:31:18 -0000 1.48
+++ src/org/eclipse/gmf/codegen/gmfgen/util/GMFGenAdapterFactory.java 19 Jun 2006 11:02:49 -0000
@@ -271,6 +271,9 @@
public Object caseColorAttributes(ColorAttributes object) {
return createColorAttributesAdapter();
}
+ public Object caseStyleAttributes(StyleAttributes object) {
+ return createStyleAttributesAdapter();
+ }
public Object caseResizeConstraints(ResizeConstraints object) {
return createResizeConstraintsAdapter();
}
@@ -1006,6 +1009,20 @@
}
/**
+ * Creates a new adapter for an object of class '{@link org.eclipse.gmf.codegen.gmfgen.StyleAttributes Style Attributes}'.
+ *
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ *
+ * @return the new adapter.
+ * @see org.eclipse.gmf.codegen.gmfgen.StyleAttributes
+ * @generated
+ */
+ public Adapter createStyleAttributesAdapter() {
+ return null;
+ }
+
+ /**
* Creates a new adapter for an object of class '{@link org.eclipse.gmf.codegen.gmfgen.ResizeConstraints Resize Constraints}'.
*
* This default implementation returns null so that we can easily ignore cases;
Index: src/org/eclipse/gmf/codegen/gmfgen/StyleAttributes.java
===================================================================
RCS file: src/org/eclipse/gmf/codegen/gmfgen/StyleAttributes.java
diff -N src/org/eclipse/gmf/codegen/gmfgen/StyleAttributes.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/eclipse/gmf/codegen/gmfgen/StyleAttributes.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,110 @@
+/**
+ *
+ *
+ *
+ * $Id$
+ */
+package org.eclipse.gmf.codegen.gmfgen;
+
+
+/**
+ *
+ * A representation of the model object 'Style Attributes'.
+ *
+ *
+ *
+ * The following features are supported:
+ *
+ * - {@link org.eclipse.gmf.codegen.gmfgen.StyleAttributes#isFixedFont Fixed Font}
+ * - {@link org.eclipse.gmf.codegen.gmfgen.StyleAttributes#isFixedForeground Fixed Foreground}
+ * - {@link org.eclipse.gmf.codegen.gmfgen.StyleAttributes#isFixedBackground Fixed Background}
+ *
+ *
+ *
+ * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getStyleAttributes()
+ * @model
+ * @generated
+ */
+public interface StyleAttributes extends Attributes {
+ /**
+ * Returns the value of the 'Fixed Font' attribute.
+ * The default value is "false"
.
+ *
+ *
+ * If the meaning of the 'Fixed Font' attribute isn't clear,
+ * there really should be more of a description here...
+ *
+ *
+ * @return the value of the 'Fixed Font' attribute.
+ * @see #setFixedFont(boolean)
+ * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getStyleAttributes_FixedFont()
+ * @model default="false"
+ * @generated
+ */
+ boolean isFixedFont();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.gmf.codegen.gmfgen.StyleAttributes#isFixedFont Fixed Font}' attribute.
+ *
+ *
+ * @param value the new value of the 'Fixed Font' attribute.
+ * @see #isFixedFont()
+ * @generated
+ */
+ void setFixedFont(boolean value);
+
+ /**
+ * Returns the value of the 'Fixed Foreground' attribute.
+ * The default value is "false"
.
+ *
+ *
+ * If the meaning of the 'Fixed Foreground' attribute isn't clear,
+ * there really should be more of a description here...
+ *
+ *
+ * @return the value of the 'Fixed Foreground' attribute.
+ * @see #setFixedForeground(boolean)
+ * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getStyleAttributes_FixedForeground()
+ * @model default="false"
+ * @generated
+ */
+ boolean isFixedForeground();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.gmf.codegen.gmfgen.StyleAttributes#isFixedForeground Fixed Foreground}' attribute.
+ *
+ *
+ * @param value the new value of the 'Fixed Foreground' attribute.
+ * @see #isFixedForeground()
+ * @generated
+ */
+ void setFixedForeground(boolean value);
+
+ /**
+ * Returns the value of the 'Fixed Background' attribute.
+ * The default value is "false"
.
+ *
+ *
+ * If the meaning of the 'Fixed Background' attribute isn't clear,
+ * there really should be more of a description here...
+ *
+ *
+ * @return the value of the 'Fixed Background' attribute.
+ * @see #setFixedBackground(boolean)
+ * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getStyleAttributes_FixedBackground()
+ * @model default="false"
+ * @generated
+ */
+ boolean isFixedBackground();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.gmf.codegen.gmfgen.StyleAttributes#isFixedBackground Fixed Background}' attribute.
+ *
+ *
+ * @param value the new value of the 'Fixed Background' attribute.
+ * @see #isFixedBackground()
+ * @generated
+ */
+ void setFixedBackground(boolean value);
+
+} // StyleAttributes
Index: src/org/eclipse/gmf/codegen/gmfgen/impl/StyleAttributesImpl.java
===================================================================
RCS file: src/org/eclipse/gmf/codegen/gmfgen/impl/StyleAttributesImpl.java
diff -N src/org/eclipse/gmf/codegen/gmfgen/impl/StyleAttributesImpl.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/eclipse/gmf/codegen/gmfgen/impl/StyleAttributesImpl.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,269 @@
+/**
+ *
+ *
+ *
+ * $Id$
+ */
+package org.eclipse.gmf.codegen.gmfgen.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+import org.eclipse.gmf.codegen.gmfgen.GMFGenPackage;
+import org.eclipse.gmf.codegen.gmfgen.StyleAttributes;
+
+/**
+ *
+ * An implementation of the model object 'Style Attributes'.
+ *
+ *
+ * The following features are implemented:
+ *
+ * - {@link org.eclipse.gmf.codegen.gmfgen.impl.StyleAttributesImpl#isFixedFont Fixed Font}
+ * - {@link org.eclipse.gmf.codegen.gmfgen.impl.StyleAttributesImpl#isFixedForeground Fixed Foreground}
+ * - {@link org.eclipse.gmf.codegen.gmfgen.impl.StyleAttributesImpl#isFixedBackground Fixed Background}
+ *
+ *
+ *
+ * @generated
+ */
+public class StyleAttributesImpl extends EObjectImpl implements StyleAttributes {
+ /**
+ * The default value of the '{@link #isFixedFont() Fixed Font}' attribute.
+ *
+ *
+ * @see #isFixedFont()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean FIXED_FONT_EDEFAULT = false;
+
+ /**
+ * The cached value of the '{@link #isFixedFont() Fixed Font}' attribute.
+ *
+ *
+ * @see #isFixedFont()
+ * @generated
+ * @ordered
+ */
+ protected boolean fixedFont = FIXED_FONT_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #isFixedForeground() Fixed Foreground}' attribute.
+ *
+ *
+ * @see #isFixedForeground()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean FIXED_FOREGROUND_EDEFAULT = false;
+
+ /**
+ * The cached value of the '{@link #isFixedForeground() Fixed Foreground}' attribute.
+ *
+ *
+ * @see #isFixedForeground()
+ * @generated
+ * @ordered
+ */
+ protected boolean fixedForeground = FIXED_FOREGROUND_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #isFixedBackground() Fixed Background}' attribute.
+ *
+ *
+ * @see #isFixedBackground()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean FIXED_BACKGROUND_EDEFAULT = false;
+
+ /**
+ * The cached value of the '{@link #isFixedBackground() Fixed Background}' attribute.
+ *
+ *
+ * @see #isFixedBackground()
+ * @generated
+ * @ordered
+ */
+ protected boolean fixedBackground = FIXED_BACKGROUND_EDEFAULT;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ protected StyleAttributesImpl() {
+ super();
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ protected EClass eStaticClass() {
+ return GMFGenPackage.eINSTANCE.getStyleAttributes();
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public boolean isFixedFont() {
+ return fixedFont;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setFixedFont(boolean newFixedFont) {
+ boolean oldFixedFont = fixedFont;
+ fixedFont = newFixedFont;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, GMFGenPackage.STYLE_ATTRIBUTES__FIXED_FONT, oldFixedFont, fixedFont));
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public boolean isFixedForeground() {
+ return fixedForeground;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setFixedForeground(boolean newFixedForeground) {
+ boolean oldFixedForeground = fixedForeground;
+ fixedForeground = newFixedForeground;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, GMFGenPackage.STYLE_ATTRIBUTES__FIXED_FOREGROUND, oldFixedForeground, fixedForeground));
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public boolean isFixedBackground() {
+ return fixedBackground;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setFixedBackground(boolean newFixedBackground) {
+ boolean oldFixedBackground = fixedBackground;
+ fixedBackground = newFixedBackground;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, GMFGenPackage.STYLE_ATTRIBUTES__FIXED_BACKGROUND, oldFixedBackground, fixedBackground));
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case GMFGenPackage.STYLE_ATTRIBUTES__FIXED_FONT:
+ return isFixedFont() ? Boolean.TRUE : Boolean.FALSE;
+ case GMFGenPackage.STYLE_ATTRIBUTES__FIXED_FOREGROUND:
+ return isFixedForeground() ? Boolean.TRUE : Boolean.FALSE;
+ case GMFGenPackage.STYLE_ATTRIBUTES__FIXED_BACKGROUND:
+ return isFixedBackground() ? Boolean.TRUE : Boolean.FALSE;
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case GMFGenPackage.STYLE_ATTRIBUTES__FIXED_FONT:
+ setFixedFont(((Boolean)newValue).booleanValue());
+ return;
+ case GMFGenPackage.STYLE_ATTRIBUTES__FIXED_FOREGROUND:
+ setFixedForeground(((Boolean)newValue).booleanValue());
+ return;
+ case GMFGenPackage.STYLE_ATTRIBUTES__FIXED_BACKGROUND:
+ setFixedBackground(((Boolean)newValue).booleanValue());
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case GMFGenPackage.STYLE_ATTRIBUTES__FIXED_FONT:
+ setFixedFont(FIXED_FONT_EDEFAULT);
+ return;
+ case GMFGenPackage.STYLE_ATTRIBUTES__FIXED_FOREGROUND:
+ setFixedForeground(FIXED_FOREGROUND_EDEFAULT);
+ return;
+ case GMFGenPackage.STYLE_ATTRIBUTES__FIXED_BACKGROUND:
+ setFixedBackground(FIXED_BACKGROUND_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case GMFGenPackage.STYLE_ATTRIBUTES__FIXED_FONT:
+ return fixedFont != FIXED_FONT_EDEFAULT;
+ case GMFGenPackage.STYLE_ATTRIBUTES__FIXED_FOREGROUND:
+ return fixedForeground != FIXED_FOREGROUND_EDEFAULT;
+ case GMFGenPackage.STYLE_ATTRIBUTES__FIXED_BACKGROUND:
+ return fixedBackground != FIXED_BACKGROUND_EDEFAULT;
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (fixedFont: ");
+ result.append(fixedFont);
+ result.append(", fixedForeground: ");
+ result.append(fixedForeground);
+ result.append(", fixedBackground: ");
+ result.append(fixedBackground);
+ result.append(')');
+ return result.toString();
+ }
+
+} //StyleAttributesImpl