Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 44989 Details for
Bug 147853
Fonts defined in the gmfgraph model should be used by the generated labels
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Fixes the subj
patch_147853.txt (text/plain), 167.85 KB, created by
Michael Golubev
on 2006-06-21 08:22:05 EDT
(
hide
)
Description:
Fixes the subj
Filename:
MIME Type:
Creator:
Michael Golubev
Created:
2006-06-21 08:22:05 EDT
Size:
167.85 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.gmf.codegen >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.45 >diff -u -r1.45 ViewFactoryGenerator.java >--- src-templates/org/eclipse/gmf/codegen/templates/providers/ViewFactoryGenerator.java 19 Jun 2006 12:42:03 -0000 1.45 >+++ src-templates/org/eclipse/gmf/codegen/templates/providers/ViewFactoryGenerator.java 21 Jun 2006 12:24:58 -0000 >@@ -47,73 +47,74 @@ > 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\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; >+ protected final String TEXT_31 = ".eINSTANCE.createFontStyle());"; >+ protected final String TEXT_32 = NL + "\t\tstyles.add("; >+ protected final String TEXT_33 = ".eINSTANCE.createDescriptionStyle());" + NL + "\t\tstyles.add("; >+ protected final String TEXT_34 = ".eINSTANCE.createFillStyle());" + NL + "\t\tstyles.add("; >+ protected final String TEXT_35 = ".eINSTANCE.createLineStyle());"; >+ protected final String TEXT_36 = NL + "\t\treturn styles;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */"; >+ protected final String TEXT_37 = NL + "\tprotected void decorateView(View view, IAdaptable semanticAdapter, String diagramKind){" + NL + "\t\tsuper.decorateView(view, semanticAdapter, diagramKind);"; >+ protected final String TEXT_38 = 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_39 = NL + "\t\t\tsemanticHint = "; >+ protected final String TEXT_40 = ".getType("; >+ protected final String TEXT_41 = ".VISUAL_ID);" + NL + "\t\t\tview.setType(semanticHint);" + NL + "\t\t}"; >+ protected final String TEXT_42 = NL + "\t\tsuper.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);"; >+ protected final String TEXT_43 = NL + "\t\tsetupCompartmentTitle(view);" + NL + "\t\tsetupCompartmentCollapsed(view);"; >+ protected final String TEXT_44 = "\t\t" + NL + "\t\tif (!"; >+ protected final String TEXT_45 = ".MODEL_ID.equals("; >+ protected final String TEXT_46 = ".getModelID(containerView))) {" + NL + "\t\t\t"; >+ protected final String TEXT_47 = " shortcutAnnotation = "; >+ protected final String TEXT_48 = ".eINSTANCE.createEAnnotation();" + NL + "\t\t\tshortcutAnnotation.setSource(\"Shortcut\"); //$NON-NLS-1$" + NL + "\t\t\tshortcutAnnotation.getDetails().put(\"modelID\", "; >+ protected final String TEXT_49 = ".MODEL_ID); //$NON-NLS-1$" + NL + "\t\t\tview.getEAnnotations().add(shortcutAnnotation);" + NL + "\t\t}"; >+ protected final String TEXT_50 = NL + "\t\t"; >+ protected final String TEXT_51 = ".setStructuralFeatureValue(view, "; >+ protected final String TEXT_52 = ".eINSTANCE.getLineStyle_LineColor()," + NL + "\t\t\t"; >+ protected final String TEXT_53 = ".colorToInteger("; >+ protected final String TEXT_54 = "."; >+ protected final String TEXT_55 = "));"; >+ protected final String TEXT_56 = NL + "\t\t"; >+ protected final String TEXT_57 = ".setStructuralFeatureValue(view, "; >+ protected final String TEXT_58 = ".eINSTANCE.getFillStyle_FillColor()," + NL + "\t\t\t"; >+ protected final String TEXT_59 = ".colorToInteger("; >+ protected final String TEXT_60 = "."; >+ protected final String TEXT_61 = "));"; >+ protected final String TEXT_62 = NL + "\t\tgetViewService().createNode(semanticAdapter, view, "; >+ protected final String TEXT_63 = ".getType("; >+ protected final String TEXT_64 = ".VISUAL_ID)," + NL + "\t\t\t"; >+ protected final String TEXT_65 = ".APPEND, true, getPreferencesHint());"; >+ protected final String TEXT_66 = NL + "\t\tgetViewService().createNode(semanticAdapter, view, "; >+ protected final String TEXT_67 = ".getType("; >+ protected final String TEXT_68 = ".VISUAL_ID)," + NL + "\t\t\t"; >+ protected final String TEXT_69 = ".APPEND, true, getPreferencesHint());"; >+ protected final String TEXT_70 = NL + "\t\tgetViewService().createNode(semanticAdapter, view, "; >+ protected final String TEXT_71 = ".getType("; >+ protected final String TEXT_72 = ".VISUAL_ID)," + NL + "\t\t\t"; >+ protected final String TEXT_73 = ".APPEND, true, getPreferencesHint());"; >+ protected final String TEXT_74 = NL + "\t}"; >+ protected final String TEXT_75 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >+ protected final String TEXT_76 = " createLayoutConstraint() {" + NL + "\t\treturn "; >+ protected final String TEXT_77 = ".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_78 = " store = ("; >+ protected final String TEXT_79 = ") getPreferencesHint().getPreferenceStore();" + NL + "" + NL + "\t\t// fill color" + NL + "\t\t"; >+ protected final String TEXT_80 = " fillRGB = "; >+ protected final String TEXT_81 = ".getColor(store, "; >+ protected final String TEXT_82 = ".PREF_FILL_COLOR);" + NL + "\t\t"; >+ protected final String TEXT_83 = ".setStructuralFeatureValue(view, "; >+ protected final String TEXT_84 = ".eINSTANCE.getFillStyle_FillColor(), "; >+ protected final String TEXT_85 = ".RGBToInteger(fillRGB));" + NL + "\t}"; >+ protected final String TEXT_86 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >+ protected final String TEXT_87 = " getMeasurementUnit() {" + NL + "\t\treturn "; >+ protected final String TEXT_88 = "."; >+ protected final String TEXT_89 = "_LITERAL;" + NL + "\t}"; >+ protected final String TEXT_90 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void setupCompartmentTitle(View view) {" + NL + "\t\t"; >+ protected final String TEXT_91 = " titleStyle = ("; >+ protected final String TEXT_92 = ")view.getStyle("; >+ protected final String TEXT_93 = ".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_94 = " drawerStyle = ("; >+ protected final String TEXT_95 = ")view.getStyle("; >+ protected final String TEXT_96 = ".eINSTANCE.getDrawerStyle());" + NL + "\t\tif (drawerStyle != null){" + NL + "\t\t\tdrawerStyle.setCollapsed(false);" + NL + "\t\t}" + NL + "\t}"; >+ protected final String TEXT_97 = NL + NL + "}"; >+ protected final String TEXT_98 = NL; > > public String generate(Object argument) > { >@@ -154,6 +155,11 @@ > isCompartmentWithOwnBounds = ViewmapLayoutTypeHelper.getSharedInstance().isStoringChildPositions(genCompartment.getNode()); > } > >+Viewmap viewmap = genElement.getViewmap(); >+StyleAttributes styleAttributes = (viewmap == null) ? null : (StyleAttributes)viewmap.find(StyleAttributes.class); >+boolean fixedForeground = styleAttributes != null && styleAttributes.isFixedForeground(); >+boolean fixedFont = styleAttributes != null && styleAttributes.isFixedFont(); >+ > stringBuffer.append(TEXT_5); > stringBuffer.append(genElement.getNotationViewFactoryClassName()); > stringBuffer.append(TEXT_6); >@@ -187,9 +193,6 @@ > 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); >@@ -200,6 +203,7 @@ > } > if (isLabel) { > //no styles for label >+ //FIXME: throw new IllegalStateExcpetion("Labels to be processed in the LabelTextViewFactory/LabelViewFactory"); > } > if (isDiagram) { > >@@ -237,108 +241,113 @@ > > } > if (isShape || isCompartmentWithOwnBounds) { >+ if (!fixedFont){ > > 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(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); >+ stringBuffer.append(TEXT_35); > > } > >- stringBuffer.append(TEXT_35); >+ stringBuffer.append(TEXT_36); > > if (isDiagram) { > >- stringBuffer.append(TEXT_36); >+ stringBuffer.append(TEXT_37); > > } else { > >- stringBuffer.append(TEXT_37); >- /* [++] important for the create shortcut functionality*/ > stringBuffer.append(TEXT_38); >- stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); >+ /* [++] important for the create shortcut functionality*/ > stringBuffer.append(TEXT_39); >- stringBuffer.append(genElement.getEditPartQualifiedClassName()); >+ stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); > stringBuffer.append(TEXT_40); >- /* [--] important for the create shortcut functionality*/ >+ stringBuffer.append(genElement.getEditPartQualifiedClassName()); > stringBuffer.append(TEXT_41); >- if (isCompartment){ >+ /* [--] important for the create shortcut functionality*/ > stringBuffer.append(TEXT_42); >- } >+ if (isCompartment){ > stringBuffer.append(TEXT_43); >- stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartQualifiedClassName())); >+ } > stringBuffer.append(TEXT_44); >- stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); >+ stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartQualifiedClassName())); > stringBuffer.append(TEXT_45); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAnnotation")); >+ stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); > stringBuffer.append(TEXT_46); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EcoreFactory")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAnnotation")); > stringBuffer.append(TEXT_47); >- stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartQualifiedClassName())); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EcoreFactory")); > stringBuffer.append(TEXT_48); >+ stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartQualifiedClassName())); >+ stringBuffer.append(TEXT_49); > > } > > 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_49); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil")); > stringBuffer.append(TEXT_50); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil")); > stringBuffer.append(TEXT_51); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_52); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ColorConstants")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities")); > stringBuffer.append(TEXT_53); >- stringBuffer.append(colorAttrs.getForegroundColor()); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ColorConstants")); > stringBuffer.append(TEXT_54); >+ stringBuffer.append(colorAttrs.getForegroundColor()); >+ stringBuffer.append(TEXT_55); > > } > if (isNode) { > GenNode genNode = (GenNode) genElement; > if (colorAttrs != null && colorAttrs.getBackgroundColor() != null && colorAttrs.getBackgroundColor().trim().length() > 0) { >- stringBuffer.append(TEXT_55); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil")); > stringBuffer.append(TEXT_56); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil")); > stringBuffer.append(TEXT_57); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_58); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ColorConstants")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities")); > stringBuffer.append(TEXT_59); >- stringBuffer.append(colorAttrs.getBackgroundColor()); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ColorConstants")); > stringBuffer.append(TEXT_60); >+ stringBuffer.append(colorAttrs.getBackgroundColor()); >+ stringBuffer.append(TEXT_61); > > } > List labels = genNode.getLabels(); > for (int j = 0; j < labels.size(); j++) { > GenNodeLabel label = (GenNodeLabel) labels.get(j); > >- stringBuffer.append(TEXT_61); >- stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); > stringBuffer.append(TEXT_62); >- stringBuffer.append(importManager.getImportedName(label.getEditPartQualifiedClassName())); >+ stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); > stringBuffer.append(TEXT_63); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil")); >+ stringBuffer.append(importManager.getImportedName(label.getEditPartQualifiedClassName())); > stringBuffer.append(TEXT_64); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil")); >+ stringBuffer.append(TEXT_65); > > } > List genChildContainers = genNode.getCompartments(); > for (int j = 0; j < genChildContainers.size(); j++) { > GenCompartment genChildContainer = (GenCompartment) genChildContainers.get(j); > >- stringBuffer.append(TEXT_65); >- stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); > stringBuffer.append(TEXT_66); >- stringBuffer.append(importManager.getImportedName(genChildContainer.getEditPartQualifiedClassName())); >+ stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); > stringBuffer.append(TEXT_67); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil")); >+ stringBuffer.append(importManager.getImportedName(genChildContainer.getEditPartQualifiedClassName())); > stringBuffer.append(TEXT_68); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil")); >+ stringBuffer.append(TEXT_69); > > } > } else if (isLink) { >@@ -347,49 +356,49 @@ > for (int j = 0; j < labels.size(); j++) { > GenLinkLabel label = (GenLinkLabel) labels.get(j); > >- stringBuffer.append(TEXT_69); >- stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); > stringBuffer.append(TEXT_70); >- stringBuffer.append(importManager.getImportedName(label.getEditPartQualifiedClassName())); >+ stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); > stringBuffer.append(TEXT_71); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil")); >+ stringBuffer.append(importManager.getImportedName(label.getEditPartQualifiedClassName())); > stringBuffer.append(TEXT_72); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil")); >+ stringBuffer.append(TEXT_73); > > } > } > >- stringBuffer.append(TEXT_73); >- if (isCompartmentWithOwnBounds) { > stringBuffer.append(TEXT_74); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.LayoutConstraint")); >+ if (isCompartmentWithOwnBounds) { > stringBuffer.append(TEXT_75); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.LayoutConstraint")); > stringBuffer.append(TEXT_76); >- stringBuffer.append(importManager.getImportedName("org.eclipse.jface.preference.IPreferenceStore")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); > stringBuffer.append(TEXT_77); > stringBuffer.append(importManager.getImportedName("org.eclipse.jface.preference.IPreferenceStore")); > stringBuffer.append(TEXT_78); >- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.RGB")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.jface.preference.IPreferenceStore")); > stringBuffer.append(TEXT_79); >- stringBuffer.append(importManager.getImportedName("org.eclipse.jface.preference.PreferenceConverter")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.RGB")); > stringBuffer.append(TEXT_80); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.jface.preference.PreferenceConverter")); > stringBuffer.append(TEXT_81); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants")); > stringBuffer.append(TEXT_82); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil")); > stringBuffer.append(TEXT_83); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_84); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities")); >+ stringBuffer.append(TEXT_85); > } > if (isDiagram && genDiagram.getUnits() != null && genDiagram.getUnits().trim().length() > 0) { >- stringBuffer.append(TEXT_85); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.MeasurementUnit")); > stringBuffer.append(TEXT_86); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.MeasurementUnit")); > stringBuffer.append(TEXT_87); >- stringBuffer.append(genDiagram.getUnits().toUpperCase()); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.MeasurementUnit")); > stringBuffer.append(TEXT_88); >+ stringBuffer.append(genDiagram.getUnits().toUpperCase()); >+ stringBuffer.append(TEXT_89); > } > > if (isCompartment) { >@@ -397,23 +406,23 @@ > String drawerStyleFQN = importManager.getImportedName("org.eclipse.gmf.runtime.notation.DrawerStyle"); > String notationPackageFQN = importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"); > >- stringBuffer.append(TEXT_89); >- stringBuffer.append(titleStyleFQN); > stringBuffer.append(TEXT_90); > stringBuffer.append(titleStyleFQN); > stringBuffer.append(TEXT_91); >- stringBuffer.append(notationPackageFQN); >+ stringBuffer.append(titleStyleFQN); > stringBuffer.append(TEXT_92); >- stringBuffer.append(drawerStyleFQN); >+ stringBuffer.append(notationPackageFQN); > stringBuffer.append(TEXT_93); > stringBuffer.append(drawerStyleFQN); > stringBuffer.append(TEXT_94); >- stringBuffer.append(notationPackageFQN); >+ stringBuffer.append(drawerStyleFQN); > stringBuffer.append(TEXT_95); >- } >+ stringBuffer.append(notationPackageFQN); > stringBuffer.append(TEXT_96); >- importManager.emitSortedImports(); >+ } > stringBuffer.append(TEXT_97); >+ importManager.emitSortedImports(); >+ stringBuffer.append(TEXT_98); > return stringBuffer.toString(); > } > } >Index: src-templates/org/eclipse/gmf/codegen/templates/providers/LabelViewFactoryGenerator.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/providers/LabelViewFactoryGenerator.java,v >retrieving revision 1.18 >diff -u -r1.18 LabelViewFactoryGenerator.java >--- src-templates/org/eclipse/gmf/codegen/templates/providers/LabelViewFactoryGenerator.java 9 Jun 2006 12:31:18 -0000 1.18 >+++ src-templates/org/eclipse/gmf/codegen/templates/providers/LabelViewFactoryGenerator.java 21 Jun 2006 12:24:57 -0000 >@@ -20,12 +20,13 @@ > protected final String TEXT_3 = NL + " */"; > protected final String TEXT_4 = NL + NL + "import org.eclipse.core.runtime.IAdaptable;" + NL + "import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory;" + NL + "import org.eclipse.gmf.runtime.notation.View;"; > protected final String TEXT_5 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class "; >- protected final String TEXT_6 = " extends AbstractLabelViewFactory {" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void decorateView(View containerView, View view, IAdaptable semanticAdapter," + NL + "\t\tString semanticHint, int index, boolean persisted) {" + NL + "\t\tsuper.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);" + NL + "\t}"; >- protected final String TEXT_7 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected List createStyles(View view) {" + NL + "\t\t"; >- protected final String TEXT_8 = " styles = super.createStyles(view);" + NL + "\t\tstyles.add("; >- protected final String TEXT_9 = ".eINSTANCE.createDescriptionStyle());" + NL + "\t\treturn styles;" + NL + "\t}"; >- protected final String TEXT_10 = NL + "}"; >- protected final String TEXT_11 = NL; >+ protected final String TEXT_6 = " extends AbstractLabelViewFactory {" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void decorateView(View containerView, View view, IAdaptable semanticAdapter," + NL + "\t\tString semanticHint, int index, boolean persisted) {" + NL + "\t\tsuper.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);" + NL + "\t}" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected List createStyles(View view) {" + NL + "\t\t"; >+ protected final String TEXT_7 = " styles = new "; >+ protected final String TEXT_8 = "();"; >+ protected final String TEXT_9 = NL + "\t\tstyles.add("; >+ protected final String TEXT_10 = ".eINSTANCE.createDescriptionStyle());"; >+ protected final String TEXT_11 = NL + "\t\treturn styles;" + NL + "\t}" + NL + "}"; >+ protected final String TEXT_12 = NL; > > public String generate(Object argument) > { >@@ -50,16 +51,18 @@ > stringBuffer.append(TEXT_5); > stringBuffer.append(genLabel.getNotationViewFactoryClassName()); > stringBuffer.append(TEXT_6); >- if (genLabel.getModelFacet() instanceof DesignLabelModelFacet) { >- stringBuffer.append(TEXT_7); > stringBuffer.append(importManager.getImportedName("java.util.List")); >+ stringBuffer.append(TEXT_7); >+ stringBuffer.append(importManager.getImportedName("java.util.ArrayList")); > stringBuffer.append(TEXT_8); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); >+ if (genLabel.getModelFacet() instanceof DesignLabelModelFacet) { > stringBuffer.append(TEXT_9); >- } >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); > stringBuffer.append(TEXT_10); >- importManager.emitSortedImports(); >+ } > stringBuffer.append(TEXT_11); >+ importManager.emitSortedImports(); >+ stringBuffer.append(TEXT_12); > return stringBuffer.toString(); > } > } >Index: src-templates/org/eclipse/gmf/codegen/templates/providers/LabelTextViewFactoryGenerator.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/providers/LabelTextViewFactoryGenerator.java,v >retrieving revision 1.20 >diff -u -r1.20 LabelTextViewFactoryGenerator.java >--- src-templates/org/eclipse/gmf/codegen/templates/providers/LabelTextViewFactoryGenerator.java 9 Jun 2006 12:31:18 -0000 1.20 >+++ src-templates/org/eclipse/gmf/codegen/templates/providers/LabelTextViewFactoryGenerator.java 21 Jun 2006 12:24:57 -0000 >@@ -22,12 +22,18 @@ > protected final String TEXT_4 = NL + NL + "import org.eclipse.core.runtime.IAdaptable;" + NL + "import org.eclipse.gmf.runtime.notation.View;"; > protected final String TEXT_5 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class "; > protected final String TEXT_6 = " extends "; >- protected final String TEXT_7 = " {" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {" + NL + "\t\tsuper.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);" + NL + "\t}"; >- protected final String TEXT_8 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected List createStyles(View view) {" + NL + "\t\t"; >- protected final String TEXT_9 = " styles = super.createStyles(view);" + NL + "\t\tstyles.add("; >- protected final String TEXT_10 = ".eINSTANCE.createDescriptionStyle());" + NL + "\t\treturn styles;" + NL + "\t}"; >- protected final String TEXT_11 = NL + "}"; >- protected final String TEXT_12 = NL; >+ protected final String TEXT_7 = " {" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {" + NL + "\t\tsuper.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected List createStyles(View view) {" + NL + "\t\t"; >+ protected final String TEXT_8 = " styles = new "; >+ protected final String TEXT_9 = "();"; >+ protected final String TEXT_10 = NL + "\t\tstyles.add("; >+ protected final String TEXT_11 = ".eINSTANCE.createDescriptionStyle());"; >+ protected final String TEXT_12 = NL + "\t\tstyles.add("; >+ protected final String TEXT_13 = ".eINSTANCE.createFillStyle());" + NL + "\t\tstyles.add("; >+ protected final String TEXT_14 = ".eINSTANCE.createLineStyle());"; >+ protected final String TEXT_15 = "\t\t" + NL + "\t\tstyles.add("; >+ protected final String TEXT_16 = ".eINSTANCE.createFontStyle());"; >+ protected final String TEXT_17 = NL + "\t\treturn styles;" + NL + "\t}" + NL + "}"; >+ protected final String TEXT_18 = NL; > > public String generate(Object argument) > { >@@ -38,6 +44,13 @@ > GenDiagram genDiagram = genLabel.getDiagram(); > ViewmapLayoutTypeHelper layoutHelper = ViewmapLayoutTypeHelper.getSharedInstance(); > >+final boolean hasShapeStyles = layoutHelper.isStoringChildPositions(genLabel.getNode()); >+final boolean isDesignLabel = genLabel.getModelFacet() instanceof DesignLabelModelFacet; >+ >+Viewmap viewmap = genLabel.getViewmap(); >+StyleAttributes styleAttributes = (viewmap == null) ? null : (StyleAttributes)viewmap.find(StyleAttributes.class); >+final boolean isFixedFont = styleAttributes != null && styleAttributes.isFixedFont(); >+ > stringBuffer.append(TEXT_1); > > String copyrightText = genDiagram.getEditorGen().getCopyrightText(); >@@ -57,16 +70,38 @@ > importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractShapeViewFactory") : > importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.view.factories.BasicNodeViewFactory")); > stringBuffer.append(TEXT_7); >- if (genLabel.getModelFacet() instanceof DesignLabelModelFacet) { >- stringBuffer.append(TEXT_8); > stringBuffer.append(importManager.getImportedName("java.util.List")); >+ stringBuffer.append(TEXT_8); >+ stringBuffer.append(importManager.getImportedName("java.util.ArrayList")); > stringBuffer.append(TEXT_9); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); >+ >+if (hasShapeStyles || isDesignLabel) { >+ > stringBuffer.append(TEXT_10); >- } >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); > stringBuffer.append(TEXT_11); >- importManager.emitSortedImports(); >+ >+} >+if (hasShapeStyles) { >+ > stringBuffer.append(TEXT_12); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); >+ stringBuffer.append(TEXT_13); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); >+ stringBuffer.append(TEXT_14); >+ >+ if (!isFixedFont) { >+ >+ stringBuffer.append(TEXT_15); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); >+ stringBuffer.append(TEXT_16); >+ >+ } >+} >+ >+ stringBuffer.append(TEXT_17); >+ importManager.emitSortedImports(); >+ stringBuffer.append(TEXT_18); > return stringBuffer.toString(); > } > } >Index: src-templates/org/eclipse/gmf/codegen/templates/parts/ExternalNodeLabelEditPartGenerator.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/parts/ExternalNodeLabelEditPartGenerator.java,v >retrieving revision 1.36 >diff -u -r1.36 ExternalNodeLabelEditPartGenerator.java >--- src-templates/org/eclipse/gmf/codegen/templates/parts/ExternalNodeLabelEditPartGenerator.java 9 Jun 2006 12:31:18 -0000 1.36 >+++ src-templates/org/eclipse/gmf/codegen/templates/parts/ExternalNodeLabelEditPartGenerator.java 21 Jun 2006 12:24:56 -0000 >@@ -121,65 +121,67 @@ > protected final String TEXT_104 = ") {" + NL + "\t\t\t(("; > protected final String TEXT_105 = ") pdEditPolicy).refreshFeedback();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshUnderline() {" + NL + "\t\t"; > protected final String TEXT_106 = " style =" + NL + "\t\t\t("; >- protected final String TEXT_107 = ") getPrimaryView().getStyle(" + NL + "\t\t\t\t"; >+ protected final String TEXT_107 = ") getFontStyleOwnerView().getStyle(" + NL + "\t\t\t\t"; > protected final String TEXT_108 = ".eINSTANCE.getFontStyle());" + NL + "\t\tif (style != null && getFigure() instanceof "; > protected final String TEXT_109 = ") {" + NL + "\t\t\t(("; > protected final String TEXT_110 = ") getFigure()).setTextUnderline(style.isUnderline());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshStrikeThrough() {" + NL + "\t\t"; > protected final String TEXT_111 = " style =" + NL + "\t\t\t("; >- protected final String TEXT_112 = ") getPrimaryView().getStyle(" + NL + "\t\t\t\t"; >+ protected final String TEXT_112 = ") getFontStyleOwnerView().getStyle(" + NL + "\t\t\t\t"; > protected final String TEXT_113 = ".eINSTANCE.getFontStyle());" + NL + "\t\tif (style != null && getFigure() instanceof "; > protected final String TEXT_114 = ") {" + NL + "\t\t\t(("; > protected final String TEXT_115 = ") getFigure()).setTextStrikeThrough(style.isStrikeThrough());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {" + NL + "\t\t"; > protected final String TEXT_116 = " style =" + NL + "\t\t\t("; >- protected final String TEXT_117 = ") getPrimaryView().getStyle(" + NL + "\t\t\t\t"; >- protected final String TEXT_118 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; >- protected final String TEXT_119 = " fontData;" + NL + "\t\tif (style != null) {" + NL + "\t\t\tfontData = new "; >+ protected final String TEXT_117 = ") getFontStyleOwnerView().getStyle(" + NL + "\t\t\t\t"; >+ protected final String TEXT_118 = ".eINSTANCE.getFontStyle());" + NL + "\t\tif (style != null) {" + NL + "\t\t\t"; >+ protected final String TEXT_119 = " fontData = new "; > protected final String TEXT_120 = "(" + NL + "\t\t\t\tstyle.getFontName(), style.getFontHeight()," + NL + "\t\t\t\t(style.isBold() ? "; > protected final String TEXT_121 = ".BOLD : "; > protected final String TEXT_122 = ".NORMAL) |" + NL + "\t\t\t\t(style.isItalic() ? "; > protected final String TEXT_123 = ".ITALIC : "; >- protected final String TEXT_124 = ".NORMAL));" + NL + "\t\t} else {" + NL + "\t\t\t// initialize font to defaults" + NL + "\t\t\tfontData = "; >- protected final String TEXT_125 = ".getFontData(" + NL + "\t\t\t\t("; >- protected final String TEXT_126 = ") getDiagramPreferencesHint().getPreferenceStore()," + NL + "\t\t\t\t"; >- protected final String TEXT_127 = ".PREF_DEFAULT_FONT);" + NL + "\t\t}" + NL + "\t\tsetFont(fontData);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void setFontColor("; >- protected final String TEXT_128 = " color) {" + NL + "\t\tgetFigure().setForegroundColor(color);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void addSemanticListeners() {" + NL + "\t\tif (getParser() instanceof "; >- protected final String TEXT_129 = ") {" + NL + "\t\t\t"; >- protected final String TEXT_130 = " element = resolveSemanticElement();" + NL + "\t\t\tparserElements = (("; >- protected final String TEXT_131 = ") getParser()).getSemanticElementsBeingParsed(element);" + NL + "\t\t\tfor (int i = 0; i < parserElements.size(); i++) {" + NL + "\t\t\t\taddListenerFilter(\"SemanticModel\" + i, this, ("; >- protected final String TEXT_132 = ") parserElements.get(i)); //$NON-NLS-1$" + NL + "\t\t\t}" + NL + "\t\t} else {" + NL + "\t\t\tsuper.addSemanticListeners();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void removeSemanticListeners() {" + NL + "\t\tif (parserElements != null) {" + NL + "\t\t\tfor (int i = 0; i < parserElements.size(); i++) {" + NL + "\t\t\t\tremoveListenerFilter(\"SemanticModel\" + i); //$NON-NLS-1$" + NL + "\t\t\t}" + NL + "\t\t} else {" + NL + "\t\t\tsuper.removeSemanticListeners();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >- protected final String TEXT_133 = " getAccessibleEditPart() {" + NL + "\t\tif (accessibleEP == null) {" + NL + "\t\t\taccessibleEP = new AccessibleGraphicalEditPart() {" + NL + "" + NL + "\t\t\t\tpublic void getName("; >- protected final String TEXT_134 = " e) {" + NL + "\t\t\t\t\te.result = getLabelTextHelper(getFigure());" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "\t\t}" + NL + "\t\treturn accessibleEP;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void handleNotificationEvent("; >- protected final String TEXT_135 = " event) {" + NL + "\t\tObject feature = event.getFeature();"; >- protected final String TEXT_136 = NL; >- protected final String TEXT_137 = "\t\tif ("; >- protected final String TEXT_138 = ".eINSTANCE.getFontStyle_FontColor().equals(feature)) {" + NL + "\t\t\tInteger c = (Integer) event.getNewValue();" + NL + "\t\t\tsetFontColor("; >- protected final String TEXT_139 = ".getInstance().getColor(c));" + NL + "\t\t} else if ("; >- protected final String TEXT_140 = ".eINSTANCE.getFontStyle_Underline().equals(feature)) {" + NL + "\t\t\trefreshUnderline();" + NL + "\t\t} else if ("; >- protected final String TEXT_141 = ".eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {" + NL + "\t\t\trefreshStrikeThrough();" + NL + "\t\t} else if ("; >- protected final String TEXT_142 = ".eINSTANCE.getFontStyle_FontHeight().equals(feature) ||" + NL + "\t\t\t\t"; >- protected final String TEXT_143 = ".eINSTANCE.getFontStyle_FontName().equals(feature) ||" + NL + "\t\t\t\t"; >- protected final String TEXT_144 = ".eINSTANCE.getFontStyle_Bold().equals(feature) ||" + NL + "\t\t\t\t"; >- protected final String TEXT_145 = ".eINSTANCE.getFontStyle_Italic().equals(feature)) {" + NL + "\t\t\trefreshFont();" + NL + "\t\t} else {" + NL + "\t\t\tif (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {" + NL + "\t\t\t\trefreshLabel();" + NL + "\t\t\t}" + NL + "\t\t\tif (getParser() instanceof ISemanticParser) {" + NL + "\t\t\t\t"; >- protected final String TEXT_146 = " modelParser =" + NL + "\t\t\t\t\t("; >- protected final String TEXT_147 = ") getParser();" + NL + "\t\t\t\tif (modelParser.areSemanticElementsAffected(null, event)) {" + NL + "\t\t\t\t\tremoveSemanticListeners();" + NL + "\t\t\t\t\tif (resolveSemanticElement() != null) {" + NL + "\t\t\t\t\t\taddSemanticListeners();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\trefreshLabel();" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tsuper.handleNotificationEvent(event);" + NL + "\t}"; >- protected final String TEXT_148 = NL; >- protected final String TEXT_149 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >- protected final String TEXT_150 = " createFigure() {" + NL + "\t\t// Parent should assign one using "; >- protected final String TEXT_151 = " method" + NL + "\t\treturn null;" + NL + "\t}"; >- protected final String TEXT_152 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >- protected final String TEXT_153 = " createFigure() {" + NL + "\t\t"; >- protected final String TEXT_154 = " label = createFigurePrim();" + NL + "\t\tdefaultText = getLabelTextHelper(label);" + NL + "\t\treturn label;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >- protected final String TEXT_155 = " createFigurePrim() {"; >- protected final String TEXT_156 = NL + "\t\treturn new "; >- protected final String TEXT_157 = "();"; >- protected final String TEXT_158 = NL + "\t\treturn "; >- protected final String TEXT_159 = ";"; >- protected final String TEXT_160 = NL + "\t\treturn new "; >- protected final String TEXT_161 = "();"; >- protected final String TEXT_162 = NL + "\t}" + NL; >- protected final String TEXT_163 = NL; >- protected final String TEXT_164 = NL + "}"; >+ protected final String TEXT_124 = ".NORMAL));" + NL + "\t\t\tsetFont(fontData);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void setFontColor("; >+ protected final String TEXT_125 = " color) {" + NL + "\t\tgetFigure().setForegroundColor(color);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void addSemanticListeners() {" + NL + "\t\tif (getParser() instanceof "; >+ protected final String TEXT_126 = ") {" + NL + "\t\t\t"; >+ protected final String TEXT_127 = " element = resolveSemanticElement();" + NL + "\t\t\tparserElements = (("; >+ protected final String TEXT_128 = ") getParser()).getSemanticElementsBeingParsed(element);" + NL + "\t\t\tfor (int i = 0; i < parserElements.size(); i++) {" + NL + "\t\t\t\taddListenerFilter(\"SemanticModel\" + i, this, ("; >+ protected final String TEXT_129 = ") parserElements.get(i)); //$NON-NLS-1$" + NL + "\t\t\t}" + NL + "\t\t} else {" + NL + "\t\t\tsuper.addSemanticListeners();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void removeSemanticListeners() {" + NL + "\t\tif (parserElements != null) {" + NL + "\t\t\tfor (int i = 0; i < parserElements.size(); i++) {" + NL + "\t\t\t\tremoveListenerFilter(\"SemanticModel\" + i); //$NON-NLS-1$" + NL + "\t\t\t}" + NL + "\t\t} else {" + NL + "\t\t\tsuper.removeSemanticListeners();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >+ protected final String TEXT_130 = " getAccessibleEditPart() {" + NL + "\t\tif (accessibleEP == null) {" + NL + "\t\t\taccessibleEP = new AccessibleGraphicalEditPart() {" + NL + "" + NL + "\t\t\t\tpublic void getName("; >+ protected final String TEXT_131 = " e) {" + NL + "\t\t\t\t\te.result = getLabelTextHelper(getFigure());" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "\t\t}" + NL + "\t\treturn accessibleEP;" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\t private "; >+ protected final String TEXT_132 = " getFontStyleOwnerView() {"; >+ protected final String TEXT_133 = NL + "\t\treturn ("; >+ protected final String TEXT_134 = ")getModel();"; >+ protected final String TEXT_135 = NL + "\t\treturn getPrimaryView();"; >+ protected final String TEXT_136 = NL + "\t }" + NL + "\t" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void handleNotificationEvent("; >+ protected final String TEXT_137 = " event) {" + NL + "\t\tObject feature = event.getFeature();"; >+ protected final String TEXT_138 = NL; >+ protected final String TEXT_139 = "\t\tif ("; >+ protected final String TEXT_140 = ".eINSTANCE.getFontStyle_FontColor().equals(feature)) {" + NL + "\t\t\tInteger c = (Integer) event.getNewValue();" + NL + "\t\t\tsetFontColor("; >+ protected final String TEXT_141 = ".getInstance().getColor(c));" + NL + "\t\t} else if ("; >+ protected final String TEXT_142 = ".eINSTANCE.getFontStyle_Underline().equals(feature)) {" + NL + "\t\t\trefreshUnderline();" + NL + "\t\t} else if ("; >+ protected final String TEXT_143 = ".eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {" + NL + "\t\t\trefreshStrikeThrough();" + NL + "\t\t} else if ("; >+ protected final String TEXT_144 = ".eINSTANCE.getFontStyle_FontHeight().equals(feature) ||" + NL + "\t\t\t\t"; >+ protected final String TEXT_145 = ".eINSTANCE.getFontStyle_FontName().equals(feature) ||" + NL + "\t\t\t\t"; >+ protected final String TEXT_146 = ".eINSTANCE.getFontStyle_Bold().equals(feature) ||" + NL + "\t\t\t\t"; >+ protected final String TEXT_147 = ".eINSTANCE.getFontStyle_Italic().equals(feature)) {" + NL + "\t\t\trefreshFont();" + NL + "\t\t} else {" + NL + "\t\t\tif (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {" + NL + "\t\t\t\trefreshLabel();" + NL + "\t\t\t}" + NL + "\t\t\tif (getParser() instanceof ISemanticParser) {" + NL + "\t\t\t\t"; >+ protected final String TEXT_148 = " modelParser =" + NL + "\t\t\t\t\t("; >+ protected final String TEXT_149 = ") getParser();" + NL + "\t\t\t\tif (modelParser.areSemanticElementsAffected(null, event)) {" + NL + "\t\t\t\t\tremoveSemanticListeners();" + NL + "\t\t\t\t\tif (resolveSemanticElement() != null) {" + NL + "\t\t\t\t\t\taddSemanticListeners();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\trefreshLabel();" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tsuper.handleNotificationEvent(event);" + NL + "\t}"; >+ protected final String TEXT_150 = NL; >+ protected final String TEXT_151 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >+ protected final String TEXT_152 = " createFigure() {" + NL + "\t\t// Parent should assign one using "; >+ protected final String TEXT_153 = " method" + NL + "\t\treturn null;" + NL + "\t}"; >+ protected final String TEXT_154 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >+ protected final String TEXT_155 = " createFigure() {" + NL + "\t\t"; >+ protected final String TEXT_156 = " label = createFigurePrim();" + NL + "\t\tdefaultText = getLabelTextHelper(label);" + NL + "\t\treturn label;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >+ protected final String TEXT_157 = " createFigurePrim() {"; >+ protected final String TEXT_158 = NL + "\t\treturn new "; >+ protected final String TEXT_159 = "();"; >+ protected final String TEXT_160 = NL + "\t\treturn "; >+ protected final String TEXT_161 = ";"; >+ protected final String TEXT_162 = NL + "\t\treturn new "; >+ protected final String TEXT_163 = "();"; >+ protected final String TEXT_164 = NL + "\t}" + NL; > protected final String TEXT_165 = NL; >+ protected final String TEXT_166 = NL + "}"; >+ protected final String TEXT_167 = NL; > > public String generate(Object argument) > { >@@ -456,37 +458,49 @@ > stringBuffer.append(TEXT_123); > stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); > stringBuffer.append(TEXT_124); >- stringBuffer.append(importManager.getImportedName("org.eclipse.jface.preference.PreferenceConverter")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); > stringBuffer.append(TEXT_125); >- stringBuffer.append(importManager.getImportedName("org.eclipse.jface.preference.IPreferenceStore")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser")); > stringBuffer.append(TEXT_126); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); > stringBuffer.append(TEXT_127); >- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); >- stringBuffer.append(TEXT_128); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser")); >- stringBuffer.append(TEXT_129); >+ stringBuffer.append(TEXT_128); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); >+ stringBuffer.append(TEXT_129); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.AccessibleEditPart")); > stringBuffer.append(TEXT_130); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.accessibility.AccessibleEvent")); > stringBuffer.append(TEXT_131); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); > stringBuffer.append(TEXT_132); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.AccessibleEditPart")); >+ >+boolean fixedFont; >+{ //namespace >+Viewmap viewmap = genLabel.getViewmap(); >+StyleAttributes styleAttributes = (viewmap == null) ? null : (StyleAttributes)viewmap.find(StyleAttributes.class); >+fixedFont = styleAttributes != null && styleAttributes.isFixedFont(); >+} >+if (fixedFont) { >+ > stringBuffer.append(TEXT_133); >- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.accessibility.AccessibleEvent")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); > stringBuffer.append(TEXT_134); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); >+ >+} else { >+ > stringBuffer.append(TEXT_135); >+ >+} >+ > stringBuffer.append(TEXT_136); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); > stringBuffer.append(TEXT_137); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_138); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry")); > stringBuffer.append(TEXT_139); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_140); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry")); > stringBuffer.append(TEXT_141); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_142); >@@ -496,26 +510,30 @@ > stringBuffer.append(TEXT_144); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_145); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_146); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_147); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser")); > stringBuffer.append(TEXT_148); >- if (genLabel.getViewmap() instanceof ParentAssignedViewmap) { >- final ParentAssignedViewmap viewmap = (ParentAssignedViewmap) genLabel.getViewmap(); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser")); > stringBuffer.append(TEXT_149); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); > stringBuffer.append(TEXT_150); >- stringBuffer.append((viewmap.getSetterName() == null ? "setLabel" : viewmap.getSetterName())); >+ if (genLabel.getViewmap() instanceof ParentAssignedViewmap) { >+ final ParentAssignedViewmap viewmap = (ParentAssignedViewmap) genLabel.getViewmap(); > stringBuffer.append(TEXT_151); >- } else { >- stringBuffer.append(TEXT_152); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); >+ stringBuffer.append(TEXT_152); >+ stringBuffer.append((viewmap.getSetterName() == null ? "setLabel" : viewmap.getSetterName())); > stringBuffer.append(TEXT_153); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); >+ } else { > stringBuffer.append(TEXT_154); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); > stringBuffer.append(TEXT_155); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); >+ stringBuffer.append(TEXT_156); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); >+ stringBuffer.append(TEXT_157); > > String figureQualifiedClassName = null; > Viewmap viewmap = genLabel.getViewmap(); >@@ -525,31 +543,31 @@ > figureQualifiedClassName = "org.eclipse.draw2d.Label"; > } > >- stringBuffer.append(TEXT_156); >+ stringBuffer.append(TEXT_158); > stringBuffer.append(importManager.getImportedName(figureQualifiedClassName)); >- stringBuffer.append(TEXT_157); >+ stringBuffer.append(TEXT_159); > } // instanceof FigureViewmap > else if (viewmap instanceof SnippetViewmap) { >- stringBuffer.append(TEXT_158); >+ stringBuffer.append(TEXT_160); > stringBuffer.append(((SnippetViewmap) viewmap).getBody()); >- stringBuffer.append(TEXT_159); >+ stringBuffer.append(TEXT_161); > } // instanceof SnippetViewmap; FIXME : obtain figure class name to generate getter > else if (viewmap instanceof InnerClassViewmap) { > figureQualifiedClassName = ((InnerClassViewmap) viewmap).getClassName(); > >- stringBuffer.append(TEXT_160); >+ stringBuffer.append(TEXT_162); > stringBuffer.append(figureQualifiedClassName); >- stringBuffer.append(TEXT_161); >+ stringBuffer.append(TEXT_163); > } >- stringBuffer.append(TEXT_162); >+ stringBuffer.append(TEXT_164); > if (genLabel.getViewmap() instanceof InnerClassViewmap) { >- stringBuffer.append(TEXT_163); >+ stringBuffer.append(TEXT_165); > stringBuffer.append(((InnerClassViewmap) genLabel.getViewmap()).getClassBody()); > } /* if inner */ > } /*else if !ParentAssignedViewmap */ >- stringBuffer.append(TEXT_164); >+ stringBuffer.append(TEXT_166); > importManager.emitSortedImports(); >- stringBuffer.append(TEXT_165); >+ stringBuffer.append(TEXT_167); > return stringBuffer.toString(); > } > } >Index: src-templates/org/eclipse/gmf/codegen/templates/parts/NodeLabelEditPartGenerator.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/parts/NodeLabelEditPartGenerator.java,v >retrieving revision 1.56 >diff -u -r1.56 NodeLabelEditPartGenerator.java >--- src-templates/org/eclipse/gmf/codegen/templates/parts/NodeLabelEditPartGenerator.java 9 Jun 2006 12:31:18 -0000 1.56 >+++ src-templates/org/eclipse/gmf/codegen/templates/parts/NodeLabelEditPartGenerator.java 21 Jun 2006 12:24:57 -0000 >@@ -120,98 +120,100 @@ > protected final String TEXT_102 = ") {" + NL + "\t\t\t(("; > protected final String TEXT_103 = ") pdEditPolicy).refreshFeedback();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshUnderline() {" + NL + "\t\t"; > protected final String TEXT_104 = " style =" + NL + "\t\t\t("; >- protected final String TEXT_105 = ") getPrimaryView().getStyle(" + NL + "\t\t\t\t"; >+ protected final String TEXT_105 = ") getFontStyleOwnerView().getStyle(" + NL + "\t\t\t\t"; > protected final String TEXT_106 = ".eINSTANCE.getFontStyle());" + NL + "\t\tif (style != null && getFigure() instanceof "; > protected final String TEXT_107 = ") {" + NL + "\t\t\t(("; > protected final String TEXT_108 = ") getFigure()).setTextUnderline(style.isUnderline());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshStrikeThrough() {" + NL + "\t\t"; > protected final String TEXT_109 = " style =" + NL + "\t\t\t("; >- protected final String TEXT_110 = ") getPrimaryView().getStyle(" + NL + "\t\t\t\t"; >+ protected final String TEXT_110 = ") getFontStyleOwnerView().getStyle(" + NL + "\t\t\t\t"; > protected final String TEXT_111 = ".eINSTANCE.getFontStyle());" + NL + "\t\tif (style != null && getFigure() instanceof "; > protected final String TEXT_112 = ") {" + NL + "\t\t\t(("; > protected final String TEXT_113 = ") getFigure()).setTextStrikeThrough(style.isStrikeThrough());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {" + NL + "\t\t"; > protected final String TEXT_114 = " style =" + NL + "\t\t\t("; >- protected final String TEXT_115 = ") getPrimaryView().getStyle(" + NL + "\t\t\t\t"; >- protected final String TEXT_116 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; >- protected final String TEXT_117 = " fontData;" + NL + "\t\tif (style != null) {" + NL + "\t\t\tfontData = new "; >+ protected final String TEXT_115 = ") getFontStyleOwnerView().getStyle(" + NL + "\t\t\t\t"; >+ protected final String TEXT_116 = ".eINSTANCE.getFontStyle());" + NL + "\t\tif (style != null) {" + NL + "\t\t\t"; >+ protected final String TEXT_117 = " fontData = new "; > protected final String TEXT_118 = "(" + NL + "\t\t\t\tstyle.getFontName(), style.getFontHeight()," + NL + "\t\t\t\t(style.isBold() ? "; > protected final String TEXT_119 = ".BOLD : "; > protected final String TEXT_120 = ".NORMAL) |" + NL + "\t\t\t\t(style.isItalic() ? "; > protected final String TEXT_121 = ".ITALIC : "; >- protected final String TEXT_122 = ".NORMAL));" + NL + "\t\t} else {" + NL + "\t\t\t// initialize font to defaults" + NL + "\t\t\tfontData = "; >- protected final String TEXT_123 = ".getFontData(" + NL + "\t\t\t\t("; >- protected final String TEXT_124 = ") getDiagramPreferencesHint().getPreferenceStore()," + NL + "\t\t\t\t"; >- protected final String TEXT_125 = ".PREF_DEFAULT_FONT);" + NL + "\t\t}" + NL + "\t\tsetFont(fontData);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void setFontColor("; >- protected final String TEXT_126 = " color) {" + NL + "\t\tgetFigure().setForegroundColor(color);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void addSemanticListeners() {" + NL + "\t\tif (getParser() instanceof "; >- protected final String TEXT_127 = ") {" + NL + "\t\t\t"; >- protected final String TEXT_128 = " element = resolveSemanticElement();" + NL + "\t\t\tparserElements = (("; >- protected final String TEXT_129 = ") getParser()).getSemanticElementsBeingParsed(element);" + NL + "\t\t\tfor (int i = 0; i < parserElements.size(); i++) {" + NL + "\t\t\t\taddListenerFilter(\"SemanticModel\" + i, this, ("; >- protected final String TEXT_130 = ") parserElements.get(i)); //$NON-NLS-1$" + NL + "\t\t\t}" + NL + "\t\t} else {" + NL + "\t\t\tsuper.addSemanticListeners();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void removeSemanticListeners() {" + NL + "\t\tif (parserElements != null) {" + NL + "\t\t\tfor (int i = 0; i < parserElements.size(); i++) {" + NL + "\t\t\t\tremoveListenerFilter(\"SemanticModel\" + i); //$NON-NLS-1$" + NL + "\t\t\t}" + NL + "\t\t} else {" + NL + "\t\t\tsuper.removeSemanticListeners();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >- protected final String TEXT_131 = " getAccessibleEditPart() {" + NL + "\t\tif (accessibleEP == null) {" + NL + "\t\t\taccessibleEP = new AccessibleGraphicalEditPart() {" + NL + "" + NL + "\t\t\t\tpublic void getName("; >- protected final String TEXT_132 = " e) {" + NL + "\t\t\t\t\te.result = getLabelTextHelper(getFigure());" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "\t\t}" + NL + "\t\treturn accessibleEP;" + NL + "\t}"; >- protected final String TEXT_133 = NL; >- protected final String TEXT_134 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void addNotationalListeners() {" + NL + "\t\tsuper.addNotationalListeners();" + NL + "\t\taddListenerFilter(\"PrimaryView\", this, getPrimaryView()); //$NON-NLS-1$" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void removeNotationalListeners() {" + NL + "\t\tsuper.removeNotationalListeners();" + NL + "\t\tremoveListenerFilter(\"PrimaryView\"); //$NON-NLS-1$" + NL + "\t}"; >- protected final String TEXT_135 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshBounds() {" + NL + "\t\tint width = ((Integer) getStructuralFeatureValue("; >- protected final String TEXT_136 = ".eINSTANCE.getSize_Width())).intValue();" + NL + "\t\tint height = ((Integer) getStructuralFeatureValue("; >- protected final String TEXT_137 = ".eINSTANCE.getSize_Height())).intValue();" + NL + "\t\t"; >- protected final String TEXT_138 = " size = new "; >- protected final String TEXT_139 = "(width, height);" + NL + "\t\tint x = ((Integer) getStructuralFeatureValue("; >- protected final String TEXT_140 = ".eINSTANCE.getLocation_X())).intValue();" + NL + "\t\tint y = ((Integer) getStructuralFeatureValue("; >- protected final String TEXT_141 = ".eINSTANCE.getLocation_Y())).intValue();" + NL + "\t\t"; >- protected final String TEXT_142 = " loc = new "; >- protected final String TEXT_143 = "(x, y);" + NL + "\t\t(("; >- protected final String TEXT_144 = ") getParent()).setLayoutConstraint(this, getFigure(), new "; >- protected final String TEXT_145 = "(loc, size));" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void handleNotificationEvent("; >- protected final String TEXT_146 = " event) {" + NL + "\t\tObject feature = event.getFeature();"; >- protected final String TEXT_147 = NL; >- protected final String TEXT_148 = NL + "\t\tif ("; >- protected final String TEXT_149 = ".eINSTANCE.getSize_Width().equals(feature) ||" + NL + "\t\t\t\t"; >- protected final String TEXT_150 = ".eINSTANCE.getSize_Height().equals(feature) ||" + NL + "\t\t\t\t"; >- protected final String TEXT_151 = ".eINSTANCE.getLocation_X().equals(feature) ||" + NL + "\t\t\t\t"; >- protected final String TEXT_152 = ".eINSTANCE.getLocation_Y().equals(feature)) {" + NL + "\t\t\trefreshBounds();" + NL + "\t\t}"; >- protected final String TEXT_153 = NL; >- protected final String TEXT_154 = "\t\tif ("; >- protected final String TEXT_155 = ".eINSTANCE.getFontStyle_FontColor().equals(feature)) {" + NL + "\t\t\tInteger c = (Integer) event.getNewValue();" + NL + "\t\t\tsetFontColor("; >- protected final String TEXT_156 = ".getInstance().getColor(c));" + NL + "\t\t} else if ("; >- protected final String TEXT_157 = ".eINSTANCE.getFontStyle_Underline().equals(feature)) {" + NL + "\t\t\trefreshUnderline();" + NL + "\t\t} else if ("; >- protected final String TEXT_158 = ".eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {" + NL + "\t\t\trefreshStrikeThrough();" + NL + "\t\t} else if ("; >- protected final String TEXT_159 = ".eINSTANCE.getFontStyle_FontHeight().equals(feature) ||" + NL + "\t\t\t\t"; >- protected final String TEXT_160 = ".eINSTANCE.getFontStyle_FontName().equals(feature) ||" + NL + "\t\t\t\t"; >- protected final String TEXT_161 = ".eINSTANCE.getFontStyle_Bold().equals(feature) ||" + NL + "\t\t\t\t"; >- protected final String TEXT_162 = ".eINSTANCE.getFontStyle_Italic().equals(feature)) {" + NL + "\t\t\trefreshFont();" + NL + "\t\t} else {" + NL + "\t\t\tif (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {" + NL + "\t\t\t\trefreshLabel();" + NL + "\t\t\t}" + NL + "\t\t\tif (getParser() instanceof ISemanticParser) {" + NL + "\t\t\t\t"; >- protected final String TEXT_163 = " modelParser =" + NL + "\t\t\t\t\t("; >- protected final String TEXT_164 = ") getParser();" + NL + "\t\t\t\tif (modelParser.areSemanticElementsAffected(null, event)) {" + NL + "\t\t\t\t\tremoveSemanticListeners();" + NL + "\t\t\t\t\tif (resolveSemanticElement() != null) {" + NL + "\t\t\t\t\t\taddSemanticListeners();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\trefreshLabel();" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tsuper.handleNotificationEvent(event);" + NL + "\t}"; >- protected final String TEXT_165 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void handleNotificationEvent("; >- protected final String TEXT_166 = " event) {" + NL + "\t\tObject feature = event.getFeature();"; >- protected final String TEXT_167 = NL; >- protected final String TEXT_168 = "\t\tif ("; >- protected final String TEXT_169 = ".eINSTANCE.getFontStyle_FontColor().equals(feature)) {" + NL + "\t\t\tInteger c = (Integer) event.getNewValue();" + NL + "\t\t\tsetFontColor("; >- protected final String TEXT_170 = ".getInstance().getColor(c));" + NL + "\t\t} else if ("; >- protected final String TEXT_171 = ".eINSTANCE.getFontStyle_Underline().equals(feature)) {" + NL + "\t\t\trefreshUnderline();" + NL + "\t\t} else if ("; >- protected final String TEXT_172 = ".eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {" + NL + "\t\t\trefreshStrikeThrough();" + NL + "\t\t} else if ("; >- protected final String TEXT_173 = ".eINSTANCE.getFontStyle_FontHeight().equals(feature) ||" + NL + "\t\t\t\t"; >- protected final String TEXT_174 = ".eINSTANCE.getFontStyle_FontName().equals(feature) ||" + NL + "\t\t\t\t"; >- protected final String TEXT_175 = ".eINSTANCE.getFontStyle_Bold().equals(feature) ||" + NL + "\t\t\t\t"; >- protected final String TEXT_176 = ".eINSTANCE.getFontStyle_Italic().equals(feature)) {" + NL + "\t\t\trefreshFont();" + NL + "\t\t} else {" + NL + "\t\t\tif (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {" + NL + "\t\t\t\trefreshLabel();" + NL + "\t\t\t}" + NL + "\t\t\tif (getParser() instanceof ISemanticParser) {" + NL + "\t\t\t\t"; >- protected final String TEXT_177 = " modelParser =" + NL + "\t\t\t\t\t("; >- protected final String TEXT_178 = ") getParser();" + NL + "\t\t\t\tif (modelParser.areSemanticElementsAffected(null, event)) {" + NL + "\t\t\t\t\tremoveSemanticListeners();" + NL + "\t\t\t\t\tif (resolveSemanticElement() != null) {" + NL + "\t\t\t\t\t\taddSemanticListeners();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\trefreshLabel();" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tsuper.handleNotificationEvent(event);" + NL + "\t}"; >- protected final String TEXT_179 = NL; >- protected final String TEXT_180 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >- protected final String TEXT_181 = " createFigure() {" + NL + "\t\t// Parent should assign one using "; >- protected final String TEXT_182 = " method" + NL + "\t\treturn null;" + NL + "\t}"; >- protected final String TEXT_183 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >- protected final String TEXT_184 = " createFigure() {" + NL + "\t\t"; >- protected final String TEXT_185 = " label = createFigurePrim();" + NL + "\t\tdefaultText = getLabelTextHelper(label);" + NL + "\t\treturn label;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >- protected final String TEXT_186 = " createFigurePrim() {"; >- protected final String TEXT_187 = NL + "\t\treturn new "; >- protected final String TEXT_188 = "();"; >- protected final String TEXT_189 = NL + "\t\treturn "; >- protected final String TEXT_190 = ";"; >- protected final String TEXT_191 = NL + "\t\treturn new "; >- protected final String TEXT_192 = "();"; >- protected final String TEXT_193 = NL + "\t}" + NL; >- protected final String TEXT_194 = NL; >- protected final String TEXT_195 = NL + "}"; >+ protected final String TEXT_122 = ".NORMAL));" + NL + "\t\t\tsetFont(fontData);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void setFontColor("; >+ protected final String TEXT_123 = " color) {" + NL + "\t\tgetFigure().setForegroundColor(color);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void addSemanticListeners() {" + NL + "\t\tif (getParser() instanceof "; >+ protected final String TEXT_124 = ") {" + NL + "\t\t\t"; >+ protected final String TEXT_125 = " element = resolveSemanticElement();" + NL + "\t\t\tparserElements = (("; >+ protected final String TEXT_126 = ") getParser()).getSemanticElementsBeingParsed(element);" + NL + "\t\t\tfor (int i = 0; i < parserElements.size(); i++) {" + NL + "\t\t\t\taddListenerFilter(\"SemanticModel\" + i, this, ("; >+ protected final String TEXT_127 = ") parserElements.get(i)); //$NON-NLS-1$" + NL + "\t\t\t}" + NL + "\t\t} else {" + NL + "\t\t\tsuper.addSemanticListeners();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void removeSemanticListeners() {" + NL + "\t\tif (parserElements != null) {" + NL + "\t\t\tfor (int i = 0; i < parserElements.size(); i++) {" + NL + "\t\t\t\tremoveListenerFilter(\"SemanticModel\" + i); //$NON-NLS-1$" + NL + "\t\t\t}" + NL + "\t\t} else {" + NL + "\t\t\tsuper.removeSemanticListeners();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >+ protected final String TEXT_128 = " getAccessibleEditPart() {" + NL + "\t\tif (accessibleEP == null) {" + NL + "\t\t\taccessibleEP = new AccessibleGraphicalEditPart() {" + NL + "" + NL + "\t\t\t\tpublic void getName("; >+ protected final String TEXT_129 = " e) {" + NL + "\t\t\t\t\te.result = getLabelTextHelper(getFigure());" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "\t\t}" + NL + "\t\treturn accessibleEP;" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\t private "; >+ protected final String TEXT_130 = " getFontStyleOwnerView() {"; >+ protected final String TEXT_131 = NL + "\t\treturn ("; >+ protected final String TEXT_132 = ")getModel();"; >+ protected final String TEXT_133 = NL + "\t\treturn getPrimaryView();"; >+ protected final String TEXT_134 = NL + "\t }" + NL + "\t"; >+ protected final String TEXT_135 = NL; >+ protected final String TEXT_136 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void addNotationalListeners() {" + NL + "\t\tsuper.addNotationalListeners();" + NL + "\t\taddListenerFilter(\"PrimaryView\", this, getPrimaryView()); //$NON-NLS-1$" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void removeNotationalListeners() {" + NL + "\t\tsuper.removeNotationalListeners();" + NL + "\t\tremoveListenerFilter(\"PrimaryView\"); //$NON-NLS-1$" + NL + "\t}"; >+ protected final String TEXT_137 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshBounds() {" + NL + "\t\tint width = ((Integer) getStructuralFeatureValue("; >+ protected final String TEXT_138 = ".eINSTANCE.getSize_Width())).intValue();" + NL + "\t\tint height = ((Integer) getStructuralFeatureValue("; >+ protected final String TEXT_139 = ".eINSTANCE.getSize_Height())).intValue();" + NL + "\t\t"; >+ protected final String TEXT_140 = " size = new "; >+ protected final String TEXT_141 = "(width, height);" + NL + "\t\tint x = ((Integer) getStructuralFeatureValue("; >+ protected final String TEXT_142 = ".eINSTANCE.getLocation_X())).intValue();" + NL + "\t\tint y = ((Integer) getStructuralFeatureValue("; >+ protected final String TEXT_143 = ".eINSTANCE.getLocation_Y())).intValue();" + NL + "\t\t"; >+ protected final String TEXT_144 = " loc = new "; >+ protected final String TEXT_145 = "(x, y);" + NL + "\t\t(("; >+ protected final String TEXT_146 = ") getParent()).setLayoutConstraint(this, getFigure(), new "; >+ protected final String TEXT_147 = "(loc, size));" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void handleNotificationEvent("; >+ protected final String TEXT_148 = " event) {" + NL + "\t\tObject feature = event.getFeature();"; >+ protected final String TEXT_149 = NL; >+ protected final String TEXT_150 = NL + "\t\tif ("; >+ protected final String TEXT_151 = ".eINSTANCE.getSize_Width().equals(feature) ||" + NL + "\t\t\t\t"; >+ protected final String TEXT_152 = ".eINSTANCE.getSize_Height().equals(feature) ||" + NL + "\t\t\t\t"; >+ protected final String TEXT_153 = ".eINSTANCE.getLocation_X().equals(feature) ||" + NL + "\t\t\t\t"; >+ protected final String TEXT_154 = ".eINSTANCE.getLocation_Y().equals(feature)) {" + NL + "\t\t\trefreshBounds();" + NL + "\t\t}"; >+ protected final String TEXT_155 = NL; >+ protected final String TEXT_156 = "\t\tif ("; >+ protected final String TEXT_157 = ".eINSTANCE.getFontStyle_FontColor().equals(feature)) {" + NL + "\t\t\tInteger c = (Integer) event.getNewValue();" + NL + "\t\t\tsetFontColor("; >+ protected final String TEXT_158 = ".getInstance().getColor(c));" + NL + "\t\t} else if ("; >+ protected final String TEXT_159 = ".eINSTANCE.getFontStyle_Underline().equals(feature)) {" + NL + "\t\t\trefreshUnderline();" + NL + "\t\t} else if ("; >+ protected final String TEXT_160 = ".eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {" + NL + "\t\t\trefreshStrikeThrough();" + NL + "\t\t} else if ("; >+ protected final String TEXT_161 = ".eINSTANCE.getFontStyle_FontHeight().equals(feature) ||" + NL + "\t\t\t\t"; >+ protected final String TEXT_162 = ".eINSTANCE.getFontStyle_FontName().equals(feature) ||" + NL + "\t\t\t\t"; >+ protected final String TEXT_163 = ".eINSTANCE.getFontStyle_Bold().equals(feature) ||" + NL + "\t\t\t\t"; >+ protected final String TEXT_164 = ".eINSTANCE.getFontStyle_Italic().equals(feature)) {" + NL + "\t\t\trefreshFont();" + NL + "\t\t} else {" + NL + "\t\t\tif (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {" + NL + "\t\t\t\trefreshLabel();" + NL + "\t\t\t}" + NL + "\t\t\tif (getParser() instanceof ISemanticParser) {" + NL + "\t\t\t\t"; >+ protected final String TEXT_165 = " modelParser =" + NL + "\t\t\t\t\t("; >+ protected final String TEXT_166 = ") getParser();" + NL + "\t\t\t\tif (modelParser.areSemanticElementsAffected(null, event)) {" + NL + "\t\t\t\t\tremoveSemanticListeners();" + NL + "\t\t\t\t\tif (resolveSemanticElement() != null) {" + NL + "\t\t\t\t\t\taddSemanticListeners();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\trefreshLabel();" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tsuper.handleNotificationEvent(event);" + NL + "\t}"; >+ protected final String TEXT_167 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void handleNotificationEvent("; >+ protected final String TEXT_168 = " event) {" + NL + "\t\tObject feature = event.getFeature();"; >+ protected final String TEXT_169 = NL; >+ protected final String TEXT_170 = "\t\tif ("; >+ protected final String TEXT_171 = ".eINSTANCE.getFontStyle_FontColor().equals(feature)) {" + NL + "\t\t\tInteger c = (Integer) event.getNewValue();" + NL + "\t\t\tsetFontColor("; >+ protected final String TEXT_172 = ".getInstance().getColor(c));" + NL + "\t\t} else if ("; >+ protected final String TEXT_173 = ".eINSTANCE.getFontStyle_Underline().equals(feature)) {" + NL + "\t\t\trefreshUnderline();" + NL + "\t\t} else if ("; >+ protected final String TEXT_174 = ".eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {" + NL + "\t\t\trefreshStrikeThrough();" + NL + "\t\t} else if ("; >+ protected final String TEXT_175 = ".eINSTANCE.getFontStyle_FontHeight().equals(feature) ||" + NL + "\t\t\t\t"; >+ protected final String TEXT_176 = ".eINSTANCE.getFontStyle_FontName().equals(feature) ||" + NL + "\t\t\t\t"; >+ protected final String TEXT_177 = ".eINSTANCE.getFontStyle_Bold().equals(feature) ||" + NL + "\t\t\t\t"; >+ protected final String TEXT_178 = ".eINSTANCE.getFontStyle_Italic().equals(feature)) {" + NL + "\t\t\trefreshFont();" + NL + "\t\t} else {" + NL + "\t\t\tif (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {" + NL + "\t\t\t\trefreshLabel();" + NL + "\t\t\t}" + NL + "\t\t\tif (getParser() instanceof ISemanticParser) {" + NL + "\t\t\t\t"; >+ protected final String TEXT_179 = " modelParser =" + NL + "\t\t\t\t\t("; >+ protected final String TEXT_180 = ") getParser();" + NL + "\t\t\t\tif (modelParser.areSemanticElementsAffected(null, event)) {" + NL + "\t\t\t\t\tremoveSemanticListeners();" + NL + "\t\t\t\t\tif (resolveSemanticElement() != null) {" + NL + "\t\t\t\t\t\taddSemanticListeners();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\trefreshLabel();" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tsuper.handleNotificationEvent(event);" + NL + "\t}"; >+ protected final String TEXT_181 = NL; >+ protected final String TEXT_182 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >+ protected final String TEXT_183 = " createFigure() {" + NL + "\t\t// Parent should assign one using "; >+ protected final String TEXT_184 = " method" + NL + "\t\treturn null;" + NL + "\t}"; >+ protected final String TEXT_185 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >+ protected final String TEXT_186 = " createFigure() {" + NL + "\t\t"; >+ protected final String TEXT_187 = " label = createFigurePrim();" + NL + "\t\tdefaultText = getLabelTextHelper(label);" + NL + "\t\treturn label;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >+ protected final String TEXT_188 = " createFigurePrim() {"; >+ protected final String TEXT_189 = NL + "\t\treturn new "; >+ protected final String TEXT_190 = "();"; >+ protected final String TEXT_191 = NL + "\t\treturn "; >+ protected final String TEXT_192 = ";"; >+ protected final String TEXT_193 = NL + "\t\treturn new "; >+ protected final String TEXT_194 = "();"; >+ protected final String TEXT_195 = NL + "\t}" + NL; > protected final String TEXT_196 = NL; >+ protected final String TEXT_197 = NL + "}"; >+ protected final String TEXT_198 = NL; > > public String generate(Object argument) > { >@@ -488,72 +490,84 @@ > stringBuffer.append(TEXT_121); > stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); > stringBuffer.append(TEXT_122); >- stringBuffer.append(importManager.getImportedName("org.eclipse.jface.preference.PreferenceConverter")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); > stringBuffer.append(TEXT_123); >- stringBuffer.append(importManager.getImportedName("org.eclipse.jface.preference.IPreferenceStore")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser")); > stringBuffer.append(TEXT_124); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); > stringBuffer.append(TEXT_125); >- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); >- stringBuffer.append(TEXT_126); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser")); >- stringBuffer.append(TEXT_127); >+ stringBuffer.append(TEXT_126); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); >+ stringBuffer.append(TEXT_127); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.AccessibleEditPart")); > stringBuffer.append(TEXT_128); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.accessibility.AccessibleEvent")); > stringBuffer.append(TEXT_129); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); > stringBuffer.append(TEXT_130); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.AccessibleEditPart")); >+ >+boolean fixedFont; >+{ //namespace >+Viewmap viewmap = genLabel.getViewmap(); >+StyleAttributes styleAttributes = (viewmap == null) ? null : (StyleAttributes)viewmap.find(StyleAttributes.class); >+fixedFont = styleAttributes != null && styleAttributes.isFixedFont(); >+} >+if (fixedFont) { >+ > stringBuffer.append(TEXT_131); >- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.accessibility.AccessibleEvent")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); > stringBuffer.append(TEXT_132); >+ >+} else { >+ > stringBuffer.append(TEXT_133); >+ >+} >+ > stringBuffer.append(TEXT_134); >- if (needsRefreshBounds) { > stringBuffer.append(TEXT_135); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_136); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >+ if (needsRefreshBounds) { > stringBuffer.append(TEXT_137); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_138); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension")); >- stringBuffer.append(TEXT_139); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >+ stringBuffer.append(TEXT_139); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension")); > stringBuffer.append(TEXT_140); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension")); > stringBuffer.append(TEXT_141); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_142); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_143); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point")); > stringBuffer.append(TEXT_144); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point")); > stringBuffer.append(TEXT_145); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")); > stringBuffer.append(TEXT_146); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); > stringBuffer.append(TEXT_147); >- /* for handleNotificationEvent() method */ >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); > stringBuffer.append(TEXT_148); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_149); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >+ /* for handleNotificationEvent() method */ > stringBuffer.append(TEXT_150); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_151); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_152); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_153); >- stringBuffer.append(TEXT_154); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >+ stringBuffer.append(TEXT_154); > stringBuffer.append(TEXT_155); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry")); > stringBuffer.append(TEXT_156); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_157); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry")); > stringBuffer.append(TEXT_158); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_159); >@@ -563,23 +577,23 @@ > stringBuffer.append(TEXT_161); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_162); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_163); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_164); >- } else { >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser")); > stringBuffer.append(TEXT_165); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser")); > stringBuffer.append(TEXT_166); >+ } else { > stringBuffer.append(TEXT_167); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); > stringBuffer.append(TEXT_168); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_169); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry")); > stringBuffer.append(TEXT_170); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_171); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry")); > stringBuffer.append(TEXT_172); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_173); >@@ -589,27 +603,31 @@ > stringBuffer.append(TEXT_175); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_176); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_177); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_178); >- } >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser")); > stringBuffer.append(TEXT_179); >- if (genLabel.getViewmap() instanceof ParentAssignedViewmap) { >- final ParentAssignedViewmap viewmap = (ParentAssignedViewmap) genLabel.getViewmap(); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser")); > stringBuffer.append(TEXT_180); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); >+ } > stringBuffer.append(TEXT_181); >- stringBuffer.append((viewmap.getSetterName() == null ? "setLabel" : viewmap.getSetterName())); >+ if (genLabel.getViewmap() instanceof ParentAssignedViewmap) { >+ final ParentAssignedViewmap viewmap = (ParentAssignedViewmap) genLabel.getViewmap(); > stringBuffer.append(TEXT_182); >- } else { >- stringBuffer.append(TEXT_183); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); >+ stringBuffer.append(TEXT_183); >+ stringBuffer.append((viewmap.getSetterName() == null ? "setLabel" : viewmap.getSetterName())); > stringBuffer.append(TEXT_184); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); >+ } else { > stringBuffer.append(TEXT_185); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); > stringBuffer.append(TEXT_186); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); >+ stringBuffer.append(TEXT_187); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); >+ stringBuffer.append(TEXT_188); > > String figureQualifiedClassName = null; > Viewmap viewmap = genLabel.getViewmap(); >@@ -619,31 +637,31 @@ > figureQualifiedClassName = "org.eclipse.draw2d.Label"; > } > >- stringBuffer.append(TEXT_187); >+ stringBuffer.append(TEXT_189); > stringBuffer.append(importManager.getImportedName(figureQualifiedClassName)); >- stringBuffer.append(TEXT_188); >+ stringBuffer.append(TEXT_190); > } // instanceof FigureViewmap > else if (viewmap instanceof SnippetViewmap) { >- stringBuffer.append(TEXT_189); >+ stringBuffer.append(TEXT_191); > stringBuffer.append(((SnippetViewmap) viewmap).getBody()); >- stringBuffer.append(TEXT_190); >+ stringBuffer.append(TEXT_192); > } // instanceof SnippetViewmap; FIXME : obtain figure class name to generate getter > else if (viewmap instanceof InnerClassViewmap) { > figureQualifiedClassName = ((InnerClassViewmap) viewmap).getClassName(); > >- stringBuffer.append(TEXT_191); >+ stringBuffer.append(TEXT_193); > stringBuffer.append(figureQualifiedClassName); >- stringBuffer.append(TEXT_192); >+ stringBuffer.append(TEXT_194); > } >- stringBuffer.append(TEXT_193); >+ stringBuffer.append(TEXT_195); > if (genLabel.getViewmap() instanceof InnerClassViewmap) { >- stringBuffer.append(TEXT_194); >+ stringBuffer.append(TEXT_196); > stringBuffer.append(((InnerClassViewmap) genLabel.getViewmap()).getClassBody()); > } /* if inner */ > } /*else if !ParentAssignedViewmap */ >- stringBuffer.append(TEXT_195); >+ stringBuffer.append(TEXT_197); > importManager.emitSortedImports(); >- stringBuffer.append(TEXT_196); >+ stringBuffer.append(TEXT_198); > return stringBuffer.toString(); > } > } >Index: src-templates/org/eclipse/gmf/codegen/templates/parts/LinkLabelEditPartGenerator.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/parts/LinkLabelEditPartGenerator.java,v >retrieving revision 1.35 >diff -u -r1.35 LinkLabelEditPartGenerator.java >--- src-templates/org/eclipse/gmf/codegen/templates/parts/LinkLabelEditPartGenerator.java 9 Jun 2006 12:31:18 -0000 1.35 >+++ src-templates/org/eclipse/gmf/codegen/templates/parts/LinkLabelEditPartGenerator.java 21 Jun 2006 12:24:57 -0000 >@@ -124,65 +124,67 @@ > protected final String TEXT_107 = ") {" + NL + "\t\t\t(("; > protected final String TEXT_108 = ") pdEditPolicy).refreshFeedback();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshUnderline() {" + NL + "\t\t"; > protected final String TEXT_109 = " style =" + NL + "\t\t\t("; >- protected final String TEXT_110 = ") getPrimaryView().getStyle(" + NL + "\t\t\t\t"; >+ protected final String TEXT_110 = ") getFontStyleOwnerView().getStyle(" + NL + "\t\t\t\t"; > protected final String TEXT_111 = ".eINSTANCE.getFontStyle());" + NL + "\t\tif (style != null && getFigure() instanceof "; > protected final String TEXT_112 = ") {" + NL + "\t\t\t(("; > protected final String TEXT_113 = ") getFigure()).setTextUnderline(style.isUnderline());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshStrikeThrough() {" + NL + "\t\t"; > protected final String TEXT_114 = " style =" + NL + "\t\t\t("; >- protected final String TEXT_115 = ") getPrimaryView().getStyle(" + NL + "\t\t\t\t"; >+ protected final String TEXT_115 = ") getFontStyleOwnerView().getStyle(" + NL + "\t\t\t\t"; > protected final String TEXT_116 = ".eINSTANCE.getFontStyle());" + NL + "\t\tif (style != null && getFigure() instanceof "; > protected final String TEXT_117 = ") {" + NL + "\t\t\t(("; > protected final String TEXT_118 = ") getFigure()).setTextStrikeThrough(style.isStrikeThrough());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {" + NL + "\t\t"; > protected final String TEXT_119 = " style =" + NL + "\t\t\t("; >- protected final String TEXT_120 = ") getPrimaryView().getStyle(" + NL + "\t\t\t\t"; >- protected final String TEXT_121 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; >- protected final String TEXT_122 = " fontData;" + NL + "\t\tif (style != null) {" + NL + "\t\t\tfontData = new "; >+ protected final String TEXT_120 = ") getFontStyleOwnerView().getStyle(" + NL + "\t\t\t\t"; >+ protected final String TEXT_121 = ".eINSTANCE.getFontStyle());" + NL + "\t\tif (style != null) {" + NL + "\t\t\t"; >+ protected final String TEXT_122 = " fontData = new "; > protected final String TEXT_123 = "(" + NL + "\t\t\t\tstyle.getFontName(), style.getFontHeight()," + NL + "\t\t\t\t(style.isBold() ? "; > protected final String TEXT_124 = ".BOLD : "; > protected final String TEXT_125 = ".NORMAL) |" + NL + "\t\t\t\t(style.isItalic() ? "; > protected final String TEXT_126 = ".ITALIC : "; >- protected final String TEXT_127 = ".NORMAL));" + NL + "\t\t} else {" + NL + "\t\t\t// initialize font to defaults" + NL + "\t\t\tfontData = "; >- protected final String TEXT_128 = ".getFontData(" + NL + "\t\t\t\t("; >- protected final String TEXT_129 = ") getDiagramPreferencesHint().getPreferenceStore()," + NL + "\t\t\t\t"; >- protected final String TEXT_130 = ".PREF_DEFAULT_FONT);" + NL + "\t\t}" + NL + "\t\tsetFont(fontData);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void setFontColor("; >- protected final String TEXT_131 = " color) {" + NL + "\t\tgetFigure().setForegroundColor(color);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void addSemanticListeners() {" + NL + "\t\tif (getParser() instanceof "; >- protected final String TEXT_132 = ") {" + NL + "\t\t\t"; >- protected final String TEXT_133 = " element = resolveSemanticElement();" + NL + "\t\t\tparserElements = (("; >- protected final String TEXT_134 = ") getParser()).getSemanticElementsBeingParsed(element);" + NL + "\t\t\tfor (int i = 0; i < parserElements.size(); i++) {" + NL + "\t\t\t\taddListenerFilter(\"SemanticModel\" + i, this, ("; >- protected final String TEXT_135 = ") parserElements.get(i)); //$NON-NLS-1$" + NL + "\t\t\t}" + NL + "\t\t} else {" + NL + "\t\t\tsuper.addSemanticListeners();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void removeSemanticListeners() {" + NL + "\t\tif (parserElements != null) {" + NL + "\t\t\tfor (int i = 0; i < parserElements.size(); i++) {" + NL + "\t\t\t\tremoveListenerFilter(\"SemanticModel\" + i); //$NON-NLS-1$" + NL + "\t\t\t}" + NL + "\t\t} else {" + NL + "\t\t\tsuper.removeSemanticListeners();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >- protected final String TEXT_136 = " getAccessibleEditPart() {" + NL + "\t\tif (accessibleEP == null) {" + NL + "\t\t\taccessibleEP = new AccessibleGraphicalEditPart() {" + NL + "" + NL + "\t\t\t\tpublic void getName("; >- protected final String TEXT_137 = " e) {" + NL + "\t\t\t\t\te.result = getLabelTextHelper(getFigure());" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "\t\t}" + NL + "\t\treturn accessibleEP;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void handleNotificationEvent("; >- protected final String TEXT_138 = " event) {" + NL + "\t\tObject feature = event.getFeature();"; >- protected final String TEXT_139 = NL; >- protected final String TEXT_140 = "\t\tif ("; >- protected final String TEXT_141 = ".eINSTANCE.getFontStyle_FontColor().equals(feature)) {" + NL + "\t\t\tInteger c = (Integer) event.getNewValue();" + NL + "\t\t\tsetFontColor("; >- protected final String TEXT_142 = ".getInstance().getColor(c));" + NL + "\t\t} else if ("; >- protected final String TEXT_143 = ".eINSTANCE.getFontStyle_Underline().equals(feature)) {" + NL + "\t\t\trefreshUnderline();" + NL + "\t\t} else if ("; >- protected final String TEXT_144 = ".eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {" + NL + "\t\t\trefreshStrikeThrough();" + NL + "\t\t} else if ("; >- protected final String TEXT_145 = ".eINSTANCE.getFontStyle_FontHeight().equals(feature) ||" + NL + "\t\t\t\t"; >- protected final String TEXT_146 = ".eINSTANCE.getFontStyle_FontName().equals(feature) ||" + NL + "\t\t\t\t"; >- protected final String TEXT_147 = ".eINSTANCE.getFontStyle_Bold().equals(feature) ||" + NL + "\t\t\t\t"; >- protected final String TEXT_148 = ".eINSTANCE.getFontStyle_Italic().equals(feature)) {" + NL + "\t\t\trefreshFont();" + NL + "\t\t} else {" + NL + "\t\t\tif (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {" + NL + "\t\t\t\trefreshLabel();" + NL + "\t\t\t}" + NL + "\t\t\tif (getParser() instanceof ISemanticParser) {" + NL + "\t\t\t\t"; >- protected final String TEXT_149 = " modelParser =" + NL + "\t\t\t\t\t("; >- protected final String TEXT_150 = ") getParser();" + NL + "\t\t\t\tif (modelParser.areSemanticElementsAffected(null, event)) {" + NL + "\t\t\t\t\tremoveSemanticListeners();" + NL + "\t\t\t\t\tif (resolveSemanticElement() != null) {" + NL + "\t\t\t\t\t\taddSemanticListeners();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\trefreshLabel();" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tsuper.handleNotificationEvent(event);" + NL + "\t}"; >- protected final String TEXT_151 = NL; >- protected final String TEXT_152 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >- protected final String TEXT_153 = " createFigure() {" + NL + "\t\t// Parent should assign one using "; >- protected final String TEXT_154 = " method" + NL + "\t\treturn null;" + NL + "\t}"; >- protected final String TEXT_155 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >- protected final String TEXT_156 = " createFigure() {" + NL + "\t\t"; >- protected final String TEXT_157 = " label = createFigurePrim();" + NL + "\t\tdefaultText = getLabelTextHelper(label);" + NL + "\t\treturn label;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >- protected final String TEXT_158 = " createFigurePrim() {"; >- protected final String TEXT_159 = NL + "\t\treturn new "; >- protected final String TEXT_160 = "();"; >- protected final String TEXT_161 = NL + "\t\treturn "; >- protected final String TEXT_162 = ";"; >- protected final String TEXT_163 = NL + "\t\treturn new "; >- protected final String TEXT_164 = "();"; >- protected final String TEXT_165 = NL + "\t}" + NL; >- protected final String TEXT_166 = NL; >- protected final String TEXT_167 = NL + "}"; >+ protected final String TEXT_127 = ".NORMAL));" + NL + "\t\t\tsetFont(fontData);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void setFontColor("; >+ protected final String TEXT_128 = " color) {" + NL + "\t\tgetFigure().setForegroundColor(color);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void addSemanticListeners() {" + NL + "\t\tif (getParser() instanceof "; >+ protected final String TEXT_129 = ") {" + NL + "\t\t\t"; >+ protected final String TEXT_130 = " element = resolveSemanticElement();" + NL + "\t\t\tparserElements = (("; >+ protected final String TEXT_131 = ") getParser()).getSemanticElementsBeingParsed(element);" + NL + "\t\t\tfor (int i = 0; i < parserElements.size(); i++) {" + NL + "\t\t\t\taddListenerFilter(\"SemanticModel\" + i, this, ("; >+ protected final String TEXT_132 = ") parserElements.get(i)); //$NON-NLS-1$" + NL + "\t\t\t}" + NL + "\t\t} else {" + NL + "\t\t\tsuper.addSemanticListeners();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void removeSemanticListeners() {" + NL + "\t\tif (parserElements != null) {" + NL + "\t\t\tfor (int i = 0; i < parserElements.size(); i++) {" + NL + "\t\t\t\tremoveListenerFilter(\"SemanticModel\" + i); //$NON-NLS-1$" + NL + "\t\t\t}" + NL + "\t\t} else {" + NL + "\t\t\tsuper.removeSemanticListeners();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >+ protected final String TEXT_133 = " getAccessibleEditPart() {" + NL + "\t\tif (accessibleEP == null) {" + NL + "\t\t\taccessibleEP = new AccessibleGraphicalEditPart() {" + NL + "" + NL + "\t\t\t\tpublic void getName("; >+ protected final String TEXT_134 = " e) {" + NL + "\t\t\t\t\te.result = getLabelTextHelper(getFigure());" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "\t\t}" + NL + "\t\treturn accessibleEP;" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\t private "; >+ protected final String TEXT_135 = " getFontStyleOwnerView() {"; >+ protected final String TEXT_136 = NL + "\t\treturn ("; >+ protected final String TEXT_137 = ")getModel();"; >+ protected final String TEXT_138 = NL + "\t\treturn getPrimaryView();"; >+ protected final String TEXT_139 = NL + "\t }" + NL + "\t" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void handleNotificationEvent("; >+ protected final String TEXT_140 = " event) {" + NL + "\t\tObject feature = event.getFeature();"; >+ protected final String TEXT_141 = NL; >+ protected final String TEXT_142 = "\t\tif ("; >+ protected final String TEXT_143 = ".eINSTANCE.getFontStyle_FontColor().equals(feature)) {" + NL + "\t\t\tInteger c = (Integer) event.getNewValue();" + NL + "\t\t\tsetFontColor("; >+ protected final String TEXT_144 = ".getInstance().getColor(c));" + NL + "\t\t} else if ("; >+ protected final String TEXT_145 = ".eINSTANCE.getFontStyle_Underline().equals(feature)) {" + NL + "\t\t\trefreshUnderline();" + NL + "\t\t} else if ("; >+ protected final String TEXT_146 = ".eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {" + NL + "\t\t\trefreshStrikeThrough();" + NL + "\t\t} else if ("; >+ protected final String TEXT_147 = ".eINSTANCE.getFontStyle_FontHeight().equals(feature) ||" + NL + "\t\t\t\t"; >+ protected final String TEXT_148 = ".eINSTANCE.getFontStyle_FontName().equals(feature) ||" + NL + "\t\t\t\t"; >+ protected final String TEXT_149 = ".eINSTANCE.getFontStyle_Bold().equals(feature) ||" + NL + "\t\t\t\t"; >+ protected final String TEXT_150 = ".eINSTANCE.getFontStyle_Italic().equals(feature)) {" + NL + "\t\t\trefreshFont();" + NL + "\t\t} else {" + NL + "\t\t\tif (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {" + NL + "\t\t\t\trefreshLabel();" + NL + "\t\t\t}" + NL + "\t\t\tif (getParser() instanceof ISemanticParser) {" + NL + "\t\t\t\t"; >+ protected final String TEXT_151 = " modelParser =" + NL + "\t\t\t\t\t("; >+ protected final String TEXT_152 = ") getParser();" + NL + "\t\t\t\tif (modelParser.areSemanticElementsAffected(null, event)) {" + NL + "\t\t\t\t\tremoveSemanticListeners();" + NL + "\t\t\t\t\tif (resolveSemanticElement() != null) {" + NL + "\t\t\t\t\t\taddSemanticListeners();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\trefreshLabel();" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tsuper.handleNotificationEvent(event);" + NL + "\t}"; >+ protected final String TEXT_153 = NL; >+ protected final String TEXT_154 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >+ protected final String TEXT_155 = " createFigure() {" + NL + "\t\t// Parent should assign one using "; >+ protected final String TEXT_156 = " method" + NL + "\t\treturn null;" + NL + "\t}"; >+ protected final String TEXT_157 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >+ protected final String TEXT_158 = " createFigure() {" + NL + "\t\t"; >+ protected final String TEXT_159 = " label = createFigurePrim();" + NL + "\t\tdefaultText = getLabelTextHelper(label);" + NL + "\t\treturn label;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >+ protected final String TEXT_160 = " createFigurePrim() {"; >+ protected final String TEXT_161 = NL + "\t\treturn new "; >+ protected final String TEXT_162 = "();"; >+ protected final String TEXT_163 = NL + "\t\treturn "; >+ protected final String TEXT_164 = ";"; >+ protected final String TEXT_165 = NL + "\t\treturn new "; >+ protected final String TEXT_166 = "();"; >+ protected final String TEXT_167 = NL + "\t}" + NL; > protected final String TEXT_168 = NL; >+ protected final String TEXT_169 = NL + "}"; >+ protected final String TEXT_170 = NL; > > public String generate(Object argument) > { >@@ -473,37 +475,49 @@ > stringBuffer.append(TEXT_126); > stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); > stringBuffer.append(TEXT_127); >- stringBuffer.append(importManager.getImportedName("org.eclipse.jface.preference.PreferenceConverter")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); > stringBuffer.append(TEXT_128); >- stringBuffer.append(importManager.getImportedName("org.eclipse.jface.preference.IPreferenceStore")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser")); > stringBuffer.append(TEXT_129); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); > stringBuffer.append(TEXT_130); >- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); >- stringBuffer.append(TEXT_131); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser")); >- stringBuffer.append(TEXT_132); >+ stringBuffer.append(TEXT_131); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); >+ stringBuffer.append(TEXT_132); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.AccessibleEditPart")); > stringBuffer.append(TEXT_133); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.accessibility.AccessibleEvent")); > stringBuffer.append(TEXT_134); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); > stringBuffer.append(TEXT_135); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.AccessibleEditPart")); >+ >+boolean fixedFont; >+{ //namespace >+Viewmap viewmap = genLabel.getViewmap(); >+StyleAttributes styleAttributes = (viewmap == null) ? null : (StyleAttributes)viewmap.find(StyleAttributes.class); >+fixedFont = styleAttributes != null && styleAttributes.isFixedFont(); >+} >+if (fixedFont) { >+ > stringBuffer.append(TEXT_136); >- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.accessibility.AccessibleEvent")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); > stringBuffer.append(TEXT_137); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); >+ >+} else { >+ > stringBuffer.append(TEXT_138); >+ >+} >+ > stringBuffer.append(TEXT_139); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); > stringBuffer.append(TEXT_140); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_141); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry")); > stringBuffer.append(TEXT_142); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_143); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry")); > stringBuffer.append(TEXT_144); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_145); >@@ -513,26 +527,30 @@ > stringBuffer.append(TEXT_147); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_148); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_149); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_150); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser")); > stringBuffer.append(TEXT_151); >- if (genLabel.getViewmap() instanceof ParentAssignedViewmap) { >- final ParentAssignedViewmap viewmap = (ParentAssignedViewmap) genLabel.getViewmap(); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser")); > stringBuffer.append(TEXT_152); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); > stringBuffer.append(TEXT_153); >- stringBuffer.append((viewmap.getSetterName() == null ? "setLabel" : viewmap.getSetterName())); >+ if (genLabel.getViewmap() instanceof ParentAssignedViewmap) { >+ final ParentAssignedViewmap viewmap = (ParentAssignedViewmap) genLabel.getViewmap(); > stringBuffer.append(TEXT_154); >- } else { >- stringBuffer.append(TEXT_155); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); >+ stringBuffer.append(TEXT_155); >+ stringBuffer.append((viewmap.getSetterName() == null ? "setLabel" : viewmap.getSetterName())); > stringBuffer.append(TEXT_156); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); >+ } else { > stringBuffer.append(TEXT_157); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); > stringBuffer.append(TEXT_158); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); >+ stringBuffer.append(TEXT_159); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); >+ stringBuffer.append(TEXT_160); > > String figureQualifiedClassName = null; > Viewmap viewmap = genLabel.getViewmap(); >@@ -542,31 +560,31 @@ > figureQualifiedClassName = "org.eclipse.draw2d.Label"; > } > >- stringBuffer.append(TEXT_159); >+ stringBuffer.append(TEXT_161); > stringBuffer.append(importManager.getImportedName(figureQualifiedClassName)); >- stringBuffer.append(TEXT_160); >+ stringBuffer.append(TEXT_162); > } // instanceof FigureViewmap > else if (viewmap instanceof SnippetViewmap) { >- stringBuffer.append(TEXT_161); >+ stringBuffer.append(TEXT_163); > stringBuffer.append(((SnippetViewmap) viewmap).getBody()); >- stringBuffer.append(TEXT_162); >+ stringBuffer.append(TEXT_164); > } // instanceof SnippetViewmap; FIXME : obtain figure class name to generate getter > else if (viewmap instanceof InnerClassViewmap) { > figureQualifiedClassName = ((InnerClassViewmap) viewmap).getClassName(); > >- stringBuffer.append(TEXT_163); >+ stringBuffer.append(TEXT_165); > stringBuffer.append(figureQualifiedClassName); >- stringBuffer.append(TEXT_164); >+ stringBuffer.append(TEXT_166); > } >- stringBuffer.append(TEXT_165); >+ stringBuffer.append(TEXT_167); > if (genLabel.getViewmap() instanceof InnerClassViewmap) { >- stringBuffer.append(TEXT_166); >+ stringBuffer.append(TEXT_168); > stringBuffer.append(((InnerClassViewmap) genLabel.getViewmap()).getClassBody()); > } /* if inner */ > } /*else if !ParentAssignedViewmap */ >- stringBuffer.append(TEXT_167); >+ stringBuffer.append(TEXT_169); > importManager.emitSortedImports(); >- stringBuffer.append(TEXT_168); >+ stringBuffer.append(TEXT_170); > return stringBuffer.toString(); > } > } >Index: src-templates/org/eclipse/gmf/codegen/templates/parts/ChildNodeEditPartGenerator.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/parts/ChildNodeEditPartGenerator.java,v >retrieving revision 1.56 >diff -u -r1.56 ChildNodeEditPartGenerator.java >--- src-templates/org/eclipse/gmf/codegen/templates/parts/ChildNodeEditPartGenerator.java 9 Jun 2006 12:31:18 -0000 1.56 >+++ src-templates/org/eclipse/gmf/codegen/templates/parts/ChildNodeEditPartGenerator.java 21 Jun 2006 12:24:56 -0000 >@@ -121,67 +121,69 @@ > protected final String TEXT_104 = ") {" + NL + "\t\t\t(("; > protected final String TEXT_105 = ") pdEditPolicy).refreshFeedback();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshUnderline() {" + NL + "\t\t"; > protected final String TEXT_106 = " style =" + NL + "\t\t\t("; >- protected final String TEXT_107 = ") getPrimaryView().getStyle(" + NL + "\t\t\t\t"; >+ protected final String TEXT_107 = ") getFontStyleOwnerView().getStyle(" + NL + "\t\t\t\t"; > protected final String TEXT_108 = ".eINSTANCE.getFontStyle());" + NL + "\t\tif (style != null && getFigure() instanceof "; > protected final String TEXT_109 = ") {" + NL + "\t\t\t(("; > protected final String TEXT_110 = ") getFigure()).setTextUnderline(style.isUnderline());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshStrikeThrough() {" + NL + "\t\t"; > protected final String TEXT_111 = " style =" + NL + "\t\t\t("; >- protected final String TEXT_112 = ") getPrimaryView().getStyle(" + NL + "\t\t\t\t"; >+ protected final String TEXT_112 = ") getFontStyleOwnerView().getStyle(" + NL + "\t\t\t\t"; > protected final String TEXT_113 = ".eINSTANCE.getFontStyle());" + NL + "\t\tif (style != null && getFigure() instanceof "; > protected final String TEXT_114 = ") {" + NL + "\t\t\t(("; > protected final String TEXT_115 = ") getFigure()).setTextStrikeThrough(style.isStrikeThrough());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {" + NL + "\t\t"; > protected final String TEXT_116 = " style =" + NL + "\t\t\t("; >- protected final String TEXT_117 = ") getPrimaryView().getStyle(" + NL + "\t\t\t\t"; >- protected final String TEXT_118 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; >- protected final String TEXT_119 = " fontData;" + NL + "\t\tif (style != null) {" + NL + "\t\t\tfontData = new "; >+ protected final String TEXT_117 = ") getFontStyleOwnerView().getStyle(" + NL + "\t\t\t\t"; >+ protected final String TEXT_118 = ".eINSTANCE.getFontStyle());" + NL + "\t\tif (style != null) {" + NL + "\t\t\t"; >+ protected final String TEXT_119 = " fontData = new "; > protected final String TEXT_120 = "(" + NL + "\t\t\t\tstyle.getFontName(), style.getFontHeight()," + NL + "\t\t\t\t(style.isBold() ? "; > protected final String TEXT_121 = ".BOLD : "; > protected final String TEXT_122 = ".NORMAL) |" + NL + "\t\t\t\t(style.isItalic() ? "; > protected final String TEXT_123 = ".ITALIC : "; >- protected final String TEXT_124 = ".NORMAL));" + NL + "\t\t} else {" + NL + "\t\t\t// initialize font to defaults" + NL + "\t\t\tfontData = "; >- protected final String TEXT_125 = ".getFontData(" + NL + "\t\t\t\t("; >- protected final String TEXT_126 = ") getDiagramPreferencesHint().getPreferenceStore()," + NL + "\t\t\t\t"; >- protected final String TEXT_127 = ".PREF_DEFAULT_FONT);" + NL + "\t\t}" + NL + "\t\tsetFont(fontData);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void setFontColor("; >- protected final String TEXT_128 = " color) {" + NL + "\t\tgetFigure().setForegroundColor(color);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void addSemanticListeners() {" + NL + "\t\tif (getParser() instanceof "; >- protected final String TEXT_129 = ") {" + NL + "\t\t\t"; >- protected final String TEXT_130 = " element = resolveSemanticElement();" + NL + "\t\t\tparserElements = (("; >- protected final String TEXT_131 = ") getParser()).getSemanticElementsBeingParsed(element);" + NL + "\t\t\tfor (int i = 0; i < parserElements.size(); i++) {" + NL + "\t\t\t\taddListenerFilter(\"SemanticModel\" + i, this, ("; >- protected final String TEXT_132 = ") parserElements.get(i)); //$NON-NLS-1$" + NL + "\t\t\t}" + NL + "\t\t} else {" + NL + "\t\t\tsuper.addSemanticListeners();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void removeSemanticListeners() {" + NL + "\t\tif (parserElements != null) {" + NL + "\t\t\tfor (int i = 0; i < parserElements.size(); i++) {" + NL + "\t\t\t\tremoveListenerFilter(\"SemanticModel\" + i); //$NON-NLS-1$" + NL + "\t\t\t}" + NL + "\t\t} else {" + NL + "\t\t\tsuper.removeSemanticListeners();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >- protected final String TEXT_133 = " getAccessibleEditPart() {" + NL + "\t\tif (accessibleEP == null) {" + NL + "\t\t\taccessibleEP = new AccessibleGraphicalEditPart() {" + NL + "" + NL + "\t\t\t\tpublic void getName("; >- protected final String TEXT_134 = " e) {" + NL + "\t\t\t\t\te.result = getLabelTextHelper(getFigure());" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "\t\t}" + NL + "\t\treturn accessibleEP;" + NL + "\t}"; >- protected final String TEXT_135 = NL; >- protected final String TEXT_136 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void addNotationalListeners() {" + NL + "\t\tsuper.addNotationalListeners();" + NL + "\t\taddListenerFilter(\"PrimaryView\", this, getPrimaryView()); //$NON-NLS-1$" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void removeNotationalListeners() {" + NL + "\t\tsuper.removeNotationalListeners();" + NL + "\t\tremoveListenerFilter(\"PrimaryView\"); //$NON-NLS-1$" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void handleNotificationEvent("; >- protected final String TEXT_137 = " event) {" + NL + "\t\tObject feature = event.getFeature();"; >- protected final String TEXT_138 = NL; >- protected final String TEXT_139 = "\t\tif ("; >- protected final String TEXT_140 = ".eINSTANCE.getFontStyle_FontColor().equals(feature)) {" + NL + "\t\t\tInteger c = (Integer) event.getNewValue();" + NL + "\t\t\tsetFontColor("; >- protected final String TEXT_141 = ".getInstance().getColor(c));" + NL + "\t\t} else if ("; >- protected final String TEXT_142 = ".eINSTANCE.getFontStyle_Underline().equals(feature)) {" + NL + "\t\t\trefreshUnderline();" + NL + "\t\t} else if ("; >- protected final String TEXT_143 = ".eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {" + NL + "\t\t\trefreshStrikeThrough();" + NL + "\t\t} else if ("; >- protected final String TEXT_144 = ".eINSTANCE.getFontStyle_FontHeight().equals(feature) ||" + NL + "\t\t\t\t"; >- protected final String TEXT_145 = ".eINSTANCE.getFontStyle_FontName().equals(feature) ||" + NL + "\t\t\t\t"; >- protected final String TEXT_146 = ".eINSTANCE.getFontStyle_Bold().equals(feature) ||" + NL + "\t\t\t\t"; >- protected final String TEXT_147 = ".eINSTANCE.getFontStyle_Italic().equals(feature)) {" + NL + "\t\t\trefreshFont();" + NL + "\t\t} else {" + NL + "\t\t\tif (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {" + NL + "\t\t\t\trefreshLabel();" + NL + "\t\t\t}" + NL + "\t\t\tif (getParser() instanceof ISemanticParser) {" + NL + "\t\t\t\t"; >- protected final String TEXT_148 = " modelParser =" + NL + "\t\t\t\t\t("; >- protected final String TEXT_149 = ") getParser();" + NL + "\t\t\t\tif (modelParser.areSemanticElementsAffected(null, event)) {" + NL + "\t\t\t\t\tremoveSemanticListeners();" + NL + "\t\t\t\t\tif (resolveSemanticElement() != null) {" + NL + "\t\t\t\t\t\taddSemanticListeners();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\trefreshLabel();" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tsuper.handleNotificationEvent(event);" + NL + "\t}"; >- protected final String TEXT_150 = NL; >- protected final String TEXT_151 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >- protected final String TEXT_152 = " createFigure() {" + NL + "\t\t// Parent should assign one using "; >- protected final String TEXT_153 = " method" + NL + "\t\treturn null;" + NL + "\t}"; >- protected final String TEXT_154 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >- protected final String TEXT_155 = " createFigure() {" + NL + "\t\t"; >- protected final String TEXT_156 = " label = createFigurePrim();" + NL + "\t\tdefaultText = getLabelTextHelper(label);" + NL + "\t\treturn label;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >- protected final String TEXT_157 = " createFigurePrim() {"; >- protected final String TEXT_158 = NL + "\t\treturn new "; >- protected final String TEXT_159 = "();"; >- protected final String TEXT_160 = NL + "\t\treturn "; >- protected final String TEXT_161 = ";"; >- protected final String TEXT_162 = NL + "\t\treturn new "; >- protected final String TEXT_163 = "();"; >- protected final String TEXT_164 = NL + "\t}" + NL; >- protected final String TEXT_165 = NL; >- protected final String TEXT_166 = NL + "}"; >+ protected final String TEXT_124 = ".NORMAL));" + NL + "\t\t\tsetFont(fontData);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void setFontColor("; >+ protected final String TEXT_125 = " color) {" + NL + "\t\tgetFigure().setForegroundColor(color);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void addSemanticListeners() {" + NL + "\t\tif (getParser() instanceof "; >+ protected final String TEXT_126 = ") {" + NL + "\t\t\t"; >+ protected final String TEXT_127 = " element = resolveSemanticElement();" + NL + "\t\t\tparserElements = (("; >+ protected final String TEXT_128 = ") getParser()).getSemanticElementsBeingParsed(element);" + NL + "\t\t\tfor (int i = 0; i < parserElements.size(); i++) {" + NL + "\t\t\t\taddListenerFilter(\"SemanticModel\" + i, this, ("; >+ protected final String TEXT_129 = ") parserElements.get(i)); //$NON-NLS-1$" + NL + "\t\t\t}" + NL + "\t\t} else {" + NL + "\t\t\tsuper.addSemanticListeners();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void removeSemanticListeners() {" + NL + "\t\tif (parserElements != null) {" + NL + "\t\t\tfor (int i = 0; i < parserElements.size(); i++) {" + NL + "\t\t\t\tremoveListenerFilter(\"SemanticModel\" + i); //$NON-NLS-1$" + NL + "\t\t\t}" + NL + "\t\t} else {" + NL + "\t\t\tsuper.removeSemanticListeners();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >+ protected final String TEXT_130 = " getAccessibleEditPart() {" + NL + "\t\tif (accessibleEP == null) {" + NL + "\t\t\taccessibleEP = new AccessibleGraphicalEditPart() {" + NL + "" + NL + "\t\t\t\tpublic void getName("; >+ protected final String TEXT_131 = " e) {" + NL + "\t\t\t\t\te.result = getLabelTextHelper(getFigure());" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "\t\t}" + NL + "\t\treturn accessibleEP;" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\t private "; >+ protected final String TEXT_132 = " getFontStyleOwnerView() {"; >+ protected final String TEXT_133 = NL + "\t\treturn ("; >+ protected final String TEXT_134 = ")getModel();"; >+ protected final String TEXT_135 = NL + "\t\treturn getPrimaryView();"; >+ protected final String TEXT_136 = NL + "\t }" + NL + "\t"; >+ protected final String TEXT_137 = NL; >+ protected final String TEXT_138 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void addNotationalListeners() {" + NL + "\t\tsuper.addNotationalListeners();" + NL + "\t\taddListenerFilter(\"PrimaryView\", this, getPrimaryView()); //$NON-NLS-1$" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void removeNotationalListeners() {" + NL + "\t\tsuper.removeNotationalListeners();" + NL + "\t\tremoveListenerFilter(\"PrimaryView\"); //$NON-NLS-1$" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void handleNotificationEvent("; >+ protected final String TEXT_139 = " event) {" + NL + "\t\tObject feature = event.getFeature();"; >+ protected final String TEXT_140 = NL; >+ protected final String TEXT_141 = "\t\tif ("; >+ protected final String TEXT_142 = ".eINSTANCE.getFontStyle_FontColor().equals(feature)) {" + NL + "\t\t\tInteger c = (Integer) event.getNewValue();" + NL + "\t\t\tsetFontColor("; >+ protected final String TEXT_143 = ".getInstance().getColor(c));" + NL + "\t\t} else if ("; >+ protected final String TEXT_144 = ".eINSTANCE.getFontStyle_Underline().equals(feature)) {" + NL + "\t\t\trefreshUnderline();" + NL + "\t\t} else if ("; >+ protected final String TEXT_145 = ".eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {" + NL + "\t\t\trefreshStrikeThrough();" + NL + "\t\t} else if ("; >+ protected final String TEXT_146 = ".eINSTANCE.getFontStyle_FontHeight().equals(feature) ||" + NL + "\t\t\t\t"; >+ protected final String TEXT_147 = ".eINSTANCE.getFontStyle_FontName().equals(feature) ||" + NL + "\t\t\t\t"; >+ protected final String TEXT_148 = ".eINSTANCE.getFontStyle_Bold().equals(feature) ||" + NL + "\t\t\t\t"; >+ protected final String TEXT_149 = ".eINSTANCE.getFontStyle_Italic().equals(feature)) {" + NL + "\t\t\trefreshFont();" + NL + "\t\t} else {" + NL + "\t\t\tif (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {" + NL + "\t\t\t\trefreshLabel();" + NL + "\t\t\t}" + NL + "\t\t\tif (getParser() instanceof ISemanticParser) {" + NL + "\t\t\t\t"; >+ protected final String TEXT_150 = " modelParser =" + NL + "\t\t\t\t\t("; >+ protected final String TEXT_151 = ") getParser();" + NL + "\t\t\t\tif (modelParser.areSemanticElementsAffected(null, event)) {" + NL + "\t\t\t\t\tremoveSemanticListeners();" + NL + "\t\t\t\t\tif (resolveSemanticElement() != null) {" + NL + "\t\t\t\t\t\taddSemanticListeners();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\trefreshLabel();" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tsuper.handleNotificationEvent(event);" + NL + "\t}"; >+ protected final String TEXT_152 = NL; >+ protected final String TEXT_153 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >+ protected final String TEXT_154 = " createFigure() {" + NL + "\t\t// Parent should assign one using "; >+ protected final String TEXT_155 = " method" + NL + "\t\treturn null;" + NL + "\t}"; >+ protected final String TEXT_156 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >+ protected final String TEXT_157 = " createFigure() {" + NL + "\t\t"; >+ protected final String TEXT_158 = " label = createFigurePrim();" + NL + "\t\tdefaultText = getLabelTextHelper(label);" + NL + "\t\treturn label;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >+ protected final String TEXT_159 = " createFigurePrim() {"; >+ protected final String TEXT_160 = NL + "\t\treturn new "; >+ protected final String TEXT_161 = "();"; >+ protected final String TEXT_162 = NL + "\t\treturn "; >+ protected final String TEXT_163 = ";"; >+ protected final String TEXT_164 = NL + "\t\treturn new "; >+ protected final String TEXT_165 = "();"; >+ protected final String TEXT_166 = NL + "\t}" + NL; > protected final String TEXT_167 = NL; >+ protected final String TEXT_168 = NL + "}"; >+ protected final String TEXT_169 = NL; > > public String generate(Object argument) > { >@@ -459,39 +461,51 @@ > stringBuffer.append(TEXT_123); > stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); > stringBuffer.append(TEXT_124); >- stringBuffer.append(importManager.getImportedName("org.eclipse.jface.preference.PreferenceConverter")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); > stringBuffer.append(TEXT_125); >- stringBuffer.append(importManager.getImportedName("org.eclipse.jface.preference.IPreferenceStore")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser")); > stringBuffer.append(TEXT_126); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); > stringBuffer.append(TEXT_127); >- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); >- stringBuffer.append(TEXT_128); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser")); >- stringBuffer.append(TEXT_129); >+ stringBuffer.append(TEXT_128); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); >+ stringBuffer.append(TEXT_129); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.AccessibleEditPart")); > stringBuffer.append(TEXT_130); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.accessibility.AccessibleEvent")); > stringBuffer.append(TEXT_131); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); > stringBuffer.append(TEXT_132); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.AccessibleEditPart")); >+ >+boolean fixedFont; >+{ //namespace >+Viewmap viewmap = genLabel.getViewmap(); >+StyleAttributes styleAttributes = (viewmap == null) ? null : (StyleAttributes)viewmap.find(StyleAttributes.class); >+fixedFont = styleAttributes != null && styleAttributes.isFixedFont(); >+} >+if (fixedFont) { >+ > stringBuffer.append(TEXT_133); >- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.accessibility.AccessibleEvent")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); > stringBuffer.append(TEXT_134); >+ >+} else { >+ > stringBuffer.append(TEXT_135); >+ >+} >+ > stringBuffer.append(TEXT_136); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); > stringBuffer.append(TEXT_137); > stringBuffer.append(TEXT_138); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); > stringBuffer.append(TEXT_139); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_140); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry")); > stringBuffer.append(TEXT_141); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_142); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry")); > stringBuffer.append(TEXT_143); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_144); >@@ -501,26 +515,30 @@ > stringBuffer.append(TEXT_146); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_147); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_148); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_149); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser")); > stringBuffer.append(TEXT_150); >- if (genLabel.getViewmap() instanceof ParentAssignedViewmap) { >- final ParentAssignedViewmap viewmap = (ParentAssignedViewmap) genLabel.getViewmap(); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser")); > stringBuffer.append(TEXT_151); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); > stringBuffer.append(TEXT_152); >- stringBuffer.append((viewmap.getSetterName() == null ? "setLabel" : viewmap.getSetterName())); >+ if (genLabel.getViewmap() instanceof ParentAssignedViewmap) { >+ final ParentAssignedViewmap viewmap = (ParentAssignedViewmap) genLabel.getViewmap(); > stringBuffer.append(TEXT_153); >- } else { >- stringBuffer.append(TEXT_154); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); >+ stringBuffer.append(TEXT_154); >+ stringBuffer.append((viewmap.getSetterName() == null ? "setLabel" : viewmap.getSetterName())); > stringBuffer.append(TEXT_155); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); >+ } else { > stringBuffer.append(TEXT_156); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); > stringBuffer.append(TEXT_157); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); >+ stringBuffer.append(TEXT_158); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); >+ stringBuffer.append(TEXT_159); > > String figureQualifiedClassName = null; > Viewmap viewmap = genLabel.getViewmap(); >@@ -530,31 +548,31 @@ > figureQualifiedClassName = "org.eclipse.draw2d.Label"; > } > >- stringBuffer.append(TEXT_158); >+ stringBuffer.append(TEXT_160); > stringBuffer.append(importManager.getImportedName(figureQualifiedClassName)); >- stringBuffer.append(TEXT_159); >+ stringBuffer.append(TEXT_161); > } // instanceof FigureViewmap > else if (viewmap instanceof SnippetViewmap) { >- stringBuffer.append(TEXT_160); >+ stringBuffer.append(TEXT_162); > stringBuffer.append(((SnippetViewmap) viewmap).getBody()); >- stringBuffer.append(TEXT_161); >+ stringBuffer.append(TEXT_163); > } // instanceof SnippetViewmap; FIXME : obtain figure class name to generate getter > else if (viewmap instanceof InnerClassViewmap) { > figureQualifiedClassName = ((InnerClassViewmap) viewmap).getClassName(); > >- stringBuffer.append(TEXT_162); >+ stringBuffer.append(TEXT_164); > stringBuffer.append(figureQualifiedClassName); >- stringBuffer.append(TEXT_163); >+ stringBuffer.append(TEXT_165); > } >- stringBuffer.append(TEXT_164); >+ stringBuffer.append(TEXT_166); > if (genLabel.getViewmap() instanceof InnerClassViewmap) { >- stringBuffer.append(TEXT_165); >+ stringBuffer.append(TEXT_167); > stringBuffer.append(((InnerClassViewmap) genLabel.getViewmap()).getClassBody()); > } /* if inner */ > } /*else if !ParentAssignedViewmap */ >- stringBuffer.append(TEXT_166); >+ stringBuffer.append(TEXT_168); > importManager.emitSortedImports(); >- stringBuffer.append(TEXT_167); >+ stringBuffer.append(TEXT_169); > return stringBuffer.toString(); > } > } >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.36 >diff -u -r1.36 ViewFactory.javajet >--- templates/providers/ViewFactory.javajet 19 Jun 2006 12:42:03 -0000 1.36 >+++ templates/providers/ViewFactory.javajet 21 Jun 2006 12:24:58 -0000 >@@ -27,6 +27,11 @@ > GenCompartment genCompartment = (GenCompartment)genElement; > isCompartmentWithOwnBounds = ViewmapLayoutTypeHelper.getSharedInstance().isStoringChildPositions(genCompartment.getNode()); > } >+ >+Viewmap viewmap = genElement.getViewmap(); >+StyleAttributes styleAttributes = (viewmap == null) ? null : (StyleAttributes)viewmap.find(StyleAttributes.class); >+boolean fixedForeground = styleAttributes != null && styleAttributes.isFixedForeground(); >+boolean fixedFont = styleAttributes != null && styleAttributes.isFixedFont(); > %> > > /** >@@ -58,9 +63,6 @@ > %> > 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()); >@@ -69,6 +71,7 @@ > } > if (isLabel) { > //no styles for label >+ //FIXME: throw new IllegalStateExcpetion("Labels to be processed in the LabelTextViewFactory/LabelViewFactory"); > } > if (isDiagram) { > %> >@@ -95,8 +98,12 @@ > <% > } > if (isShape || isCompartmentWithOwnBounds) { >+ if (!fixedFont){ > %> > 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()); >Index: templates/providers/LabelTextViewFactory.javajet >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen/templates/providers/LabelTextViewFactory.javajet,v >retrieving revision 1.12 >diff -u -r1.12 LabelTextViewFactory.javajet >--- templates/providers/LabelTextViewFactory.javajet 9 Jun 2006 12:31:18 -0000 1.12 >+++ templates/providers/LabelTextViewFactory.javajet 21 Jun 2006 12:24:58 -0000 >@@ -5,6 +5,13 @@ > final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1]; > GenDiagram genDiagram = genLabel.getDiagram(); > ViewmapLayoutTypeHelper layoutHelper = ViewmapLayoutTypeHelper.getSharedInstance(); >+ >+final boolean hasShapeStyles = layoutHelper.isStoringChildPositions(genLabel.getNode()); >+final boolean isDesignLabel = genLabel.getModelFacet() instanceof DesignLabelModelFacet; >+ >+Viewmap viewmap = genLabel.getViewmap(); >+StyleAttributes styleAttributes = (viewmap == null) ? null : (StyleAttributes)viewmap.find(StyleAttributes.class); >+final boolean isFixedFont = styleAttributes != null && styleAttributes.isFixedFont(); > %> > <%@ include file="../copyright4java.jetinc"%> > <%importManager.emitPackageStatement(stringBuffer);%> >@@ -26,15 +33,31 @@ > protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) { > super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted); > } >-<%if (genLabel.getModelFacet() instanceof DesignLabelModelFacet) {%> >+ > /** > * @generated > */ > protected List createStyles(View view) { >- <%=importManager.getImportedName("java.util.List")%> styles = super.createStyles(view); >+ <%=importManager.getImportedName("java.util.List")%> styles = new <%=importManager.getImportedName("java.util.ArrayList")%>(); >+<% >+if (hasShapeStyles || isDesignLabel) { >+%> > styles.add(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createDescriptionStyle()); >+<% >+} >+if (hasShapeStyles) { >+%> >+ styles.add(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createFillStyle()); >+ styles.add(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createLineStyle()); >+<% >+ if (!isFixedFont) { >+%> >+ styles.add(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createFontStyle()); >+<% >+ } >+} >+%> > return styles; > } >-<%}%> > } > <%importManager.emitSortedImports();%> >Index: templates/providers/LabelViewFactory.javajet >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen/templates/providers/LabelViewFactory.javajet,v >retrieving revision 1.10 >diff -u -r1.10 LabelViewFactory.javajet >--- templates/providers/LabelViewFactory.javajet 9 Jun 2006 12:31:18 -0000 1.10 >+++ templates/providers/LabelViewFactory.javajet 21 Jun 2006 12:24:58 -0000 >@@ -25,15 +25,15 @@ > String semanticHint, int index, boolean persisted) { > super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted); > } >-<%if (genLabel.getModelFacet() instanceof DesignLabelModelFacet) {%> > /** > * @generated > */ > protected List createStyles(View view) { >- <%=importManager.getImportedName("java.util.List")%> styles = super.createStyles(view); >+ <%=importManager.getImportedName("java.util.List")%> styles = new <%=importManager.getImportedName("java.util.ArrayList")%>(); >+<%if (genLabel.getModelFacet() instanceof DesignLabelModelFacet) {%> > styles.add(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createDescriptionStyle()); >+<%}%> > return styles; > } >-<%}%> > } > <%importManager.emitSortedImports();%> >Index: templates/parts/textAware.jetinc >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen/templates/parts/textAware.jetinc,v >retrieving revision 1.15 >diff -u -r1.15 textAware.jetinc >--- templates/parts/textAware.jetinc 9 Jun 2006 12:31:18 -0000 1.15 >+++ templates/parts/textAware.jetinc 21 Jun 2006 12:24:58 -0000 >@@ -335,7 +335,7 @@ > */ > protected void refreshUnderline() { > <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")%> style = >- (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")%>) getPrimaryView().getStyle( >+ (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")%>) getFontStyleOwnerView().getStyle( > <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")%>.eINSTANCE.getFontStyle()); > if (style != null && getFigure() instanceof <%=importManager.getImportedName("org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel")%>) { > ((<%=importManager.getImportedName("org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel")%>) getFigure()).setTextUnderline(style.isUnderline()); >@@ -347,7 +347,7 @@ > */ > protected void refreshStrikeThrough() { > <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")%> style = >- (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")%>) getPrimaryView().getStyle( >+ (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")%>) getFontStyleOwnerView().getStyle( > <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")%>.eINSTANCE.getFontStyle()); > if (style != null && getFigure() instanceof <%=importManager.getImportedName("org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel")%>) { > ((<%=importManager.getImportedName("org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel")%>) getFigure()).setTextStrikeThrough(style.isStrikeThrough()); >@@ -359,21 +359,15 @@ > */ > protected void refreshFont() { > <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")%> style = >- (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")%>) getPrimaryView().getStyle( >+ (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")%>) getFontStyleOwnerView().getStyle( > <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")%>.eINSTANCE.getFontStyle()); >- <%=importManager.getImportedName("org.eclipse.swt.graphics.FontData")%> fontData; > if (style != null) { >- fontData = new <%=importManager.getImportedName("org.eclipse.swt.graphics.FontData")%>( >+ <%=importManager.getImportedName("org.eclipse.swt.graphics.FontData")%> fontData = new <%=importManager.getImportedName("org.eclipse.swt.graphics.FontData")%>( > style.getFontName(), style.getFontHeight(), > (style.isBold() ? <%=importManager.getImportedName("org.eclipse.swt.SWT")%>.BOLD : <%=importManager.getImportedName("org.eclipse.swt.SWT")%>.NORMAL) | > (style.isItalic() ? <%=importManager.getImportedName("org.eclipse.swt.SWT")%>.ITALIC : <%=importManager.getImportedName("org.eclipse.swt.SWT")%>.NORMAL)); >- } else { >- // initialize font to defaults >- fontData = <%=importManager.getImportedName("org.eclipse.jface.preference.PreferenceConverter")%>.getFontData( >- (<%=importManager.getImportedName("org.eclipse.jface.preference.IPreferenceStore")%>) getDiagramPreferencesHint().getPreferenceStore(), >- <%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants")%>.PREF_DEFAULT_FONT); >+ setFont(fontData); > } >- setFont(fontData); > } > > /** >@@ -425,3 +419,27 @@ > } > return accessibleEP; > } >+ >+ /** >+ * @generated >+ */ >+ private <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> getFontStyleOwnerView() { >+<% >+boolean fixedFont; >+{ //namespace >+Viewmap viewmap = genLabel.getViewmap(); >+StyleAttributes styleAttributes = (viewmap == null) ? null : (StyleAttributes)viewmap.find(StyleAttributes.class); >+fixedFont = styleAttributes != null && styleAttributes.isFixedFont(); >+} >+if (fixedFont) { >+%> >+ return (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%>)getModel(); >+<% >+} else { >+%> >+ return getPrimaryView(); >+<% >+} >+%> >+ } >+ >#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.18 >diff -u -r1.18 DiagramNodeTest.java >--- src/org/eclipse/gmf/tests/gef/DiagramNodeTest.java 19 Jun 2006 17:28:35 -0000 1.18 >+++ src/org/eclipse/gmf/tests/gef/DiagramNodeTest.java 21 Jun 2006 12:25:02 -0000 >@@ -11,6 +11,8 @@ > */ > package org.eclipse.gmf.tests.gef; > >+import java.util.Iterator; >+ > import org.eclipse.draw2d.IFigure; > import org.eclipse.draw2d.PolylineConnection; > import org.eclipse.draw2d.PositionConstants; >@@ -18,13 +20,18 @@ > import org.eclipse.draw2d.geometry.Point; > import org.eclipse.gef.ConnectionEditPart; > import org.eclipse.gef.EditPart; >+import org.eclipse.gef.GraphicalEditPart; > import org.eclipse.gef.RequestConstants; > import org.eclipse.gef.commands.Command; > import org.eclipse.gef.requests.ChangeBoundsRequest; >+import org.eclipse.gmf.codegen.gmfgen.GenLabel; > import org.eclipse.gmf.codegen.gmfgen.GenLink; >+import org.eclipse.gmf.codegen.gmfgen.GenNode; > import org.eclipse.gmf.gmfgraph.Color; > import org.eclipse.gmf.gmfgraph.Connection; >+import org.eclipse.gmf.gmfgraph.DiagramLabel; > import org.eclipse.gmf.gmfgraph.Figure; >+import org.eclipse.gmf.gmfgraph.Font; > import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities; > import org.eclipse.gmf.runtime.notation.Edge; > import org.eclipse.gmf.runtime.notation.FillStyle; >@@ -35,6 +42,8 @@ > import org.eclipse.gmf.runtime.notation.Size; > import org.eclipse.gmf.runtime.notation.View; > import org.eclipse.gmf.tests.gen.GenericFigureCheck; >+import org.eclipse.gmf.tests.setup.CompartmentsSessionSetup; >+import org.eclipse.gmf.tests.setup.DiaGenSource; > import org.eclipse.swt.graphics.RGB; > > public class DiagramNodeTest extends DiagramTestBase { >@@ -71,7 +80,48 @@ > ConnectionEditPart linkByRef = createAndCheckLink(nodeA, nodeB, getSetup().getGenModel().getLinkD()); > checkLinkColor(linkByRef, getSetup().getMapModel().getReferenceLink().getDiagramLink()); > } >- >+ >+ public void testLabelFonts(){ >+ class FontChecker extends GenericFigureCheck { >+ public FontChecker(){ >+ super(null); >+ } >+ >+ public void createAndCheckLabels(GenNode prototype, DiagramLabel eLabel, View notationContainer){ >+ assertFalse(prototype.getLabels().isEmpty()); >+ View node = createNode(prototype, notationContainer); >+ for (Iterator allLabels = prototype.getLabels().iterator(); allLabels.hasNext();){ >+ GenLabel nextLabelType = (GenLabel)allLabels.next(); >+ View notationLabel = findChildView(node, nextLabelType); >+ assertNotNull(notationLabel); >+ GraphicalEditPart labelEditPart = (GraphicalEditPart) findEditPart(notationLabel); >+ assertNotNull(labelEditPart); >+ checkFont(labelEditPart, (Figure)eLabel.getFigure()); >+ } >+ } >+ >+ public void checkFont(GraphicalEditPart editPart, Figure eFigure) { >+ IFigure d2dFgure = editPart.getFigure(); >+ assertNotNull(d2dFgure); >+ >+ Font font = eFigure.getFont(); >+ if (font == null){ >+ font = getViewerConfiguration().getDefaultFont(); >+ } >+ >+ checkFont(font, d2dFgure.getFont()); >+ } >+ } >+ >+ FontChecker fontChecker = new FontChecker(); >+ >+ DiaGenSource gmfGen = getSetup().getGenModel(); >+ CompartmentsSessionSetup.DiaDefSourceExtension gmfGraph = (CompartmentsSessionSetup.DiaDefSourceExtension)getSetup().getGraphDefModel(); >+ >+ fontChecker.createAndCheckLabels(gmfGen.getNodeA(), gmfGraph.getLabelDef(), getDiagram()); >+ fontChecker.createAndCheckLabels(gmfGen.getNodeB(), gmfGraph.getDecoratedDiagramLabel(), getDiagram()); >+ } >+ > private ConnectionEditPart createAndCheckLink(View source, View target, GenLink genLinkType){ > Edge newLink = createLink(genLinkType, source, target); > assertNotNull(newLink); >Index: src/org/eclipse/gmf/tests/setup/GeneratorConfiguration.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/setup/GeneratorConfiguration.java,v >retrieving revision 1.4 >diff -u -r1.4 GeneratorConfiguration.java >--- src/org/eclipse/gmf/tests/setup/GeneratorConfiguration.java 19 Jun 2006 17:28:35 -0000 1.4 >+++ src/org/eclipse/gmf/tests/setup/GeneratorConfiguration.java 21 Jun 2006 12:25:03 -0000 >@@ -17,6 +17,7 @@ > import org.eclipse.gef.commands.Command; > import org.eclipse.gmf.codegen.gmfgen.GenCommonBase; > import org.eclipse.gmf.codegen.gmfgen.GenDiagram; >+import org.eclipse.gmf.gmfgraph.Font; > import org.eclipse.gmf.internal.common.codegen.GeneratorBase; > import org.eclipse.gmf.runtime.notation.Diagram; > import org.eclipse.gmf.runtime.notation.View; >@@ -41,6 +42,7 @@ > public void dispose(); > > public RGB getDefaultLinkColor(); >+ public Font getDefaultFont(); > } > > public ViewerConfiguration createViewerConfiguration(Composite parent, SessionSetup setup, Diagram canvas) throws Exception; >Index: src/org/eclipse/gmf/tests/setup/RuntimeBasedGeneratorConfiguration.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/setup/RuntimeBasedGeneratorConfiguration.java,v >retrieving revision 1.9 >diff -u -r1.9 RuntimeBasedGeneratorConfiguration.java >--- src/org/eclipse/gmf/tests/setup/RuntimeBasedGeneratorConfiguration.java 19 Jun 2006 17:28:35 -0000 1.9 >+++ src/org/eclipse/gmf/tests/setup/RuntimeBasedGeneratorConfiguration.java 21 Jun 2006 12:25:03 -0000 >@@ -40,6 +40,10 @@ > import org.eclipse.gmf.codegen.gmfgen.GenCommonBase; > import org.eclipse.gmf.codegen.gmfgen.GenDiagram; > import org.eclipse.gmf.codegen.util.Generator; >+import org.eclipse.gmf.gmfgraph.BasicFont; >+import org.eclipse.gmf.gmfgraph.Font; >+import org.eclipse.gmf.gmfgraph.FontStyle; >+import org.eclipse.gmf.gmfgraph.GMFGraphFactory; > import org.eclipse.gmf.internal.common.codegen.GeneratorBase; > import org.eclipse.gmf.runtime.common.core.command.CommandResult; > import org.eclipse.gmf.runtime.diagram.core.edithelpers.CreateElementRequestAdapter; >@@ -70,6 +74,7 @@ > import org.eclipse.gmf.tests.EPath; > import org.eclipse.jface.preference.IPreferenceStore; > import org.eclipse.jface.preference.PreferenceConverter; >+import org.eclipse.swt.graphics.FontData; > import org.eclipse.swt.graphics.RGB; > import org.eclipse.swt.widgets.Composite; > import org.eclipse.swt.widgets.Display; >@@ -220,6 +225,15 @@ > return PreferenceConverter.getColor(getDefaultPreferences(), IPreferenceConstants.PREF_LINE_COLOR); > } > >+ public Font getDefaultFont() { >+ BasicFont result = GMFGraphFactory.eINSTANCE.createBasicFont(); >+ FontData defaultFontData = PreferenceConverter.getDefaultFontData(getDefaultPreferences(), IPreferenceConstants.PREF_DEFAULT_FONT); >+ result.setFaceName(defaultFontData.getName()); >+ result.setHeight(defaultFontData.getHeight()); >+ result.setStyle(FontStyle.get(defaultFontData.getStyle())); >+ return result; >+ } >+ > private IPreferenceStore getDefaultPreferences() { > return (IPreferenceStore) PreferencesHint.USE_DEFAULTS.getPreferenceStore(); > } >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.3 >diff -u -r1.3 CompartmentsSessionSetup.java >--- src/org/eclipse/gmf/tests/setup/CompartmentsSessionSetup.java 19 Jun 2006 12:42:00 -0000 1.3 >+++ src/org/eclipse/gmf/tests/setup/CompartmentsSessionSetup.java 21 Jun 2006 12:25:03 -0000 >@@ -23,6 +23,7 @@ > import org.eclipse.emf.ecore.EcoreFactory; > import org.eclipse.emf.ecore.EcorePackage; > import org.eclipse.emf.ecore.util.EcoreUtil; >+import org.eclipse.gmf.gmfgraph.BasicFont; > import org.eclipse.gmf.gmfgraph.Canvas; > import org.eclipse.gmf.gmfgraph.Color; > import org.eclipse.gmf.gmfgraph.ColorConstants; >@@ -33,12 +34,15 @@ > import org.eclipse.gmf.gmfgraph.DiagramLabel; > import org.eclipse.gmf.gmfgraph.Figure; > import org.eclipse.gmf.gmfgraph.FigureGallery; >+import org.eclipse.gmf.gmfgraph.FontStyle; > import org.eclipse.gmf.gmfgraph.GMFGraphFactory; >+import org.eclipse.gmf.gmfgraph.Label; > 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; >+import org.eclipse.gmf.mappings.LabelMapping; > import org.eclipse.gmf.mappings.NodeMapping; > import org.eclipse.gmf.tests.setup.DomainModelSource.NodeData; > >@@ -111,6 +115,11 @@ > * @return connection, foreground = orange > */ > public Connection getColoredConnection(); >+ >+ /** >+ * @return diagram label, font = "Arial", size = 18, bold >+ */ >+ public DiagramLabel getDecoratedDiagramLabel(); > } > > public static interface DomainModelSourceExtension extends DomainModelSource { >@@ -123,6 +132,7 @@ > private Compartment myCompartmentNoTitleNoCollapse; > private Node myColoredNode; > private Connection myColoredConnection; >+ private DiagramLabel myDiagramLabelWithFont; > > public void setupCanvasDef(Canvas canvasDef) { > FigureGallery oneMoreGallery = GMFGraphFactory.eINSTANCE.createFigureGallery(); >@@ -154,6 +164,21 @@ > myColoredConnection.setName("ColoredLinkConnection"); > myColoredConnection.setFigure(connectionLink); > getCanvasDef().getConnections().add(myColoredConnection); >+ >+ Label label = GMFGraphFactory.eINSTANCE.createLabel(); >+ label.setName("LabelWithFont"); >+ label.setText("LabelText"); >+ BasicFont font = GMFGraphFactory.eINSTANCE.createBasicFont(); >+ font.setFaceName("Arial"); >+ font.setHeight(18); >+ font.setStyle(FontStyle.BOLD_LITERAL); >+ label.setFont(font); >+ oneMoreGallery.getFigures().add(label); >+ >+ myDiagramLabelWithFont = GMFGraphFactory.eINSTANCE.createDiagramLabel(); >+ myDiagramLabelWithFont.setName("DiagramLabelWithFont"); >+ myDiagramLabelWithFont.setFigure(label); >+ getCanvasDef().getLabels().add(myDiagramLabelWithFont); > } > > protected void setupNodeDef(Node nodeDef) { >@@ -177,6 +202,10 @@ > return myColoredNode; > } > >+ public DiagramLabel getDecoratedDiagramLabel() { >+ return myDiagramLabelWithFont; >+ } >+ > private Compartment createCompartment(Figure figure, String name, boolean collapsible, boolean needsTitle){ > Compartment result = GMFGraphFactory.eINSTANCE.createCompartment(); > result.setFigure(figure); >@@ -251,6 +280,12 @@ > > setupReferenceAndCompartment(ddSource, diaDefSetupWithCompartments.getCompartmentA(), domainWithChildren.getChildOfA(), result.getNodeA()); > setupReferenceAndCompartment(ddSource, diaDefSetupWithCompartments.getCompartmentB(), domainWithChildren.getChildOfB(), result.getNodeB()); >+ >+ Assert.assertFalse(getNodeB().getLabelMappings().isEmpty()); >+ for (Iterator labelsB = getNodeB().getLabelMappings().iterator(); labelsB.hasNext();){ >+ LabelMapping next = (LabelMapping)labelsB.next(); >+ next.setDiagramLabel(diaDefSetupWithCompartments.getDecoratedDiagramLabel()); >+ } > > return result; > } >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.14 >diff -u -r1.14 ViewmapProducersTest.java >--- src/org/eclipse/gmf/tests/gen/ViewmapProducersTest.java 19 Jun 2006 12:42:00 -0000 1.14 >+++ src/org/eclipse/gmf/tests/gen/ViewmapProducersTest.java 21 Jun 2006 12:25:03 -0000 >@@ -18,6 +18,7 @@ > import junit.framework.Assert; > import junit.framework.TestCase; > >+import org.eclipse.emf.ecore.util.EcoreUtil; > import org.eclipse.gmf.bridge.genmodel.InnerClassViewmapProducer; > import org.eclipse.gmf.bridge.genmodel.ViewmapProducer; > import org.eclipse.gmf.codegen.gmfgen.FigureViewmap; >@@ -439,9 +440,27 @@ > 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); >+ >+ Label externalWithFont = GMFGraphFactory.eINSTANCE.createLabel(); >+ externalWithFont.setText("LabelText"); >+ externalWithFont.setName("ExternalWithFont"); >+ externalWithFont.setFont(font); >+ DiagramLabel diagramExternalLabel = GMFGraphFactory.eINSTANCE.createDiagramLabel(); >+ diagramExternalLabel.setName("DiagramExternalLabelWithFont"); >+ diagramExternalLabel.setFigure(externalWithFont); >+ checker.check(getProducer().create(diagramExternalLabel), true, false, false); >+ >+ Figure labelParent = GMFGraphFactory.eINSTANCE.createRectangle(); >+ labelParent.setName("LabelParent"); >+ Label innerWithFont = (Label) EcoreUtil.copy(externalWithFont); >+ labelParent.getChildren().add(innerWithFont); >+ DiagramLabel diagramInnerLabel = GMFGraphFactory.eINSTANCE.createDiagramLabel(); >+ diagramInnerLabel.setName("DiagramInnerLabelWithFont"); >+ diagramInnerLabel.setFigure(innerWithFont); >+ checker.check(getProducer().create(diagramInnerLabel), true, false, false); >+ > } > >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 147853
: 44989 |
44996