Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcletavernie2012-04-02 05:32:25 -0400
committercletavernie2012-04-02 05:32:25 -0400
commit306629adcd6d43ad6688a3c5ead5ebbedc50b81c (patch)
tree612a8430f7463d05e17a9038226c7e78eee35c2f /plugins/infra
parent02c009ce1d6bd758cea51c9c89c724ce97b52dcf (diff)
downloadorg.eclipse.papyrus-306629adcd6d43ad6688a3c5ead5ebbedc50b81c.tar.gz
org.eclipse.papyrus-306629adcd6d43ad6688a3c5ead5ebbedc50b81c.tar.xz
org.eclipse.papyrus-306629adcd6d43ad6688a3c5ead5ebbedc50b81c.zip
370797: [Theme] Papyrus should provide a support for CSS files on its diagrams
https://bugs.eclipse.org/bugs/show_bug.cgi?id=370797
Diffstat (limited to 'plugins/infra')
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/.classpath8
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/.project28
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/META-INF/MANIFEST.MF41
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/about.html28
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/build.properties11
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/icons/papyrus.pngbin0 -> 602 bytes
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/icons/sourceEditor.gifbin0 -> 353 bytes
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/plugin.properties5
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/plugin.xml81
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/resources/base.css23
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/resources/papyrus_theme.css109
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/schema/theme.exsd152
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSArrowStyleImpl.java133
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSBasicCompartmentImpl.java117
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSBasicSemanticCompartmentImpl.java117
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSCanonicalStyleImpl.java108
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSCompartmentImpl.java133
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSConnectorImpl.java337
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSConnectorStyleImpl.java328
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSDataTypeStyleImpl.java108
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSDescriptionStyleImpl.java108
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSDiagramLinkStyleImpl.java86
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSDiagramStyleImpl.java204
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSDrawerStyleImpl.java108
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSFillStyleImpl.java156
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSFilteringStyleImpl.java133
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSFontStyleImpl.java252
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSGuideStyleImpl.java86
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSHintedDiagramLinkStyleImpl.java108
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSImageBufferStyleImpl.java132
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSImageStyleImpl.java132
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSLineStyleImpl.java132
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSLineTypeStyleImpl.java109
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSListCompartmentImpl.java159
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSMultiDiagramLinkStyleImpl.java86
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSNamedStyleImpl.java108
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSPageStyleImpl.java180
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSPropertiesSetStyleImpl.java108
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSRoundedCornersStyleImpl.java108
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSRoutingStyleImpl.java280
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSSemanticListCompartmentImpl.java159
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSShapeImpl.java454
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSShapeStyleImpl.java420
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSSortingStyleImpl.java133
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSStandardDiagramImpl.java230
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSTextStyleImpl.java109
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSTitleStyleImpl.java108
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/factory/CSSNotationFactory.java272
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSArrowStyle.java23
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSCanonicalStyle.java19
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSConnectorStyle.java18
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSDataTypeStyle.java18
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSDescriptionStyle.java19
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSDiagramLinkStyle.java18
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSDiagramStyle.java18
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSDrawerStyle.java19
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSFillStyle.java25
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSFilteringStyle.java23
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSFontStyle.java37
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSGuideStyle.java18
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSHintedDiagramLinkStyle.java19
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSImageBufferStyle.java18
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSImageStyle.java22
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSLineStyle.java22
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSLineTypeStyle.java20
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSMultiDiagramLinkStyle.java18
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSNamedStyle.java19
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSPageStyle.java28
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSPropertiesSetStyle.java18
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSRoundedCornersStyle.java19
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSRoutingStyle.java41
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSShapeStyle.java18
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSSortingStyle.java23
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSTextStyle.java20
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSTitleStyle.java19
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSArrowStyleDelegate.java53
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSCanonicalStyleDelegate.java43
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSConnectorStyleDelegate.java128
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSDataTypeStyleDelegate.java43
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSDescriptionStyleDelegate.java43
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSDiagramLinkStyleDelegate.java33
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSDiagramStyleDelegate.java79
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSDrawerStyleDelegate.java43
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSFillStyleDelegate.java57
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSFilteringStyleDelegate.java53
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSFontStyleDelegate.java97
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSGuideStyleDelegate.java33
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSHintedDiagramLinkStyleDelegate.java43
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSImageBufferStyleDelegate.java52
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSImageStyleDelegate.java52
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSLineStyleDelegate.java52
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSLineTypeStyleDelegate.java44
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSMultiDiagramLinkStyleDelegate.java33
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSNamedStyleDelegate.java43
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSPageStyleDelegate.java70
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSPropertiesSetStyleDelegate.java43
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSRoundedCornersStyleDelegate.java43
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSRoutingStyleDelegate.java110
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSShapeStyleDelegate.java156
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSSortingStyleDelegate.java53
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSTextStyleDelegate.java44
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSTitleStyleDelegate.java43
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/Activator.java75
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/converters/BooleanConverter.java38
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/converters/ColorToGMFConverter.java86
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/converters/IntegerConverter.java41
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/converters/StringConverter.java37
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/dom/GMFElementAdapter.java420
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/dom/StyleListener.java52
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/BaseCSSEngine.java62
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/DiagramCSSEngine.java117
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/ExtendedCSSEngine.java77
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/ExtendedCSSEngineImpl.java343
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/GMFElementProvider.java41
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/GMFErrorHandler.java24
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/LazyCSSEngine.java29
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/ModelCSSEngine.java85
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/WorkspaceCSSEngine.java66
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/enginecopy/CSSComputedStyleImpl.java58
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/enginecopy/ExtendedViewCSSImpl.java146
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/enginecopy/StyleWrapper.java56
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/handler/CSSRefreshHandler.java27
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/handler/ResetStyleHandler.java185
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/CSSHelper.java24
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/GradientHelper.java136
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/ParserHelper.java48
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/SemanticElementHelper.java98
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/StringHelper.java32
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/listener/StyleSheetChangeListener.java20
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/lists/ExtendedCSSRuleList.java47
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/lists/ExtendedSelectorList.java47
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/lists/ExtendedStyleSheetList.java51
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/CSSAnnotations.java50
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/CSSDiagram.java26
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/CSSDiagramImpl.java107
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/ForceValueHelper.java132
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/preferences/ThemePreferenceInitializer.java25
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/preferences/ThemePreferences.java21
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/preferences/ThemePreferencesPage.java128
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/provider/CSSAppearanceProvider.java47
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/provider/CSSClassContentProvider.java121
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/provider/CSSCustomStyleDelegate.java83
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/provider/CustomStyle.java22
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/resource/CSSNotationModel.java26
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/resource/CSSNotationResource.java72
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/resource/CSSNotationResourceFactory.java37
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/theme/Theme.java63
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/theme/ThemeManager.java189
149 files changed, 12416 insertions, 0 deletions
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/.classpath b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/.classpath
new file mode 100644
index 00000000000..9c0318f0fd2
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src-gen"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/.project b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/.project
new file mode 100644
index 00000000000..f07c14c7414
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.infra.gmfdiag.css</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/.settings/org.eclipse.jdt.core.prefs b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..44217f8c068
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/META-INF/MANIFEST.MF b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..e5fc7005fbd
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/META-INF/MANIFEST.MF
@@ -0,0 +1,41 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.eclipse.papyrus.infra.gmfdiag.css;singleton:=true
+Bundle-Version: 0.9.0.qualifier
+Bundle-Activator: org.eclipse.papyrus.infra.gmfdiag.css.Activator
+Bundle-Vendor: %Bundle-Vendor
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.e4.ui.css.core;bundle-version="0.10.0",
+ org.eclipse.emf.ecore;bundle-version="2.8.0",
+ org.eclipse.papyrus.infra.emf;bundle-version="0.9.0",
+ org.eclipse.papyrus.infra.core.log;bundle-version="0.9.0",
+ org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.5.0",
+ org.w3c.css.sac;bundle-version="1.3.1",
+ org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="0.9.0",
+ org.eclipse.gmf.runtime.notation.edit;bundle-version="1.4.0",
+ org.eclipse.papyrus.infra.core;bundle-version="0.9.0",
+ org.eclipse.papyrus.infra.emf.appearance;bundle-version="0.9.0",
+ org.eclipse.papyrus.infra.tools;bundle-version="0.9.0",
+ org.eclipse.core.databinding;bundle-version="1.4.1",
+ org.eclipse.papyrus.infra.widgets;bundle-version="0.9.0",
+ org.eclipse.papyrus.infra.gmfdiag.css.model;bundle-version="0.9.0"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Export-Package: org.eclipse.papyrus.infra.gmfdiag.css,
+ org.eclipse.papyrus.infra.gmfdiag.css.converters,
+ org.eclipse.papyrus.infra.gmfdiag.css.dom,
+ org.eclipse.papyrus.infra.gmfdiag.css.engine,
+ org.eclipse.papyrus.infra.gmfdiag.css.engine.enginecopy,
+ org.eclipse.papyrus.infra.gmfdiag.css.handler,
+ org.eclipse.papyrus.infra.gmfdiag.css.helper,
+ org.eclipse.papyrus.infra.gmfdiag.css.listener,
+ org.eclipse.papyrus.infra.gmfdiag.css.lists,
+ org.eclipse.papyrus.infra.gmfdiag.css.notation,
+ org.eclipse.papyrus.infra.gmfdiag.css.preferences,
+ org.eclipse.papyrus.infra.gmfdiag.css.provider,
+ org.eclipse.papyrus.infra.gmfdiag.css.resource,
+ org.eclipse.papyrus.infra.gmfdiag.css.style.impl,
+ org.eclipse.papyrus.infra.gmfdiag.css.theme
+Bundle-Localization: plugin
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/about.html b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/about.html
new file mode 100644
index 00000000000..209103075a7
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>November 14, 2008</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/build.properties b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/build.properties
new file mode 100644
index 00000000000..739424b7358
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/build.properties
@@ -0,0 +1,11 @@
+source.. = src/,src-gen/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ about.html,\
+ plugin.xml,\
+ plugin.properties,\
+ resources/,\
+ schema/,\
+ icons/
+src.includes = about.html
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/icons/papyrus.png b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/icons/papyrus.png
new file mode 100644
index 00000000000..0f74e27b483
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/icons/papyrus.png
Binary files differ
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/icons/sourceEditor.gif b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/icons/sourceEditor.gif
new file mode 100644
index 00000000000..75ebdb85865
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/icons/sourceEditor.gif
Binary files differ
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/plugin.properties b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/plugin.properties
new file mode 100644
index 00000000000..f944432c9bc
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/plugin.properties
@@ -0,0 +1,5 @@
+#Properties file for org.eclipse.papyrus.infra.gmfdiag.css
+Bundle-Vendor = Eclipse Modeling Project
+Bundle-Name = Diagram CSS
+pluginName = ModelStyleSheets Model
+providerName = www.example.org
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/plugin.xml b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/plugin.xml
new file mode 100644
index 00000000000..4f8a60c1668
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/plugin.xml
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension-point id="theme" name="CSS Theme" schema="schema/theme.exsd"/>
+ <extension point="org.eclipse.emf.ecore.factory_override">
+ <factory
+ class="org.eclipse.papyrus.infra.gmfdiag.css.factory.CSSNotationFactory"
+ uri="http://www.eclipse.org/gmf/runtime/1.0.2/notation">
+ </factory>
+ </extension>
+ <extension point="org.eclipse.papyrus.infra.core.model">
+ <model
+ classname="org.eclipse.papyrus.infra.gmfdiag.css.resource.CSSNotationModel"
+ description="Notation Model with CSS Support">
+ </model>
+ </extension>
+ <extension point="org.eclipse.ui.handlers">
+ <handler
+ class="org.eclipse.papyrus.infra.gmfdiag.css.handler.CSSRefreshHandler"
+ commandId="org.eclipse.ui.file.refresh">
+ <activeWhen>
+ <and>
+ <with variable="activePartId">
+ <equals value="org.eclipse.papyrus.infra.core.papyrusEditor">
+ </equals>
+ </with>
+ <with variable="activeContexts">
+ <iterate ifEmpty="false" operator="or">
+ <equals value="Papyrus CSS">
+ </equals>
+ </iterate>
+ </with>
+ </and>
+ </activeWhen>
+ </handler>
+ </extension>
+ <extension
+ point="org.eclipse.ui.contexts">
+ <context
+ description="A context used to indicate that the Papyrus CSS support is available"
+ id="Papyrus CSS"
+ name="Papyrus CSS context">
+ </context>
+ </extension>
+ <extension
+ point="org.eclipse.papyrus.infra.emf.appearance.styleProvider">
+ <styleprovider
+ priority="40"
+ styleProvider="org.eclipse.papyrus.infra.gmfdiag.css.provider.CSSAppearanceProvider">
+ </styleprovider>
+ </extension>
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ category="org.eclipse.papyrus.infra.core.sasheditor.preferences.generalcategory"
+ class="org.eclipse.papyrus.infra.gmfdiag.css.preferences.ThemePreferencesPage"
+ id="org.eclipse.papyrus.infra.gmfdiag.css.theme"
+ name="CSS Theme">
+ </page>
+ </extension>
+ <extension
+ point="org.eclipse.core.runtime.preferences">
+ <initializer
+ class="org.eclipse.papyrus.infra.gmfdiag.css.preferences.ThemePreferenceInitializer">
+ </initializer>
+ </extension>
+ <extension
+ point="org.eclipse.papyrus.infra.gmfdiag.css.theme">
+ <themeDefinition
+ icon="icons/papyrus.png"
+ id="org.eclipse.papyrus.css.papyrus_theme"
+ label="Papyrus Theme">
+ </themeDefinition>
+ <themeContribution
+ id="org.eclipse.papyrus.css.papyrus_theme">
+ <stylesheet
+ stylesheetPath="resources/papyrus_theme.css">
+ </stylesheet>
+ </themeContribution>
+ </extension>
+</plugin>
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/resources/base.css b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/resources/base.css
new file mode 100644
index 00000000000..cd54b882a62
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/resources/base.css
@@ -0,0 +1,23 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr
+ *****************************************************************************/
+
+/**
+
+This stylesheets declares the default style options for Papyrus. It mostly contains hacks to avoid
+unwished behaviors, related to the base implementation (GMF, Papyrus...)
+
+*/
+
+* {
+ lineColor:black; /* Avoid the gray line-colors from default GMF connectors */
+ fontName:"Segoe UI";
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/resources/papyrus_theme.css b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/resources/papyrus_theme.css
new file mode 100644
index 00000000000..16136647718
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/resources/papyrus_theme.css
@@ -0,0 +1,109 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr
+ *****************************************************************************/
+
+/*
+ * Papyrus CSS v0.9
+ * Sample
+ */
+
+* {
+
+ /**
+ * GMF Display
+ */
+
+ fontColor: black;
+ fillColor:#C3D1DC;
+
+ /* fontHeight:9; */
+
+ /**
+ * Gradient
+ */
+
+ /* gradientColor:white; */
+ /* gradientStyle:vertical; */
+
+ /*
+ * Global gradient (Equivalent to the latter)
+ */
+
+ gradient: white vertical; /* vertical white; is currently invalid */
+
+ /*
+ * Global gradient (2)
+ * Unsupported by diagrams (Color2 is unused)
+ */
+
+ /* gradient:white blue vertical */
+
+ /**
+ * UML Display
+ */
+
+ elementIcon: true;
+ /* shadow:false; */
+ /* qualifiedNameDepth:Full; */
+
+ /**
+ * UML Stereotypes display
+ */
+
+ /* stereotypeDisplay:"Text and Icon"; */
+ /* textAlignment:Vertical; */
+ /* displayPlace:"With brace"; */
+}
+
+Class {
+ fillColor: #C3D7DD;
+ lineColor: black;
+}
+
+Interface{
+ fillColor:#FAFAFC;
+}
+
+Class[isAbstract=true], Class[isAbstract=true] *{
+ fillColor:#E4E4E7;
+ fontColor:gray;
+}
+
+Port {
+ fillColor: #C8D9F5;
+ lineColor: black;
+}
+
+Comment {
+ fillColor: #FFFFDD;
+ gradient: #FFFFFC vertical;
+}
+
+Constraint {
+ fillColor: #C8FFE6;
+}
+
+Package {
+ fillColor: white;
+}
+
+/** This is the Diagram's root element. It doesn't support
+gradient and should have the same color as the diagram */
+SequenceDiagram > Interaction {
+ fillColor:white;
+}
+
+SequenceDiagram CombinedFragment,
+SequenceDiagram ConsiderIgnoreFragment,
+SequenceDiagram CombinedFragment *,
+SequenceDiagram ConsiderIgnoreFragment *{
+ fillColor:white;
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/schema/theme.exsd b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/schema/theme.exsd
new file mode 100644
index 00000000000..107b8280d21
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/schema/theme.exsd
@@ -0,0 +1,152 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.papyrus.infra.gmfdiag.css" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.papyrus.infra.gmfdiag.css" id="theme" name="CSS Theme"/>
+ </appinfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <choice>
+ <sequence>
+ <element ref="themeContribution" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <element ref="themeDefinition" minOccurs="0" maxOccurs="unbounded"/>
+ </choice>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="themeContribution">
+ <complexType>
+ <sequence minOccurs="1" maxOccurs="unbounded">
+ <element ref="stylesheet"/>
+ </sequence>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="identifier" basedOn="org.eclipse.papyrus.infra.gmfdiag.css.theme/themeDefinition/@id"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="stylesheet">
+ <complexType>
+ <attribute name="stylesheetPath" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="resource"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="themeDefinition">
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="icon" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="resource"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="label" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSArrowStyleImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSArrowStyleImpl.java
new file mode 100644
index 00000000000..a3bba0f1a5e
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSArrowStyleImpl.java
@@ -0,0 +1,133 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.notation.ArrowType;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.runtime.notation.impl.ArrowStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.ForceValueHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSArrowStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.impl.CSSArrowStyleDelegate;
+
+public class CSSArrowStyleImpl extends ArrowStyleImpl implements CSSArrowStyle {
+
+ protected ExtendedCSSEngine engine;
+
+ private CSSArrowStyle arrowStyle;
+
+ protected CSSArrowStyle getArrowStyle() {
+ if(arrowStyle == null) {
+ arrowStyle = new CSSArrowStyleDelegate(this, getEngine());
+ }
+ return arrowStyle;
+ }
+
+ protected ExtendedCSSEngine getEngine(){
+ if (engine == null){
+ engine = ((CSSDiagramImpl)findView().getDiagram()).getEngine();
+ }
+ return engine;
+ }
+
+ protected View findView(){
+ EObject parent = eContainer();
+ while (! (parent instanceof View) && parent != null){
+ parent = parent.eContainer();
+ }
+
+ if (parent != null){
+ return (View)parent;
+ }
+
+ return null;
+ }
+
+
+ //////////////////////////////////////////
+ // Forwards accesses to CSS properties //
+ //////////////////////////////////////////
+
+
+ public ArrowType getCSSArrowSource(){
+ ArrowType value = super.getArrowSource();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getArrowStyle_ArrowSource(), value)){
+ return value;
+ } else {
+ return getArrowStyle().getCSSArrowSource();
+ }
+ }
+
+ public ArrowType getCSSArrowTarget(){
+ ArrowType value = super.getArrowTarget();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getArrowStyle_ArrowTarget(), value)){
+ return value;
+ } else {
+ return getArrowStyle().getCSSArrowTarget();
+ }
+ }
+
+
+ @Override
+ public ArrowType getArrowSource(){
+ //return super.getArrowSource();
+ return getCSSArrowSource();
+ }
+
+ @Override
+ public ArrowType getArrowTarget(){
+ //return super.getArrowTarget();
+ return getCSSArrowTarget();
+ }
+
+
+
+ ////////////////////////////////////////////////
+ // Implements a setter for each CSS property //
+ ////////////////////////////////////////////////
+
+ @Override
+ public void setArrowSource(ArrowType value){
+ super.setArrowSource(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getArrowStyle_ArrowSource();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setArrowTarget(ArrowType value){
+ super.setArrowTarget(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getArrowStyle_ArrowTarget();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ //////////////////////////////////
+ // Implements the unset method //
+ //////////////////////////////////
+
+ @Override
+ public void eUnset(int featureId) {
+ super.eUnset(featureId);
+
+ EStructuralFeature feature = eDynamicFeature(featureId);
+ ForceValueHelper.unsetValue(findView(), feature);
+ }
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSBasicCompartmentImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSBasicCompartmentImpl.java
new file mode 100644
index 00000000000..7a028fd1b19
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSBasicCompartmentImpl.java
@@ -0,0 +1,117 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.impl.BasicCompartmentImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.ForceValueHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSDrawerStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.impl.CSSDrawerStyleDelegate;
+
+public class CSSBasicCompartmentImpl extends BasicCompartmentImpl implements CSSDrawerStyle {
+
+ protected ExtendedCSSEngine engine;
+
+ private CSSDrawerStyle drawerStyle;
+
+ protected CSSDrawerStyle getDrawerStyle() {
+ if(drawerStyle == null) {
+ drawerStyle = new CSSDrawerStyleDelegate(this, getEngine());
+ }
+ return drawerStyle;
+ }
+
+ protected ExtendedCSSEngine getEngine() {
+ if(engine == null) {
+ engine = ((CSSDiagramImpl)getDiagram()).getEngine();
+ }
+ return engine;
+ }
+
+
+ //////////////////////////////////////////
+ // Forwards accesses to CSS properties //
+ //////////////////////////////////////////
+
+
+ public boolean isCSSCollapsed(){
+ boolean value = super.isCollapsed();
+
+ if (ForceValueHelper.isSet(this, NotationPackage.eINSTANCE.getDrawerStyle_Collapsed(), value)){
+ return value;
+ } else {
+ return getDrawerStyle().isCSSCollapsed();
+ }
+ }
+
+
+ @Override
+ public boolean isCollapsed(){
+ //return super.isCollapsed();
+ return isCSSCollapsed();
+ }
+
+
+
+ ////////////////////////////////////////////////
+ // Implements a setter for each CSS property //
+ ////////////////////////////////////////////////
+
+ @Override
+ public void setVisible(boolean value){
+ super.setVisible(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getView_Visible();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setType(java.lang.String value){
+ super.setType(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getView_Type();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setMutable(boolean value){
+ super.setMutable(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getView_Mutable();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setCollapsed(boolean value){
+ super.setCollapsed(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getDrawerStyle_Collapsed();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ //////////////////////////////////
+ // Implements the unset method //
+ //////////////////////////////////
+
+ @Override
+ public void eUnset(int featureId) {
+ super.eUnset(featureId);
+
+ EStructuralFeature feature = eDynamicFeature(featureId);
+ ForceValueHelper.unsetValue(this, feature);
+ }
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSBasicSemanticCompartmentImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSBasicSemanticCompartmentImpl.java
new file mode 100644
index 00000000000..4f67e2ae126
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSBasicSemanticCompartmentImpl.java
@@ -0,0 +1,117 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.impl.BasicSemanticCompartmentImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.ForceValueHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSDrawerStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.impl.CSSDrawerStyleDelegate;
+
+public class CSSBasicSemanticCompartmentImpl extends BasicSemanticCompartmentImpl implements CSSDrawerStyle {
+
+ protected ExtendedCSSEngine engine;
+
+ private CSSDrawerStyle drawerStyle;
+
+ protected CSSDrawerStyle getDrawerStyle() {
+ if(drawerStyle == null) {
+ drawerStyle = new CSSDrawerStyleDelegate(this, getEngine());
+ }
+ return drawerStyle;
+ }
+
+ protected ExtendedCSSEngine getEngine() {
+ if(engine == null) {
+ engine = ((CSSDiagramImpl)getDiagram()).getEngine();
+ }
+ return engine;
+ }
+
+
+ //////////////////////////////////////////
+ // Forwards accesses to CSS properties //
+ //////////////////////////////////////////
+
+
+ public boolean isCSSCollapsed(){
+ boolean value = super.isCollapsed();
+
+ if (ForceValueHelper.isSet(this, NotationPackage.eINSTANCE.getDrawerStyle_Collapsed(), value)){
+ return value;
+ } else {
+ return getDrawerStyle().isCSSCollapsed();
+ }
+ }
+
+
+ @Override
+ public boolean isCollapsed(){
+ //return super.isCollapsed();
+ return isCSSCollapsed();
+ }
+
+
+
+ ////////////////////////////////////////////////
+ // Implements a setter for each CSS property //
+ ////////////////////////////////////////////////
+
+ @Override
+ public void setVisible(boolean value){
+ super.setVisible(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getView_Visible();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setType(java.lang.String value){
+ super.setType(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getView_Type();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setMutable(boolean value){
+ super.setMutable(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getView_Mutable();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setCollapsed(boolean value){
+ super.setCollapsed(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getDrawerStyle_Collapsed();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ //////////////////////////////////
+ // Implements the unset method //
+ //////////////////////////////////
+
+ @Override
+ public void eUnset(int featureId) {
+ super.eUnset(featureId);
+
+ EStructuralFeature feature = eDynamicFeature(featureId);
+ ForceValueHelper.unsetValue(this, feature);
+ }
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSCanonicalStyleImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSCanonicalStyleImpl.java
new file mode 100644
index 00000000000..4d48ffded98
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSCanonicalStyleImpl.java
@@ -0,0 +1,108 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.runtime.notation.impl.CanonicalStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.ForceValueHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSCanonicalStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.impl.CSSCanonicalStyleDelegate;
+
+public class CSSCanonicalStyleImpl extends CanonicalStyleImpl implements CSSCanonicalStyle {
+
+ protected ExtendedCSSEngine engine;
+
+ private CSSCanonicalStyle canonicalStyle;
+
+ protected CSSCanonicalStyle getCanonicalStyle() {
+ if(canonicalStyle == null) {
+ canonicalStyle = new CSSCanonicalStyleDelegate(this, getEngine());
+ }
+ return canonicalStyle;
+ }
+
+ protected ExtendedCSSEngine getEngine(){
+ if (engine == null){
+ engine = ((CSSDiagramImpl)findView().getDiagram()).getEngine();
+ }
+ return engine;
+ }
+
+ protected View findView(){
+ EObject parent = eContainer();
+ while (! (parent instanceof View) && parent != null){
+ parent = parent.eContainer();
+ }
+
+ if (parent != null){
+ return (View)parent;
+ }
+
+ return null;
+ }
+
+
+ //////////////////////////////////////////
+ // Forwards accesses to CSS properties //
+ //////////////////////////////////////////
+
+
+ public boolean isCSSCanonical(){
+ boolean value = super.isCanonical();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getCanonicalStyle_Canonical(), value)){
+ return value;
+ } else {
+ return getCanonicalStyle().isCSSCanonical();
+ }
+ }
+
+
+ @Override
+ public boolean isCanonical(){
+ //return super.isCanonical();
+ return isCSSCanonical();
+ }
+
+
+
+ ////////////////////////////////////////////////
+ // Implements a setter for each CSS property //
+ ////////////////////////////////////////////////
+
+ @Override
+ public void setCanonical(boolean value){
+ super.setCanonical(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getCanonicalStyle_Canonical();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ //////////////////////////////////
+ // Implements the unset method //
+ //////////////////////////////////
+
+ @Override
+ public void eUnset(int featureId) {
+ super.eUnset(featureId);
+
+ EStructuralFeature feature = eDynamicFeature(featureId);
+ ForceValueHelper.unsetValue(findView(), feature);
+ }
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSCompartmentImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSCompartmentImpl.java
new file mode 100644
index 00000000000..c37f4b4d777
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSCompartmentImpl.java
@@ -0,0 +1,133 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.impl.CompartmentImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.ForceValueHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSDrawerStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.impl.CSSDrawerStyleDelegate;
+
+public class CSSCompartmentImpl extends CompartmentImpl implements CSSDrawerStyle {
+
+ protected ExtendedCSSEngine engine;
+
+ private CSSDrawerStyle drawerStyle;
+
+ protected CSSDrawerStyle getDrawerStyle() {
+ if(drawerStyle == null) {
+ drawerStyle = new CSSDrawerStyleDelegate(this, getEngine());
+ }
+ return drawerStyle;
+ }
+
+ protected ExtendedCSSEngine getEngine() {
+ if(engine == null) {
+ engine = ((CSSDiagramImpl)getDiagram()).getEngine();
+ }
+ return engine;
+ }
+
+
+ //////////////////////////////////////////
+ // Forwards accesses to CSS properties //
+ //////////////////////////////////////////
+
+
+ public boolean isCSSCollapsed(){
+ boolean value = super.isCollapsed();
+
+ if (ForceValueHelper.isSet(this, NotationPackage.eINSTANCE.getDrawerStyle_Collapsed(), value)){
+ return value;
+ } else {
+ return getDrawerStyle().isCSSCollapsed();
+ }
+ }
+
+
+ @Override
+ public boolean isCollapsed(){
+ //return super.isCollapsed();
+ return isCSSCollapsed();
+ }
+
+
+
+ ////////////////////////////////////////////////
+ // Implements a setter for each CSS property //
+ ////////////////////////////////////////////////
+
+ @Override
+ public void setVisible(boolean value){
+ super.setVisible(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getView_Visible();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setType(java.lang.String value){
+ super.setType(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getView_Type();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setMutable(boolean value){
+ super.setMutable(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getView_Mutable();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setCollapsed(boolean value){
+ super.setCollapsed(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getDrawerStyle_Collapsed();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setCanonical(boolean value){
+ super.setCanonical(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getCanonicalStyle_Canonical();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setShowTitle(boolean value){
+ super.setShowTitle(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getTitleStyle_ShowTitle();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ //////////////////////////////////
+ // Implements the unset method //
+ //////////////////////////////////
+
+ @Override
+ public void eUnset(int featureId) {
+ super.eUnset(featureId);
+
+ EStructuralFeature feature = eDynamicFeature(featureId);
+ ForceValueHelper.unsetValue(this, feature);
+ }
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSConnectorImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSConnectorImpl.java
new file mode 100644
index 00000000000..7b9ba46f940
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSConnectorImpl.java
@@ -0,0 +1,337 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.notation.JumpLinkStatus;
+import org.eclipse.gmf.runtime.notation.JumpLinkType;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.Routing;
+import org.eclipse.gmf.runtime.notation.Smoothness;
+import org.eclipse.gmf.runtime.notation.impl.ConnectorImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.ForceValueHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSConnectorStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.impl.CSSConnectorStyleDelegate;
+
+public class CSSConnectorImpl extends ConnectorImpl implements CSSConnectorStyle {
+
+ protected ExtendedCSSEngine engine;
+
+ private CSSConnectorStyle connectorStyle;
+
+ protected CSSConnectorStyle getConnectorStyle() {
+ if(connectorStyle == null) {
+ connectorStyle = new CSSConnectorStyleDelegate(this, getEngine());
+ }
+ return connectorStyle;
+ }
+
+ protected ExtendedCSSEngine getEngine() {
+ if(engine == null) {
+ engine = ((CSSDiagramImpl)getDiagram()).getEngine();
+ }
+ return engine;
+ }
+
+
+ //////////////////////////////////////////
+ // Forwards accesses to CSS properties //
+ //////////////////////////////////////////
+
+
+ public int getCSSRoundedBendpointsRadius(){
+ int value = super.getRoundedBendpointsRadius();
+
+ if (ForceValueHelper.isSet(this, NotationPackage.eINSTANCE.getRoundedCornersStyle_RoundedBendpointsRadius(), value)){
+ return value;
+ } else {
+ return getConnectorStyle().getCSSRoundedBendpointsRadius();
+ }
+ }
+
+ public Routing getCSSRouting(){
+ Routing value = super.getRouting();
+
+ if (ForceValueHelper.isSet(this, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), value)){
+ return value;
+ } else {
+ return getConnectorStyle().getCSSRouting();
+ }
+ }
+
+ public Smoothness getCSSSmoothness(){
+ Smoothness value = super.getSmoothness();
+
+ if (ForceValueHelper.isSet(this, NotationPackage.eINSTANCE.getRoutingStyle_Smoothness(), value)){
+ return value;
+ } else {
+ return getConnectorStyle().getCSSSmoothness();
+ }
+ }
+
+ public boolean isCSSAvoidObstructions(){
+ boolean value = super.isAvoidObstructions();
+
+ if (ForceValueHelper.isSet(this, NotationPackage.eINSTANCE.getRoutingStyle_AvoidObstructions(), value)){
+ return value;
+ } else {
+ return getConnectorStyle().isCSSAvoidObstructions();
+ }
+ }
+
+ public boolean isCSSClosestDistance(){
+ boolean value = super.isClosestDistance();
+
+ if (ForceValueHelper.isSet(this, NotationPackage.eINSTANCE.getRoutingStyle_ClosestDistance(), value)){
+ return value;
+ } else {
+ return getConnectorStyle().isCSSClosestDistance();
+ }
+ }
+
+ public JumpLinkStatus getCSSJumpLinkStatus(){
+ JumpLinkStatus value = super.getJumpLinkStatus();
+
+ if (ForceValueHelper.isSet(this, NotationPackage.eINSTANCE.getRoutingStyle_JumpLinkStatus(), value)){
+ return value;
+ } else {
+ return getConnectorStyle().getCSSJumpLinkStatus();
+ }
+ }
+
+ public JumpLinkType getCSSJumpLinkType(){
+ JumpLinkType value = super.getJumpLinkType();
+
+ if (ForceValueHelper.isSet(this, NotationPackage.eINSTANCE.getRoutingStyle_JumpLinkType(), value)){
+ return value;
+ } else {
+ return getConnectorStyle().getCSSJumpLinkType();
+ }
+ }
+
+ public boolean isCSSJumpLinksReverse(){
+ boolean value = super.isJumpLinksReverse();
+
+ if (ForceValueHelper.isSet(this, NotationPackage.eINSTANCE.getRoutingStyle_JumpLinksReverse(), value)){
+ return value;
+ } else {
+ return getConnectorStyle().isCSSJumpLinksReverse();
+ }
+ }
+
+ public int getCSSLineColor(){
+ int value = super.getLineColor();
+
+ if (ForceValueHelper.isSet(this, NotationPackage.eINSTANCE.getLineStyle_LineColor(), value)){
+ return value;
+ } else {
+ return getConnectorStyle().getCSSLineColor();
+ }
+ }
+
+ public int getCSSLineWidth(){
+ int value = super.getLineWidth();
+
+ if (ForceValueHelper.isSet(this, NotationPackage.eINSTANCE.getLineStyle_LineWidth(), value)){
+ return value;
+ } else {
+ return getConnectorStyle().getCSSLineWidth();
+ }
+ }
+
+
+ @Override
+ public int getRoundedBendpointsRadius(){
+ //return super.getRoundedBendpointsRadius();
+ return getCSSRoundedBendpointsRadius();
+ }
+
+ @Override
+ public Routing getRouting(){
+ //return super.getRouting();
+ return getCSSRouting();
+ }
+
+ @Override
+ public Smoothness getSmoothness(){
+ //return super.getSmoothness();
+ return getCSSSmoothness();
+ }
+
+ @Override
+ public boolean isAvoidObstructions(){
+ //return super.isAvoidObstructions();
+ return isCSSAvoidObstructions();
+ }
+
+ @Override
+ public boolean isClosestDistance(){
+ //return super.isClosestDistance();
+ return isCSSClosestDistance();
+ }
+
+ @Override
+ public JumpLinkStatus getJumpLinkStatus(){
+ //return super.getJumpLinkStatus();
+ return getCSSJumpLinkStatus();
+ }
+
+ @Override
+ public JumpLinkType getJumpLinkType(){
+ //return super.getJumpLinkType();
+ return getCSSJumpLinkType();
+ }
+
+ @Override
+ public boolean isJumpLinksReverse(){
+ //return super.isJumpLinksReverse();
+ return isCSSJumpLinksReverse();
+ }
+
+ @Override
+ public int getLineColor(){
+ //return super.getLineColor();
+ return getCSSLineColor();
+ }
+
+ @Override
+ public int getLineWidth(){
+ //return super.getLineWidth();
+ return getCSSLineWidth();
+ }
+
+
+
+ ////////////////////////////////////////////////
+ // Implements a setter for each CSS property //
+ ////////////////////////////////////////////////
+
+ @Override
+ public void setVisible(boolean value){
+ super.setVisible(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getView_Visible();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setType(java.lang.String value){
+ super.setType(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getView_Type();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setMutable(boolean value){
+ super.setMutable(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getView_Mutable();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setRoundedBendpointsRadius(int value){
+ super.setRoundedBendpointsRadius(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getRoundedCornersStyle_RoundedBendpointsRadius();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setRouting(Routing value){
+ super.setRouting(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getRoutingStyle_Routing();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setSmoothness(Smoothness value){
+ super.setSmoothness(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getRoutingStyle_Smoothness();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setAvoidObstructions(boolean value){
+ super.setAvoidObstructions(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getRoutingStyle_AvoidObstructions();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setClosestDistance(boolean value){
+ super.setClosestDistance(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getRoutingStyle_ClosestDistance();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setJumpLinkStatus(JumpLinkStatus value){
+ super.setJumpLinkStatus(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getRoutingStyle_JumpLinkStatus();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setJumpLinkType(JumpLinkType value){
+ super.setJumpLinkType(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getRoutingStyle_JumpLinkType();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setJumpLinksReverse(boolean value){
+ super.setJumpLinksReverse(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getRoutingStyle_JumpLinksReverse();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setLineColor(int value){
+ super.setLineColor(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getLineStyle_LineColor();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setLineWidth(int value){
+ super.setLineWidth(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getLineStyle_LineWidth();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ //////////////////////////////////
+ // Implements the unset method //
+ //////////////////////////////////
+
+ @Override
+ public void eUnset(int featureId) {
+ super.eUnset(featureId);
+
+ EStructuralFeature feature = eDynamicFeature(featureId);
+ ForceValueHelper.unsetValue(this, feature);
+ }
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSConnectorStyleImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSConnectorStyleImpl.java
new file mode 100644
index 00000000000..449bd55174d
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSConnectorStyleImpl.java
@@ -0,0 +1,328 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.notation.JumpLinkStatus;
+import org.eclipse.gmf.runtime.notation.JumpLinkType;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.Routing;
+import org.eclipse.gmf.runtime.notation.Smoothness;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.runtime.notation.impl.ConnectorStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.ForceValueHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSConnectorStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.impl.CSSConnectorStyleDelegate;
+
+public class CSSConnectorStyleImpl extends ConnectorStyleImpl implements CSSConnectorStyle {
+
+ protected ExtendedCSSEngine engine;
+
+ private CSSConnectorStyle connectorStyle;
+
+ protected CSSConnectorStyle getConnectorStyle() {
+ if(connectorStyle == null) {
+ connectorStyle = new CSSConnectorStyleDelegate(this, getEngine());
+ }
+ return connectorStyle;
+ }
+
+ protected ExtendedCSSEngine getEngine(){
+ if (engine == null){
+ engine = ((CSSDiagramImpl)findView().getDiagram()).getEngine();
+ }
+ return engine;
+ }
+
+ protected View findView(){
+ EObject parent = eContainer();
+ while (! (parent instanceof View) && parent != null){
+ parent = parent.eContainer();
+ }
+
+ if (parent != null){
+ return (View)parent;
+ }
+
+ return null;
+ }
+
+
+ //////////////////////////////////////////
+ // Forwards accesses to CSS properties //
+ //////////////////////////////////////////
+
+
+ public int getCSSRoundedBendpointsRadius(){
+ int value = super.getRoundedBendpointsRadius();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getRoundedCornersStyle_RoundedBendpointsRadius(), value)){
+ return value;
+ } else {
+ return getConnectorStyle().getCSSRoundedBendpointsRadius();
+ }
+ }
+
+ public Routing getCSSRouting(){
+ Routing value = super.getRouting();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), value)){
+ return value;
+ } else {
+ return getConnectorStyle().getCSSRouting();
+ }
+ }
+
+ public Smoothness getCSSSmoothness(){
+ Smoothness value = super.getSmoothness();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getRoutingStyle_Smoothness(), value)){
+ return value;
+ } else {
+ return getConnectorStyle().getCSSSmoothness();
+ }
+ }
+
+ public boolean isCSSAvoidObstructions(){
+ boolean value = super.isAvoidObstructions();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getRoutingStyle_AvoidObstructions(), value)){
+ return value;
+ } else {
+ return getConnectorStyle().isCSSAvoidObstructions();
+ }
+ }
+
+ public boolean isCSSClosestDistance(){
+ boolean value = super.isClosestDistance();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getRoutingStyle_ClosestDistance(), value)){
+ return value;
+ } else {
+ return getConnectorStyle().isCSSClosestDistance();
+ }
+ }
+
+ public JumpLinkStatus getCSSJumpLinkStatus(){
+ JumpLinkStatus value = super.getJumpLinkStatus();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getRoutingStyle_JumpLinkStatus(), value)){
+ return value;
+ } else {
+ return getConnectorStyle().getCSSJumpLinkStatus();
+ }
+ }
+
+ public JumpLinkType getCSSJumpLinkType(){
+ JumpLinkType value = super.getJumpLinkType();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getRoutingStyle_JumpLinkType(), value)){
+ return value;
+ } else {
+ return getConnectorStyle().getCSSJumpLinkType();
+ }
+ }
+
+ public boolean isCSSJumpLinksReverse(){
+ boolean value = super.isJumpLinksReverse();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getRoutingStyle_JumpLinksReverse(), value)){
+ return value;
+ } else {
+ return getConnectorStyle().isCSSJumpLinksReverse();
+ }
+ }
+
+ public int getCSSLineColor(){
+ int value = super.getLineColor();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getLineStyle_LineColor(), value)){
+ return value;
+ } else {
+ return getConnectorStyle().getCSSLineColor();
+ }
+ }
+
+ public int getCSSLineWidth(){
+ int value = super.getLineWidth();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getLineStyle_LineWidth(), value)){
+ return value;
+ } else {
+ return getConnectorStyle().getCSSLineWidth();
+ }
+ }
+
+
+ @Override
+ public int getRoundedBendpointsRadius(){
+ //return super.getRoundedBendpointsRadius();
+ return getCSSRoundedBendpointsRadius();
+ }
+
+ @Override
+ public Routing getRouting(){
+ //return super.getRouting();
+ return getCSSRouting();
+ }
+
+ @Override
+ public Smoothness getSmoothness(){
+ //return super.getSmoothness();
+ return getCSSSmoothness();
+ }
+
+ @Override
+ public boolean isAvoidObstructions(){
+ //return super.isAvoidObstructions();
+ return isCSSAvoidObstructions();
+ }
+
+ @Override
+ public boolean isClosestDistance(){
+ //return super.isClosestDistance();
+ return isCSSClosestDistance();
+ }
+
+ @Override
+ public JumpLinkStatus getJumpLinkStatus(){
+ //return super.getJumpLinkStatus();
+ return getCSSJumpLinkStatus();
+ }
+
+ @Override
+ public JumpLinkType getJumpLinkType(){
+ //return super.getJumpLinkType();
+ return getCSSJumpLinkType();
+ }
+
+ @Override
+ public boolean isJumpLinksReverse(){
+ //return super.isJumpLinksReverse();
+ return isCSSJumpLinksReverse();
+ }
+
+ @Override
+ public int getLineColor(){
+ //return super.getLineColor();
+ return getCSSLineColor();
+ }
+
+ @Override
+ public int getLineWidth(){
+ //return super.getLineWidth();
+ return getCSSLineWidth();
+ }
+
+
+
+ ////////////////////////////////////////////////
+ // Implements a setter for each CSS property //
+ ////////////////////////////////////////////////
+
+ @Override
+ public void setRoundedBendpointsRadius(int value){
+ super.setRoundedBendpointsRadius(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getRoundedCornersStyle_RoundedBendpointsRadius();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setRouting(Routing value){
+ super.setRouting(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getRoutingStyle_Routing();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setSmoothness(Smoothness value){
+ super.setSmoothness(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getRoutingStyle_Smoothness();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setAvoidObstructions(boolean value){
+ super.setAvoidObstructions(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getRoutingStyle_AvoidObstructions();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setClosestDistance(boolean value){
+ super.setClosestDistance(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getRoutingStyle_ClosestDistance();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setJumpLinkStatus(JumpLinkStatus value){
+ super.setJumpLinkStatus(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getRoutingStyle_JumpLinkStatus();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setJumpLinkType(JumpLinkType value){
+ super.setJumpLinkType(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getRoutingStyle_JumpLinkType();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setJumpLinksReverse(boolean value){
+ super.setJumpLinksReverse(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getRoutingStyle_JumpLinksReverse();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setLineColor(int value){
+ super.setLineColor(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getLineStyle_LineColor();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setLineWidth(int value){
+ super.setLineWidth(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getLineStyle_LineWidth();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ //////////////////////////////////
+ // Implements the unset method //
+ //////////////////////////////////
+
+ @Override
+ public void eUnset(int featureId) {
+ super.eUnset(featureId);
+
+ EStructuralFeature feature = eDynamicFeature(featureId);
+ ForceValueHelper.unsetValue(findView(), feature);
+ }
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSDataTypeStyleImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSDataTypeStyleImpl.java
new file mode 100644
index 00000000000..380079f2bb6
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSDataTypeStyleImpl.java
@@ -0,0 +1,108 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.runtime.notation.impl.DataTypeStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.ForceValueHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSDataTypeStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.impl.CSSDataTypeStyleDelegate;
+
+public class CSSDataTypeStyleImpl extends DataTypeStyleImpl implements CSSDataTypeStyle {
+
+ protected ExtendedCSSEngine engine;
+
+ private CSSDataTypeStyle dataTypeStyle;
+
+ protected CSSDataTypeStyle getDataTypeStyle() {
+ if(dataTypeStyle == null) {
+ dataTypeStyle = new CSSDataTypeStyleDelegate(this, getEngine());
+ }
+ return dataTypeStyle;
+ }
+
+ protected ExtendedCSSEngine getEngine(){
+ if (engine == null){
+ engine = ((CSSDiagramImpl)findView().getDiagram()).getEngine();
+ }
+ return engine;
+ }
+
+ protected View findView(){
+ EObject parent = eContainer();
+ while (! (parent instanceof View) && parent != null){
+ parent = parent.eContainer();
+ }
+
+ if (parent != null){
+ return (View)parent;
+ }
+
+ return null;
+ }
+
+
+ //////////////////////////////////////////
+ // Forwards accesses to CSS properties //
+ //////////////////////////////////////////
+
+
+ public java.lang.String getCSSName(){
+ java.lang.String value = super.getName();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getNamedStyle_Name(), value)){
+ return value;
+ } else {
+ return getDataTypeStyle().getCSSName();
+ }
+ }
+
+
+ @Override
+ public java.lang.String getName(){
+ //return super.getName();
+ return getCSSName();
+ }
+
+
+
+ ////////////////////////////////////////////////
+ // Implements a setter for each CSS property //
+ ////////////////////////////////////////////////
+
+ @Override
+ public void setName(java.lang.String value){
+ super.setName(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getNamedStyle_Name();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ //////////////////////////////////
+ // Implements the unset method //
+ //////////////////////////////////
+
+ @Override
+ public void eUnset(int featureId) {
+ super.eUnset(featureId);
+
+ EStructuralFeature feature = eDynamicFeature(featureId);
+ ForceValueHelper.unsetValue(findView(), feature);
+ }
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSDescriptionStyleImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSDescriptionStyleImpl.java
new file mode 100644
index 00000000000..e60a2f97b1b
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSDescriptionStyleImpl.java
@@ -0,0 +1,108 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.runtime.notation.impl.DescriptionStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.ForceValueHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSDescriptionStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.impl.CSSDescriptionStyleDelegate;
+
+public class CSSDescriptionStyleImpl extends DescriptionStyleImpl implements CSSDescriptionStyle {
+
+ protected ExtendedCSSEngine engine;
+
+ private CSSDescriptionStyle descriptionStyle;
+
+ protected CSSDescriptionStyle getDescriptionStyle() {
+ if(descriptionStyle == null) {
+ descriptionStyle = new CSSDescriptionStyleDelegate(this, getEngine());
+ }
+ return descriptionStyle;
+ }
+
+ protected ExtendedCSSEngine getEngine(){
+ if (engine == null){
+ engine = ((CSSDiagramImpl)findView().getDiagram()).getEngine();
+ }
+ return engine;
+ }
+
+ protected View findView(){
+ EObject parent = eContainer();
+ while (! (parent instanceof View) && parent != null){
+ parent = parent.eContainer();
+ }
+
+ if (parent != null){
+ return (View)parent;
+ }
+
+ return null;
+ }
+
+
+ //////////////////////////////////////////
+ // Forwards accesses to CSS properties //
+ //////////////////////////////////////////
+
+
+ public java.lang.String getCSSDescription(){
+ java.lang.String value = super.getDescription();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getDescriptionStyle_Description(), value)){
+ return value;
+ } else {
+ return getDescriptionStyle().getCSSDescription();
+ }
+ }
+
+
+ @Override
+ public java.lang.String getDescription(){
+ //return super.getDescription();
+ return getCSSDescription();
+ }
+
+
+
+ ////////////////////////////////////////////////
+ // Implements a setter for each CSS property //
+ ////////////////////////////////////////////////
+
+ @Override
+ public void setDescription(java.lang.String value){
+ super.setDescription(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getDescriptionStyle_Description();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ //////////////////////////////////
+ // Implements the unset method //
+ //////////////////////////////////
+
+ @Override
+ public void eUnset(int featureId) {
+ super.eUnset(featureId);
+
+ EStructuralFeature feature = eDynamicFeature(featureId);
+ ForceValueHelper.unsetValue(findView(), feature);
+ }
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSDiagramLinkStyleImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSDiagramLinkStyleImpl.java
new file mode 100644
index 00000000000..792cc3c9ba2
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSDiagramLinkStyleImpl.java
@@ -0,0 +1,86 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.runtime.notation.impl.DiagramLinkStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.ForceValueHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSDiagramLinkStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.impl.CSSDiagramLinkStyleDelegate;
+
+public class CSSDiagramLinkStyleImpl extends DiagramLinkStyleImpl implements CSSDiagramLinkStyle {
+
+ protected ExtendedCSSEngine engine;
+
+ private CSSDiagramLinkStyle diagramLinkStyle;
+
+ protected CSSDiagramLinkStyle getDiagramLinkStyle() {
+ if(diagramLinkStyle == null) {
+ diagramLinkStyle = new CSSDiagramLinkStyleDelegate(this, getEngine());
+ }
+ return diagramLinkStyle;
+ }
+
+ protected ExtendedCSSEngine getEngine(){
+ if (engine == null){
+ engine = ((CSSDiagramImpl)findView().getDiagram()).getEngine();
+ }
+ return engine;
+ }
+
+ protected View findView(){
+ EObject parent = eContainer();
+ while (! (parent instanceof View) && parent != null){
+ parent = parent.eContainer();
+ }
+
+ if (parent != null){
+ return (View)parent;
+ }
+
+ return null;
+ }
+
+
+ //////////////////////////////////////////
+ // Forwards accesses to CSS properties //
+ //////////////////////////////////////////
+
+
+
+
+
+
+
+ ////////////////////////////////////////////////
+ // Implements a setter for each CSS property //
+ ////////////////////////////////////////////////
+
+
+ //////////////////////////////////
+ // Implements the unset method //
+ //////////////////////////////////
+
+ @Override
+ public void eUnset(int featureId) {
+ super.eUnset(featureId);
+
+ EStructuralFeature feature = eDynamicFeature(featureId);
+ ForceValueHelper.unsetValue(findView(), feature);
+ }
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSDiagramStyleImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSDiagramStyleImpl.java
new file mode 100644
index 00000000000..9bb74294d17
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSDiagramStyleImpl.java
@@ -0,0 +1,204 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.runtime.notation.impl.DiagramStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.ForceValueHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSDiagramStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.impl.CSSDiagramStyleDelegate;
+
+public class CSSDiagramStyleImpl extends DiagramStyleImpl implements CSSDiagramStyle {
+
+ protected ExtendedCSSEngine engine;
+
+ private CSSDiagramStyle diagramStyle;
+
+ protected CSSDiagramStyle getDiagramStyle() {
+ if(diagramStyle == null) {
+ diagramStyle = new CSSDiagramStyleDelegate(this, getEngine());
+ }
+ return diagramStyle;
+ }
+
+ protected ExtendedCSSEngine getEngine() {
+ if(engine == null) {
+ engine = ((CSSDiagramImpl)findView().getDiagram()).getEngine();
+ }
+ return engine;
+ }
+
+ protected View findView() {
+ EObject parent = eContainer();
+ while(!(parent instanceof View) && parent != null) {
+ parent = parent.eContainer();
+ }
+
+ if(parent != null) {
+ return (View)parent;
+ }
+
+ return null;
+ }
+
+
+ //////////////////////////////////////////
+ // Forwards accesses to CSS properties //
+ //////////////////////////////////////////
+
+
+ public int getCSSPageX() {
+ int value = super.getPageX();
+
+ if(ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getPageStyle_PageX(), value)) {
+ return value;
+ } else {
+ return getDiagramStyle().getCSSPageX();
+ }
+ }
+
+ public int getCSSPageY() {
+ int value = super.getPageY();
+
+ if(ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getPageStyle_PageY(), value)) {
+ return value;
+ } else {
+ return getDiagramStyle().getCSSPageY();
+ }
+ }
+
+ public int getCSSPageWidth() {
+ int value = super.getPageWidth();
+
+ if(ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getPageStyle_PageWidth(), value)) {
+ return value;
+ } else {
+ return getDiagramStyle().getCSSPageWidth();
+ }
+ }
+
+ public int getCSSPageHeight() {
+ int value = super.getPageHeight();
+
+ if(ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getPageStyle_PageHeight(), value)) {
+ return value;
+ } else {
+ return getDiagramStyle().getCSSPageHeight();
+ }
+ }
+
+ public java.lang.String getCSSDescription() {
+ java.lang.String value = super.getDescription();
+
+ if(ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getDescriptionStyle_Description(), value)) {
+ return value;
+ } else {
+ return getDiagramStyle().getCSSDescription();
+ }
+ }
+
+
+ @Override
+ public int getPageX() {
+ //return super.getPageX();
+ return getCSSPageX();
+ }
+
+ @Override
+ public int getPageY() {
+ //return super.getPageY();
+ return getCSSPageY();
+ }
+
+ @Override
+ public int getPageWidth() {
+ //return super.getPageWidth();
+ return getCSSPageWidth();
+ }
+
+ @Override
+ public int getPageHeight() {
+ //return super.getPageHeight();
+ return getCSSPageHeight();
+ }
+
+ @Override
+ public java.lang.String getDescription() {
+ //return super.getDescription();
+ return getCSSDescription();
+ }
+
+
+
+ ////////////////////////////////////////////////
+ // Implements a setter for each CSS property //
+ ////////////////////////////////////////////////
+
+ @Override
+ public void setPageX(int value) {
+ super.setPageX(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getPageStyle_PageX();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setPageY(int value) {
+ super.setPageY(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getPageStyle_PageY();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setPageWidth(int value) {
+ super.setPageWidth(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getPageStyle_PageWidth();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setPageHeight(int value) {
+ super.setPageHeight(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getPageStyle_PageHeight();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setDescription(java.lang.String value) {
+ super.setDescription(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getDescriptionStyle_Description();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ //////////////////////////////////
+ // Implements the unset method //
+ //////////////////////////////////
+
+ @Override
+ public void eUnset(int featureId) {
+ super.eUnset(featureId);
+
+ EStructuralFeature feature = eDynamicFeature(featureId);
+ ForceValueHelper.unsetValue(findView(), feature);
+ }
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSDrawerStyleImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSDrawerStyleImpl.java
new file mode 100644
index 00000000000..fa2788b619c
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSDrawerStyleImpl.java
@@ -0,0 +1,108 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.runtime.notation.impl.DrawerStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.ForceValueHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSDrawerStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.impl.CSSDrawerStyleDelegate;
+
+public class CSSDrawerStyleImpl extends DrawerStyleImpl implements CSSDrawerStyle {
+
+ protected ExtendedCSSEngine engine;
+
+ private CSSDrawerStyle drawerStyle;
+
+ protected CSSDrawerStyle getDrawerStyle() {
+ if(drawerStyle == null) {
+ drawerStyle = new CSSDrawerStyleDelegate(this, getEngine());
+ }
+ return drawerStyle;
+ }
+
+ protected ExtendedCSSEngine getEngine(){
+ if (engine == null){
+ engine = ((CSSDiagramImpl)findView().getDiagram()).getEngine();
+ }
+ return engine;
+ }
+
+ protected View findView(){
+ EObject parent = eContainer();
+ while (! (parent instanceof View) && parent != null){
+ parent = parent.eContainer();
+ }
+
+ if (parent != null){
+ return (View)parent;
+ }
+
+ return null;
+ }
+
+
+ //////////////////////////////////////////
+ // Forwards accesses to CSS properties //
+ //////////////////////////////////////////
+
+
+ public boolean isCSSCollapsed(){
+ boolean value = super.isCollapsed();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getDrawerStyle_Collapsed(), value)){
+ return value;
+ } else {
+ return getDrawerStyle().isCSSCollapsed();
+ }
+ }
+
+
+ @Override
+ public boolean isCollapsed(){
+ //return super.isCollapsed();
+ return isCSSCollapsed();
+ }
+
+
+
+ ////////////////////////////////////////////////
+ // Implements a setter for each CSS property //
+ ////////////////////////////////////////////////
+
+ @Override
+ public void setCollapsed(boolean value){
+ super.setCollapsed(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getDrawerStyle_Collapsed();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ //////////////////////////////////
+ // Implements the unset method //
+ //////////////////////////////////
+
+ @Override
+ public void eUnset(int featureId) {
+ super.eUnset(featureId);
+
+ EStructuralFeature feature = eDynamicFeature(featureId);
+ ForceValueHelper.unsetValue(findView(), feature);
+ }
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSFillStyleImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSFillStyleImpl.java
new file mode 100644
index 00000000000..ca4710433d5
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSFillStyleImpl.java
@@ -0,0 +1,156 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.runtime.notation.impl.FillStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.ForceValueHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSFillStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.impl.CSSFillStyleDelegate;
+
+public class CSSFillStyleImpl extends FillStyleImpl implements CSSFillStyle {
+
+ protected ExtendedCSSEngine engine;
+
+ private CSSFillStyle fillStyle;
+
+ protected CSSFillStyle getFillStyle() {
+ if(fillStyle == null) {
+ fillStyle = new CSSFillStyleDelegate(this, getEngine());
+ }
+ return fillStyle;
+ }
+
+ protected ExtendedCSSEngine getEngine(){
+ if (engine == null){
+ engine = ((CSSDiagramImpl)findView().getDiagram()).getEngine();
+ }
+ return engine;
+ }
+
+ protected View findView(){
+ EObject parent = eContainer();
+ while (! (parent instanceof View) && parent != null){
+ parent = parent.eContainer();
+ }
+
+ if (parent != null){
+ return (View)parent;
+ }
+
+ return null;
+ }
+
+
+ //////////////////////////////////////////
+ // Forwards accesses to CSS properties //
+ //////////////////////////////////////////
+
+
+ public int getCSSFillColor(){
+ int value = super.getFillColor();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getFillStyle_FillColor(), value)){
+ return value;
+ } else {
+ return getFillStyle().getCSSFillColor();
+ }
+ }
+
+ public int getCSSTransparency(){
+ int value = super.getTransparency();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getFillStyle_Transparency(), value)){
+ return value;
+ } else {
+ return getFillStyle().getCSSTransparency();
+ }
+ }
+
+ public org.eclipse.gmf.runtime.notation.datatype.GradientData getCSSGradient(){
+ org.eclipse.gmf.runtime.notation.datatype.GradientData value = super.getGradient();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getFillStyle_Gradient(), value)){
+ return value;
+ } else {
+ return getFillStyle().getCSSGradient();
+ }
+ }
+
+
+ @Override
+ public int getFillColor(){
+ //return super.getFillColor();
+ return getCSSFillColor();
+ }
+
+ @Override
+ public int getTransparency(){
+ //return super.getTransparency();
+ return getCSSTransparency();
+ }
+
+ @Override
+ public org.eclipse.gmf.runtime.notation.datatype.GradientData getGradient(){
+ //return super.getGradient();
+ return getCSSGradient();
+ }
+
+
+
+ ////////////////////////////////////////////////
+ // Implements a setter for each CSS property //
+ ////////////////////////////////////////////////
+
+ @Override
+ public void setFillColor(int value){
+ super.setFillColor(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getFillStyle_FillColor();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setTransparency(int value){
+ super.setTransparency(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getFillStyle_Transparency();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setGradient(org.eclipse.gmf.runtime.notation.datatype.GradientData value){
+ super.setGradient(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getFillStyle_Gradient();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ //////////////////////////////////
+ // Implements the unset method //
+ //////////////////////////////////
+
+ @Override
+ public void eUnset(int featureId) {
+ super.eUnset(featureId);
+
+ EStructuralFeature feature = eDynamicFeature(featureId);
+ ForceValueHelper.unsetValue(findView(), feature);
+ }
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSFilteringStyleImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSFilteringStyleImpl.java
new file mode 100644
index 00000000000..5215c40daa6
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSFilteringStyleImpl.java
@@ -0,0 +1,133 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.notation.Filtering;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.runtime.notation.impl.FilteringStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.ForceValueHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSFilteringStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.impl.CSSFilteringStyleDelegate;
+
+public class CSSFilteringStyleImpl extends FilteringStyleImpl implements CSSFilteringStyle {
+
+ protected ExtendedCSSEngine engine;
+
+ private CSSFilteringStyle filteringStyle;
+
+ protected CSSFilteringStyle getFilteringStyle() {
+ if(filteringStyle == null) {
+ filteringStyle = new CSSFilteringStyleDelegate(this, getEngine());
+ }
+ return filteringStyle;
+ }
+
+ protected ExtendedCSSEngine getEngine(){
+ if (engine == null){
+ engine = ((CSSDiagramImpl)findView().getDiagram()).getEngine();
+ }
+ return engine;
+ }
+
+ protected View findView(){
+ EObject parent = eContainer();
+ while (! (parent instanceof View) && parent != null){
+ parent = parent.eContainer();
+ }
+
+ if (parent != null){
+ return (View)parent;
+ }
+
+ return null;
+ }
+
+
+ //////////////////////////////////////////
+ // Forwards accesses to CSS properties //
+ //////////////////////////////////////////
+
+
+ public Filtering getCSSFiltering(){
+ Filtering value = super.getFiltering();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getFilteringStyle_Filtering(), value)){
+ return value;
+ } else {
+ return getFilteringStyle().getCSSFiltering();
+ }
+ }
+
+ public java.util.List getCSSFilteringKeys(){
+ java.util.List value = super.getFilteringKeys();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getFilteringStyle_FilteringKeys(), value)){
+ return value;
+ } else {
+ return getFilteringStyle().getCSSFilteringKeys();
+ }
+ }
+
+
+ @Override
+ public Filtering getFiltering(){
+ //return super.getFiltering();
+ return getCSSFiltering();
+ }
+
+ @Override
+ public java.util.List getFilteringKeys(){
+ //return super.getFilteringKeys();
+ return getCSSFilteringKeys();
+ }
+
+
+
+ ////////////////////////////////////////////////
+ // Implements a setter for each CSS property //
+ ////////////////////////////////////////////////
+
+ @Override
+ public void setFiltering(Filtering value){
+ super.setFiltering(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getFilteringStyle_Filtering();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setFilteringKeys(java.util.List value){
+ super.setFilteringKeys(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getFilteringStyle_FilteringKeys();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ //////////////////////////////////
+ // Implements the unset method //
+ //////////////////////////////////
+
+ @Override
+ public void eUnset(int featureId) {
+ super.eUnset(featureId);
+
+ EStructuralFeature feature = eDynamicFeature(featureId);
+ ForceValueHelper.unsetValue(findView(), feature);
+ }
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSFontStyleImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSFontStyleImpl.java
new file mode 100644
index 00000000000..1ca85f5f869
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSFontStyleImpl.java
@@ -0,0 +1,252 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.runtime.notation.impl.FontStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.ForceValueHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSFontStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.impl.CSSFontStyleDelegate;
+
+public class CSSFontStyleImpl extends FontStyleImpl implements CSSFontStyle {
+
+ protected ExtendedCSSEngine engine;
+
+ private CSSFontStyle fontStyle;
+
+ protected CSSFontStyle getFontStyle() {
+ if(fontStyle == null) {
+ fontStyle = new CSSFontStyleDelegate(this, getEngine());
+ }
+ return fontStyle;
+ }
+
+ protected ExtendedCSSEngine getEngine(){
+ if (engine == null){
+ engine = ((CSSDiagramImpl)findView().getDiagram()).getEngine();
+ }
+ return engine;
+ }
+
+ protected View findView(){
+ EObject parent = eContainer();
+ while (! (parent instanceof View) && parent != null){
+ parent = parent.eContainer();
+ }
+
+ if (parent != null){
+ return (View)parent;
+ }
+
+ return null;
+ }
+
+
+ //////////////////////////////////////////
+ // Forwards accesses to CSS properties //
+ //////////////////////////////////////////
+
+
+ public int getCSSFontColor(){
+ int value = super.getFontColor();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getFontStyle_FontColor(), value)){
+ return value;
+ } else {
+ return getFontStyle().getCSSFontColor();
+ }
+ }
+
+ public java.lang.String getCSSFontName(){
+ java.lang.String value = super.getFontName();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getFontStyle_FontName(), value)){
+ return value;
+ } else {
+ return getFontStyle().getCSSFontName();
+ }
+ }
+
+ public int getCSSFontHeight(){
+ int value = super.getFontHeight();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getFontStyle_FontHeight(), value)){
+ return value;
+ } else {
+ return getFontStyle().getCSSFontHeight();
+ }
+ }
+
+ public boolean isCSSBold(){
+ boolean value = super.isBold();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getFontStyle_Bold(), value)){
+ return value;
+ } else {
+ return getFontStyle().isCSSBold();
+ }
+ }
+
+ public boolean isCSSItalic(){
+ boolean value = super.isItalic();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getFontStyle_Italic(), value)){
+ return value;
+ } else {
+ return getFontStyle().isCSSItalic();
+ }
+ }
+
+ public boolean isCSSUnderline(){
+ boolean value = super.isUnderline();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getFontStyle_Underline(), value)){
+ return value;
+ } else {
+ return getFontStyle().isCSSUnderline();
+ }
+ }
+
+ public boolean isCSSStrikeThrough(){
+ boolean value = super.isStrikeThrough();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getFontStyle_StrikeThrough(), value)){
+ return value;
+ } else {
+ return getFontStyle().isCSSStrikeThrough();
+ }
+ }
+
+
+ @Override
+ public int getFontColor(){
+ //return super.getFontColor();
+ return getCSSFontColor();
+ }
+
+ @Override
+ public java.lang.String getFontName(){
+ //return super.getFontName();
+ return getCSSFontName();
+ }
+
+ @Override
+ public int getFontHeight(){
+ //return super.getFontHeight();
+ return getCSSFontHeight();
+ }
+
+ @Override
+ public boolean isBold(){
+ //return super.isBold();
+ return isCSSBold();
+ }
+
+ @Override
+ public boolean isItalic(){
+ //return super.isItalic();
+ return isCSSItalic();
+ }
+
+ @Override
+ public boolean isUnderline(){
+ //return super.isUnderline();
+ return isCSSUnderline();
+ }
+
+ @Override
+ public boolean isStrikeThrough(){
+ //return super.isStrikeThrough();
+ return isCSSStrikeThrough();
+ }
+
+
+
+ ////////////////////////////////////////////////
+ // Implements a setter for each CSS property //
+ ////////////////////////////////////////////////
+
+ @Override
+ public void setFontColor(int value){
+ super.setFontColor(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getFontStyle_FontColor();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setFontName(java.lang.String value){
+ super.setFontName(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getFontStyle_FontName();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setFontHeight(int value){
+ super.setFontHeight(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getFontStyle_FontHeight();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setBold(boolean value){
+ super.setBold(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getFontStyle_Bold();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setItalic(boolean value){
+ super.setItalic(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getFontStyle_Italic();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setUnderline(boolean value){
+ super.setUnderline(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getFontStyle_Underline();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setStrikeThrough(boolean value){
+ super.setStrikeThrough(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getFontStyle_StrikeThrough();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ //////////////////////////////////
+ // Implements the unset method //
+ //////////////////////////////////
+
+ @Override
+ public void eUnset(int featureId) {
+ super.eUnset(featureId);
+
+ EStructuralFeature feature = eDynamicFeature(featureId);
+ ForceValueHelper.unsetValue(findView(), feature);
+ }
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSGuideStyleImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSGuideStyleImpl.java
new file mode 100644
index 00000000000..37e3879f7d7
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSGuideStyleImpl.java
@@ -0,0 +1,86 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.runtime.notation.impl.GuideStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.ForceValueHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSGuideStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.impl.CSSGuideStyleDelegate;
+
+public class CSSGuideStyleImpl extends GuideStyleImpl implements CSSGuideStyle {
+
+ protected ExtendedCSSEngine engine;
+
+ private CSSGuideStyle guideStyle;
+
+ protected CSSGuideStyle getGuideStyle() {
+ if(guideStyle == null) {
+ guideStyle = new CSSGuideStyleDelegate(this, getEngine());
+ }
+ return guideStyle;
+ }
+
+ protected ExtendedCSSEngine getEngine(){
+ if (engine == null){
+ engine = ((CSSDiagramImpl)findView().getDiagram()).getEngine();
+ }
+ return engine;
+ }
+
+ protected View findView(){
+ EObject parent = eContainer();
+ while (! (parent instanceof View) && parent != null){
+ parent = parent.eContainer();
+ }
+
+ if (parent != null){
+ return (View)parent;
+ }
+
+ return null;
+ }
+
+
+ //////////////////////////////////////////
+ // Forwards accesses to CSS properties //
+ //////////////////////////////////////////
+
+
+
+
+
+
+
+ ////////////////////////////////////////////////
+ // Implements a setter for each CSS property //
+ ////////////////////////////////////////////////
+
+
+ //////////////////////////////////
+ // Implements the unset method //
+ //////////////////////////////////
+
+ @Override
+ public void eUnset(int featureId) {
+ super.eUnset(featureId);
+
+ EStructuralFeature feature = eDynamicFeature(featureId);
+ ForceValueHelper.unsetValue(findView(), feature);
+ }
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSHintedDiagramLinkStyleImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSHintedDiagramLinkStyleImpl.java
new file mode 100644
index 00000000000..4afab3d12a3
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSHintedDiagramLinkStyleImpl.java
@@ -0,0 +1,108 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.runtime.notation.impl.HintedDiagramLinkStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.ForceValueHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSHintedDiagramLinkStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.impl.CSSHintedDiagramLinkStyleDelegate;
+
+public class CSSHintedDiagramLinkStyleImpl extends HintedDiagramLinkStyleImpl implements CSSHintedDiagramLinkStyle {
+
+ protected ExtendedCSSEngine engine;
+
+ private CSSHintedDiagramLinkStyle hintedDiagramLinkStyle;
+
+ protected CSSHintedDiagramLinkStyle getHintedDiagramLinkStyle() {
+ if(hintedDiagramLinkStyle == null) {
+ hintedDiagramLinkStyle = new CSSHintedDiagramLinkStyleDelegate(this, getEngine());
+ }
+ return hintedDiagramLinkStyle;
+ }
+
+ protected ExtendedCSSEngine getEngine(){
+ if (engine == null){
+ engine = ((CSSDiagramImpl)findView().getDiagram()).getEngine();
+ }
+ return engine;
+ }
+
+ protected View findView(){
+ EObject parent = eContainer();
+ while (! (parent instanceof View) && parent != null){
+ parent = parent.eContainer();
+ }
+
+ if (parent != null){
+ return (View)parent;
+ }
+
+ return null;
+ }
+
+
+ //////////////////////////////////////////
+ // Forwards accesses to CSS properties //
+ //////////////////////////////////////////
+
+
+ public java.lang.String getCSSHint(){
+ java.lang.String value = super.getHint();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getHintedDiagramLinkStyle_Hint(), value)){
+ return value;
+ } else {
+ return getHintedDiagramLinkStyle().getCSSHint();
+ }
+ }
+
+
+ @Override
+ public java.lang.String getHint(){
+ //return super.getHint();
+ return getCSSHint();
+ }
+
+
+
+ ////////////////////////////////////////////////
+ // Implements a setter for each CSS property //
+ ////////////////////////////////////////////////
+
+ @Override
+ public void setHint(java.lang.String value){
+ super.setHint(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getHintedDiagramLinkStyle_Hint();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ //////////////////////////////////
+ // Implements the unset method //
+ //////////////////////////////////
+
+ @Override
+ public void eUnset(int featureId) {
+ super.eUnset(featureId);
+
+ EStructuralFeature feature = eDynamicFeature(featureId);
+ ForceValueHelper.unsetValue(findView(), feature);
+ }
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSImageBufferStyleImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSImageBufferStyleImpl.java
new file mode 100644
index 00000000000..2ba20044436
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSImageBufferStyleImpl.java
@@ -0,0 +1,132 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.runtime.notation.impl.ImageBufferStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.ForceValueHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSImageBufferStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.impl.CSSImageBufferStyleDelegate;
+
+public class CSSImageBufferStyleImpl extends ImageBufferStyleImpl implements CSSImageBufferStyle {
+
+ protected ExtendedCSSEngine engine;
+
+ private CSSImageBufferStyle imageBufferStyle;
+
+ protected CSSImageBufferStyle getImageBufferStyle() {
+ if(imageBufferStyle == null) {
+ imageBufferStyle = new CSSImageBufferStyleDelegate(this, getEngine());
+ }
+ return imageBufferStyle;
+ }
+
+ protected ExtendedCSSEngine getEngine() {
+ if(engine == null) {
+ engine = ((CSSDiagramImpl)findView().getDiagram()).getEngine();
+ }
+ return engine;
+ }
+
+ protected View findView() {
+ EObject parent = eContainer();
+ while(!(parent instanceof View) && parent != null) {
+ parent = parent.eContainer();
+ }
+
+ if(parent != null) {
+ return (View)parent;
+ }
+
+ return null;
+ }
+
+
+ //////////////////////////////////////////
+ // Forwards accesses to CSS properties //
+ //////////////////////////////////////////
+
+
+ public java.lang.Boolean getCSSAntiAlias() {
+ java.lang.Boolean value = super.getAntiAlias();
+
+ if(ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getImageStyle_AntiAlias(), value)) {
+ return value;
+ } else {
+ return getImageBufferStyle().getCSSAntiAlias();
+ }
+ }
+
+ public java.lang.Boolean getCSSMaintainAspectRatio() {
+ java.lang.Boolean value = super.getMaintainAspectRatio();
+
+ if(ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getImageStyle_MaintainAspectRatio(), value)) {
+ return value;
+ } else {
+ return getImageBufferStyle().getCSSMaintainAspectRatio();
+ }
+ }
+
+
+ @Override
+ public java.lang.Boolean getAntiAlias() {
+ //return super.getAntiAlias();
+ return getCSSAntiAlias();
+ }
+
+ @Override
+ public java.lang.Boolean getMaintainAspectRatio() {
+ //return super.getMaintainAspectRatio();
+ return getCSSMaintainAspectRatio();
+ }
+
+
+
+ ////////////////////////////////////////////////
+ // Implements a setter for each CSS property //
+ ////////////////////////////////////////////////
+
+ @Override
+ public void setAntiAlias(java.lang.Boolean value) {
+ super.setAntiAlias(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getImageStyle_AntiAlias();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setMaintainAspectRatio(java.lang.Boolean value) {
+ super.setMaintainAspectRatio(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getImageStyle_MaintainAspectRatio();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ //////////////////////////////////
+ // Implements the unset method //
+ //////////////////////////////////
+
+ @Override
+ public void eUnset(int featureId) {
+ super.eUnset(featureId);
+
+ EStructuralFeature feature = eDynamicFeature(featureId);
+ ForceValueHelper.unsetValue(findView(), feature);
+ }
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSImageStyleImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSImageStyleImpl.java
new file mode 100644
index 00000000000..d59406785ac
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSImageStyleImpl.java
@@ -0,0 +1,132 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.runtime.notation.impl.ImageStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.ForceValueHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSImageStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.impl.CSSImageStyleDelegate;
+
+public class CSSImageStyleImpl extends ImageStyleImpl implements CSSImageStyle {
+
+ protected ExtendedCSSEngine engine;
+
+ private CSSImageStyle imageStyle;
+
+ protected CSSImageStyle getImageStyle() {
+ if(imageStyle == null) {
+ imageStyle = new CSSImageStyleDelegate(this, getEngine());
+ }
+ return imageStyle;
+ }
+
+ protected ExtendedCSSEngine getEngine(){
+ if (engine == null){
+ engine = ((CSSDiagramImpl)findView().getDiagram()).getEngine();
+ }
+ return engine;
+ }
+
+ protected View findView(){
+ EObject parent = eContainer();
+ while (! (parent instanceof View) && parent != null){
+ parent = parent.eContainer();
+ }
+
+ if (parent != null){
+ return (View)parent;
+ }
+
+ return null;
+ }
+
+
+ //////////////////////////////////////////
+ // Forwards accesses to CSS properties //
+ //////////////////////////////////////////
+
+
+ public java.lang.Boolean getCSSAntiAlias(){
+ java.lang.Boolean value = super.getAntiAlias();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getImageStyle_AntiAlias(), value)){
+ return value;
+ } else {
+ return getImageStyle().getCSSAntiAlias();
+ }
+ }
+
+ public java.lang.Boolean getCSSMaintainAspectRatio(){
+ java.lang.Boolean value = super.getMaintainAspectRatio();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getImageStyle_MaintainAspectRatio(), value)){
+ return value;
+ } else {
+ return getImageStyle().getCSSMaintainAspectRatio();
+ }
+ }
+
+
+ @Override
+ public java.lang.Boolean getAntiAlias(){
+ //return super.getAntiAlias();
+ return getCSSAntiAlias();
+ }
+
+ @Override
+ public java.lang.Boolean getMaintainAspectRatio(){
+ //return super.getMaintainAspectRatio();
+ return getCSSMaintainAspectRatio();
+ }
+
+
+
+ ////////////////////////////////////////////////
+ // Implements a setter for each CSS property //
+ ////////////////////////////////////////////////
+
+ @Override
+ public void setAntiAlias(java.lang.Boolean value){
+ super.setAntiAlias(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getImageStyle_AntiAlias();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setMaintainAspectRatio(java.lang.Boolean value){
+ super.setMaintainAspectRatio(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getImageStyle_MaintainAspectRatio();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ //////////////////////////////////
+ // Implements the unset method //
+ //////////////////////////////////
+
+ @Override
+ public void eUnset(int featureId) {
+ super.eUnset(featureId);
+
+ EStructuralFeature feature = eDynamicFeature(featureId);
+ ForceValueHelper.unsetValue(findView(), feature);
+ }
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSLineStyleImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSLineStyleImpl.java
new file mode 100644
index 00000000000..2e10f5acf27
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSLineStyleImpl.java
@@ -0,0 +1,132 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.runtime.notation.impl.LineStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.ForceValueHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSLineStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.impl.CSSLineStyleDelegate;
+
+public class CSSLineStyleImpl extends LineStyleImpl implements CSSLineStyle {
+
+ protected ExtendedCSSEngine engine;
+
+ private CSSLineStyle lineStyle;
+
+ protected CSSLineStyle getLineStyle() {
+ if(lineStyle == null) {
+ lineStyle = new CSSLineStyleDelegate(this, getEngine());
+ }
+ return lineStyle;
+ }
+
+ protected ExtendedCSSEngine getEngine(){
+ if (engine == null){
+ engine = ((CSSDiagramImpl)findView().getDiagram()).getEngine();
+ }
+ return engine;
+ }
+
+ protected View findView(){
+ EObject parent = eContainer();
+ while (! (parent instanceof View) && parent != null){
+ parent = parent.eContainer();
+ }
+
+ if (parent != null){
+ return (View)parent;
+ }
+
+ return null;
+ }
+
+
+ //////////////////////////////////////////
+ // Forwards accesses to CSS properties //
+ //////////////////////////////////////////
+
+
+ public int getCSSLineColor(){
+ int value = super.getLineColor();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getLineStyle_LineColor(), value)){
+ return value;
+ } else {
+ return getLineStyle().getCSSLineColor();
+ }
+ }
+
+ public int getCSSLineWidth(){
+ int value = super.getLineWidth();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getLineStyle_LineWidth(), value)){
+ return value;
+ } else {
+ return getLineStyle().getCSSLineWidth();
+ }
+ }
+
+
+ @Override
+ public int getLineColor(){
+ //return super.getLineColor();
+ return getCSSLineColor();
+ }
+
+ @Override
+ public int getLineWidth(){
+ //return super.getLineWidth();
+ return getCSSLineWidth();
+ }
+
+
+
+ ////////////////////////////////////////////////
+ // Implements a setter for each CSS property //
+ ////////////////////////////////////////////////
+
+ @Override
+ public void setLineColor(int value){
+ super.setLineColor(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getLineStyle_LineColor();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setLineWidth(int value){
+ super.setLineWidth(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getLineStyle_LineWidth();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ //////////////////////////////////
+ // Implements the unset method //
+ //////////////////////////////////
+
+ @Override
+ public void eUnset(int featureId) {
+ super.eUnset(featureId);
+
+ EStructuralFeature feature = eDynamicFeature(featureId);
+ ForceValueHelper.unsetValue(findView(), feature);
+ }
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSLineTypeStyleImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSLineTypeStyleImpl.java
new file mode 100644
index 00000000000..48bfda1962e
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSLineTypeStyleImpl.java
@@ -0,0 +1,109 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.notation.LineType;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.runtime.notation.impl.LineTypeStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.ForceValueHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSLineTypeStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.impl.CSSLineTypeStyleDelegate;
+
+public class CSSLineTypeStyleImpl extends LineTypeStyleImpl implements CSSLineTypeStyle {
+
+ protected ExtendedCSSEngine engine;
+
+ private CSSLineTypeStyle lineTypeStyle;
+
+ protected CSSLineTypeStyle getLineTypeStyle() {
+ if(lineTypeStyle == null) {
+ lineTypeStyle = new CSSLineTypeStyleDelegate(this, getEngine());
+ }
+ return lineTypeStyle;
+ }
+
+ protected ExtendedCSSEngine getEngine(){
+ if (engine == null){
+ engine = ((CSSDiagramImpl)findView().getDiagram()).getEngine();
+ }
+ return engine;
+ }
+
+ protected View findView(){
+ EObject parent = eContainer();
+ while (! (parent instanceof View) && parent != null){
+ parent = parent.eContainer();
+ }
+
+ if (parent != null){
+ return (View)parent;
+ }
+
+ return null;
+ }
+
+
+ //////////////////////////////////////////
+ // Forwards accesses to CSS properties //
+ //////////////////////////////////////////
+
+
+ public LineType getCSSLineType(){
+ LineType value = super.getLineType();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getLineTypeStyle_LineType(), value)){
+ return value;
+ } else {
+ return getLineTypeStyle().getCSSLineType();
+ }
+ }
+
+
+ @Override
+ public LineType getLineType(){
+ //return super.getLineType();
+ return getCSSLineType();
+ }
+
+
+
+ ////////////////////////////////////////////////
+ // Implements a setter for each CSS property //
+ ////////////////////////////////////////////////
+
+ @Override
+ public void setLineType(LineType value){
+ super.setLineType(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getLineTypeStyle_LineType();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ //////////////////////////////////
+ // Implements the unset method //
+ //////////////////////////////////
+
+ @Override
+ public void eUnset(int featureId) {
+ super.eUnset(featureId);
+
+ EStructuralFeature feature = eDynamicFeature(featureId);
+ ForceValueHelper.unsetValue(findView(), feature);
+ }
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSListCompartmentImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSListCompartmentImpl.java
new file mode 100644
index 00000000000..da75d161e63
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSListCompartmentImpl.java
@@ -0,0 +1,159 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.notation.Filtering;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.Sorting;
+import org.eclipse.gmf.runtime.notation.impl.ListCompartmentImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.ForceValueHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSDrawerStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.impl.CSSDrawerStyleDelegate;
+
+public class CSSListCompartmentImpl extends ListCompartmentImpl implements CSSDrawerStyle {
+
+ protected ExtendedCSSEngine engine;
+
+ private CSSDrawerStyle drawerStyle;
+
+ protected CSSDrawerStyle getDrawerStyle() {
+ if(drawerStyle == null) {
+ drawerStyle = new CSSDrawerStyleDelegate(this, getEngine());
+ }
+ return drawerStyle;
+ }
+
+ protected ExtendedCSSEngine getEngine() {
+ if(engine == null) {
+ engine = ((CSSDiagramImpl)getDiagram()).getEngine();
+ }
+ return engine;
+ }
+
+
+ //////////////////////////////////////////
+ // Forwards accesses to CSS properties //
+ //////////////////////////////////////////
+
+
+ public boolean isCSSCollapsed(){
+ boolean value = super.isCollapsed();
+
+ if (ForceValueHelper.isSet(this, NotationPackage.eINSTANCE.getDrawerStyle_Collapsed(), value)){
+ return value;
+ } else {
+ return getDrawerStyle().isCSSCollapsed();
+ }
+ }
+
+
+ @Override
+ public boolean isCollapsed(){
+ //return super.isCollapsed();
+ return isCSSCollapsed();
+ }
+
+
+
+ ////////////////////////////////////////////////
+ // Implements a setter for each CSS property //
+ ////////////////////////////////////////////////
+
+ @Override
+ public void setVisible(boolean value){
+ super.setVisible(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getView_Visible();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setType(java.lang.String value){
+ super.setType(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getView_Type();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setMutable(boolean value){
+ super.setMutable(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getView_Mutable();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setCollapsed(boolean value){
+ super.setCollapsed(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getDrawerStyle_Collapsed();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setSorting(Sorting value){
+ super.setSorting(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getSortingStyle_Sorting();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setSortingKeys(java.util.Map value){
+ super.setSortingKeys(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getSortingStyle_SortingKeys();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setFiltering(Filtering value){
+ super.setFiltering(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getFilteringStyle_Filtering();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setFilteringKeys(java.util.List value){
+ super.setFilteringKeys(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getFilteringStyle_FilteringKeys();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setShowTitle(boolean value){
+ super.setShowTitle(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getTitleStyle_ShowTitle();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ //////////////////////////////////
+ // Implements the unset method //
+ //////////////////////////////////
+
+ @Override
+ public void eUnset(int featureId) {
+ super.eUnset(featureId);
+
+ EStructuralFeature feature = eDynamicFeature(featureId);
+ ForceValueHelper.unsetValue(this, feature);
+ }
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSMultiDiagramLinkStyleImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSMultiDiagramLinkStyleImpl.java
new file mode 100644
index 00000000000..54d34c70817
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSMultiDiagramLinkStyleImpl.java
@@ -0,0 +1,86 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.runtime.notation.impl.MultiDiagramLinkStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.ForceValueHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSMultiDiagramLinkStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.impl.CSSMultiDiagramLinkStyleDelegate;
+
+public class CSSMultiDiagramLinkStyleImpl extends MultiDiagramLinkStyleImpl implements CSSMultiDiagramLinkStyle {
+
+ protected ExtendedCSSEngine engine;
+
+ private CSSMultiDiagramLinkStyle multiDiagramLinkStyle;
+
+ protected CSSMultiDiagramLinkStyle getMultiDiagramLinkStyle() {
+ if(multiDiagramLinkStyle == null) {
+ multiDiagramLinkStyle = new CSSMultiDiagramLinkStyleDelegate(this, getEngine());
+ }
+ return multiDiagramLinkStyle;
+ }
+
+ protected ExtendedCSSEngine getEngine(){
+ if (engine == null){
+ engine = ((CSSDiagramImpl)findView().getDiagram()).getEngine();
+ }
+ return engine;
+ }
+
+ protected View findView(){
+ EObject parent = eContainer();
+ while (! (parent instanceof View) && parent != null){
+ parent = parent.eContainer();
+ }
+
+ if (parent != null){
+ return (View)parent;
+ }
+
+ return null;
+ }
+
+
+ //////////////////////////////////////////
+ // Forwards accesses to CSS properties //
+ //////////////////////////////////////////
+
+
+
+
+
+
+
+ ////////////////////////////////////////////////
+ // Implements a setter for each CSS property //
+ ////////////////////////////////////////////////
+
+
+ //////////////////////////////////
+ // Implements the unset method //
+ //////////////////////////////////
+
+ @Override
+ public void eUnset(int featureId) {
+ super.eUnset(featureId);
+
+ EStructuralFeature feature = eDynamicFeature(featureId);
+ ForceValueHelper.unsetValue(findView(), feature);
+ }
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSNamedStyleImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSNamedStyleImpl.java
new file mode 100644
index 00000000000..af5233bb769
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSNamedStyleImpl.java
@@ -0,0 +1,108 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.runtime.notation.impl.NamedStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.ForceValueHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSNamedStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.impl.CSSNamedStyleDelegate;
+
+public class CSSNamedStyleImpl extends NamedStyleImpl implements CSSNamedStyle {
+
+ protected ExtendedCSSEngine engine;
+
+ private CSSNamedStyle namedStyle;
+
+ protected CSSNamedStyle getNamedStyle() {
+ if(namedStyle == null) {
+ namedStyle = new CSSNamedStyleDelegate(this, getEngine());
+ }
+ return namedStyle;
+ }
+
+ protected ExtendedCSSEngine getEngine(){
+ if (engine == null){
+ engine = ((CSSDiagramImpl)findView().getDiagram()).getEngine();
+ }
+ return engine;
+ }
+
+ protected View findView(){
+ EObject parent = eContainer();
+ while (! (parent instanceof View) && parent != null){
+ parent = parent.eContainer();
+ }
+
+ if (parent != null){
+ return (View)parent;
+ }
+
+ return null;
+ }
+
+
+ //////////////////////////////////////////
+ // Forwards accesses to CSS properties //
+ //////////////////////////////////////////
+
+
+ public java.lang.String getCSSName(){
+ java.lang.String value = super.getName();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getNamedStyle_Name(), value)){
+ return value;
+ } else {
+ return getNamedStyle().getCSSName();
+ }
+ }
+
+
+ @Override
+ public java.lang.String getName(){
+ //return super.getName();
+ return getCSSName();
+ }
+
+
+
+ ////////////////////////////////////////////////
+ // Implements a setter for each CSS property //
+ ////////////////////////////////////////////////
+
+ @Override
+ public void setName(java.lang.String value){
+ super.setName(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getNamedStyle_Name();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ //////////////////////////////////
+ // Implements the unset method //
+ //////////////////////////////////
+
+ @Override
+ public void eUnset(int featureId) {
+ super.eUnset(featureId);
+
+ EStructuralFeature feature = eDynamicFeature(featureId);
+ ForceValueHelper.unsetValue(findView(), feature);
+ }
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSPageStyleImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSPageStyleImpl.java
new file mode 100644
index 00000000000..afcaa0c748b
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSPageStyleImpl.java
@@ -0,0 +1,180 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.runtime.notation.impl.PageStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.ForceValueHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSPageStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.impl.CSSPageStyleDelegate;
+
+public class CSSPageStyleImpl extends PageStyleImpl implements CSSPageStyle {
+
+ protected ExtendedCSSEngine engine;
+
+ private CSSPageStyle pageStyle;
+
+ protected CSSPageStyle getPageStyle() {
+ if(pageStyle == null) {
+ pageStyle = new CSSPageStyleDelegate(this, getEngine());
+ }
+ return pageStyle;
+ }
+
+ protected ExtendedCSSEngine getEngine(){
+ if (engine == null){
+ engine = ((CSSDiagramImpl)findView().getDiagram()).getEngine();
+ }
+ return engine;
+ }
+
+ protected View findView(){
+ EObject parent = eContainer();
+ while (! (parent instanceof View) && parent != null){
+ parent = parent.eContainer();
+ }
+
+ if (parent != null){
+ return (View)parent;
+ }
+
+ return null;
+ }
+
+
+ //////////////////////////////////////////
+ // Forwards accesses to CSS properties //
+ //////////////////////////////////////////
+
+
+ public int getCSSPageX(){
+ int value = super.getPageX();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getPageStyle_PageX(), value)){
+ return value;
+ } else {
+ return getPageStyle().getCSSPageX();
+ }
+ }
+
+ public int getCSSPageY(){
+ int value = super.getPageY();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getPageStyle_PageY(), value)){
+ return value;
+ } else {
+ return getPageStyle().getCSSPageY();
+ }
+ }
+
+ public int getCSSPageWidth(){
+ int value = super.getPageWidth();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getPageStyle_PageWidth(), value)){
+ return value;
+ } else {
+ return getPageStyle().getCSSPageWidth();
+ }
+ }
+
+ public int getCSSPageHeight(){
+ int value = super.getPageHeight();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getPageStyle_PageHeight(), value)){
+ return value;
+ } else {
+ return getPageStyle().getCSSPageHeight();
+ }
+ }
+
+
+ @Override
+ public int getPageX(){
+ //return super.getPageX();
+ return getCSSPageX();
+ }
+
+ @Override
+ public int getPageY(){
+ //return super.getPageY();
+ return getCSSPageY();
+ }
+
+ @Override
+ public int getPageWidth(){
+ //return super.getPageWidth();
+ return getCSSPageWidth();
+ }
+
+ @Override
+ public int getPageHeight(){
+ //return super.getPageHeight();
+ return getCSSPageHeight();
+ }
+
+
+
+ ////////////////////////////////////////////////
+ // Implements a setter for each CSS property //
+ ////////////////////////////////////////////////
+
+ @Override
+ public void setPageX(int value){
+ super.setPageX(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getPageStyle_PageX();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setPageY(int value){
+ super.setPageY(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getPageStyle_PageY();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setPageWidth(int value){
+ super.setPageWidth(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getPageStyle_PageWidth();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setPageHeight(int value){
+ super.setPageHeight(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getPageStyle_PageHeight();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ //////////////////////////////////
+ // Implements the unset method //
+ //////////////////////////////////
+
+ @Override
+ public void eUnset(int featureId) {
+ super.eUnset(featureId);
+
+ EStructuralFeature feature = eDynamicFeature(featureId);
+ ForceValueHelper.unsetValue(findView(), feature);
+ }
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSPropertiesSetStyleImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSPropertiesSetStyleImpl.java
new file mode 100644
index 00000000000..30ffdecd8b1
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSPropertiesSetStyleImpl.java
@@ -0,0 +1,108 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.runtime.notation.impl.PropertiesSetStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.ForceValueHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSPropertiesSetStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.impl.CSSPropertiesSetStyleDelegate;
+
+public class CSSPropertiesSetStyleImpl extends PropertiesSetStyleImpl implements CSSPropertiesSetStyle {
+
+ protected ExtendedCSSEngine engine;
+
+ private CSSPropertiesSetStyle propertiesSetStyle;
+
+ protected CSSPropertiesSetStyle getPropertiesSetStyle() {
+ if(propertiesSetStyle == null) {
+ propertiesSetStyle = new CSSPropertiesSetStyleDelegate(this, getEngine());
+ }
+ return propertiesSetStyle;
+ }
+
+ protected ExtendedCSSEngine getEngine(){
+ if (engine == null){
+ engine = ((CSSDiagramImpl)findView().getDiagram()).getEngine();
+ }
+ return engine;
+ }
+
+ protected View findView(){
+ EObject parent = eContainer();
+ while (! (parent instanceof View) && parent != null){
+ parent = parent.eContainer();
+ }
+
+ if (parent != null){
+ return (View)parent;
+ }
+
+ return null;
+ }
+
+
+ //////////////////////////////////////////
+ // Forwards accesses to CSS properties //
+ //////////////////////////////////////////
+
+
+ public java.lang.String getCSSName(){
+ java.lang.String value = super.getName();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getNamedStyle_Name(), value)){
+ return value;
+ } else {
+ return getPropertiesSetStyle().getCSSName();
+ }
+ }
+
+
+ @Override
+ public java.lang.String getName(){
+ //return super.getName();
+ return getCSSName();
+ }
+
+
+
+ ////////////////////////////////////////////////
+ // Implements a setter for each CSS property //
+ ////////////////////////////////////////////////
+
+ @Override
+ public void setName(java.lang.String value){
+ super.setName(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getNamedStyle_Name();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ //////////////////////////////////
+ // Implements the unset method //
+ //////////////////////////////////
+
+ @Override
+ public void eUnset(int featureId) {
+ super.eUnset(featureId);
+
+ EStructuralFeature feature = eDynamicFeature(featureId);
+ ForceValueHelper.unsetValue(findView(), feature);
+ }
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSRoundedCornersStyleImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSRoundedCornersStyleImpl.java
new file mode 100644
index 00000000000..a7d930c6235
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSRoundedCornersStyleImpl.java
@@ -0,0 +1,108 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.runtime.notation.impl.RoundedCornersStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.ForceValueHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSRoundedCornersStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.impl.CSSRoundedCornersStyleDelegate;
+
+public class CSSRoundedCornersStyleImpl extends RoundedCornersStyleImpl implements CSSRoundedCornersStyle {
+
+ protected ExtendedCSSEngine engine;
+
+ private CSSRoundedCornersStyle roundedCornersStyle;
+
+ protected CSSRoundedCornersStyle getRoundedCornersStyle() {
+ if(roundedCornersStyle == null) {
+ roundedCornersStyle = new CSSRoundedCornersStyleDelegate(this, getEngine());
+ }
+ return roundedCornersStyle;
+ }
+
+ protected ExtendedCSSEngine getEngine(){
+ if (engine == null){
+ engine = ((CSSDiagramImpl)findView().getDiagram()).getEngine();
+ }
+ return engine;
+ }
+
+ protected View findView(){
+ EObject parent = eContainer();
+ while (! (parent instanceof View) && parent != null){
+ parent = parent.eContainer();
+ }
+
+ if (parent != null){
+ return (View)parent;
+ }
+
+ return null;
+ }
+
+
+ //////////////////////////////////////////
+ // Forwards accesses to CSS properties //
+ //////////////////////////////////////////
+
+
+ public int getCSSRoundedBendpointsRadius(){
+ int value = super.getRoundedBendpointsRadius();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getRoundedCornersStyle_RoundedBendpointsRadius(), value)){
+ return value;
+ } else {
+ return getRoundedCornersStyle().getCSSRoundedBendpointsRadius();
+ }
+ }
+
+
+ @Override
+ public int getRoundedBendpointsRadius(){
+ //return super.getRoundedBendpointsRadius();
+ return getCSSRoundedBendpointsRadius();
+ }
+
+
+
+ ////////////////////////////////////////////////
+ // Implements a setter for each CSS property //
+ ////////////////////////////////////////////////
+
+ @Override
+ public void setRoundedBendpointsRadius(int value){
+ super.setRoundedBendpointsRadius(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getRoundedCornersStyle_RoundedBendpointsRadius();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ //////////////////////////////////
+ // Implements the unset method //
+ //////////////////////////////////
+
+ @Override
+ public void eUnset(int featureId) {
+ super.eUnset(featureId);
+
+ EStructuralFeature feature = eDynamicFeature(featureId);
+ ForceValueHelper.unsetValue(findView(), feature);
+ }
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSRoutingStyleImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSRoutingStyleImpl.java
new file mode 100644
index 00000000000..e97e9da0f62
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSRoutingStyleImpl.java
@@ -0,0 +1,280 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.notation.JumpLinkStatus;
+import org.eclipse.gmf.runtime.notation.JumpLinkType;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.Routing;
+import org.eclipse.gmf.runtime.notation.Smoothness;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.runtime.notation.impl.RoutingStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.ForceValueHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSRoutingStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.impl.CSSRoutingStyleDelegate;
+
+public class CSSRoutingStyleImpl extends RoutingStyleImpl implements CSSRoutingStyle {
+
+ protected ExtendedCSSEngine engine;
+
+ private CSSRoutingStyle routingStyle;
+
+ protected CSSRoutingStyle getRoutingStyle() {
+ if(routingStyle == null) {
+ routingStyle = new CSSRoutingStyleDelegate(this, getEngine());
+ }
+ return routingStyle;
+ }
+
+ protected ExtendedCSSEngine getEngine(){
+ if (engine == null){
+ engine = ((CSSDiagramImpl)findView().getDiagram()).getEngine();
+ }
+ return engine;
+ }
+
+ protected View findView(){
+ EObject parent = eContainer();
+ while (! (parent instanceof View) && parent != null){
+ parent = parent.eContainer();
+ }
+
+ if (parent != null){
+ return (View)parent;
+ }
+
+ return null;
+ }
+
+
+ //////////////////////////////////////////
+ // Forwards accesses to CSS properties //
+ //////////////////////////////////////////
+
+
+ public int getCSSRoundedBendpointsRadius(){
+ int value = super.getRoundedBendpointsRadius();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getRoundedCornersStyle_RoundedBendpointsRadius(), value)){
+ return value;
+ } else {
+ return getRoutingStyle().getCSSRoundedBendpointsRadius();
+ }
+ }
+
+ public Routing getCSSRouting(){
+ Routing value = super.getRouting();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), value)){
+ return value;
+ } else {
+ return getRoutingStyle().getCSSRouting();
+ }
+ }
+
+ public Smoothness getCSSSmoothness(){
+ Smoothness value = super.getSmoothness();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getRoutingStyle_Smoothness(), value)){
+ return value;
+ } else {
+ return getRoutingStyle().getCSSSmoothness();
+ }
+ }
+
+ public boolean isCSSAvoidObstructions(){
+ boolean value = super.isAvoidObstructions();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getRoutingStyle_AvoidObstructions(), value)){
+ return value;
+ } else {
+ return getRoutingStyle().isCSSAvoidObstructions();
+ }
+ }
+
+ public boolean isCSSClosestDistance(){
+ boolean value = super.isClosestDistance();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getRoutingStyle_ClosestDistance(), value)){
+ return value;
+ } else {
+ return getRoutingStyle().isCSSClosestDistance();
+ }
+ }
+
+ public JumpLinkStatus getCSSJumpLinkStatus(){
+ JumpLinkStatus value = super.getJumpLinkStatus();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getRoutingStyle_JumpLinkStatus(), value)){
+ return value;
+ } else {
+ return getRoutingStyle().getCSSJumpLinkStatus();
+ }
+ }
+
+ public JumpLinkType getCSSJumpLinkType(){
+ JumpLinkType value = super.getJumpLinkType();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getRoutingStyle_JumpLinkType(), value)){
+ return value;
+ } else {
+ return getRoutingStyle().getCSSJumpLinkType();
+ }
+ }
+
+ public boolean isCSSJumpLinksReverse(){
+ boolean value = super.isJumpLinksReverse();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getRoutingStyle_JumpLinksReverse(), value)){
+ return value;
+ } else {
+ return getRoutingStyle().isCSSJumpLinksReverse();
+ }
+ }
+
+
+ @Override
+ public int getRoundedBendpointsRadius(){
+ //return super.getRoundedBendpointsRadius();
+ return getCSSRoundedBendpointsRadius();
+ }
+
+ @Override
+ public Routing getRouting(){
+ //return super.getRouting();
+ return getCSSRouting();
+ }
+
+ @Override
+ public Smoothness getSmoothness(){
+ //return super.getSmoothness();
+ return getCSSSmoothness();
+ }
+
+ @Override
+ public boolean isAvoidObstructions(){
+ //return super.isAvoidObstructions();
+ return isCSSAvoidObstructions();
+ }
+
+ @Override
+ public boolean isClosestDistance(){
+ //return super.isClosestDistance();
+ return isCSSClosestDistance();
+ }
+
+ @Override
+ public JumpLinkStatus getJumpLinkStatus(){
+ //return super.getJumpLinkStatus();
+ return getCSSJumpLinkStatus();
+ }
+
+ @Override
+ public JumpLinkType getJumpLinkType(){
+ //return super.getJumpLinkType();
+ return getCSSJumpLinkType();
+ }
+
+ @Override
+ public boolean isJumpLinksReverse(){
+ //return super.isJumpLinksReverse();
+ return isCSSJumpLinksReverse();
+ }
+
+
+
+ ////////////////////////////////////////////////
+ // Implements a setter for each CSS property //
+ ////////////////////////////////////////////////
+
+ @Override
+ public void setRoundedBendpointsRadius(int value){
+ super.setRoundedBendpointsRadius(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getRoundedCornersStyle_RoundedBendpointsRadius();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setRouting(Routing value){
+ super.setRouting(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getRoutingStyle_Routing();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setSmoothness(Smoothness value){
+ super.setSmoothness(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getRoutingStyle_Smoothness();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setAvoidObstructions(boolean value){
+ super.setAvoidObstructions(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getRoutingStyle_AvoidObstructions();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setClosestDistance(boolean value){
+ super.setClosestDistance(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getRoutingStyle_ClosestDistance();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setJumpLinkStatus(JumpLinkStatus value){
+ super.setJumpLinkStatus(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getRoutingStyle_JumpLinkStatus();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setJumpLinkType(JumpLinkType value){
+ super.setJumpLinkType(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getRoutingStyle_JumpLinkType();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setJumpLinksReverse(boolean value){
+ super.setJumpLinksReverse(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getRoutingStyle_JumpLinksReverse();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ //////////////////////////////////
+ // Implements the unset method //
+ //////////////////////////////////
+
+ @Override
+ public void eUnset(int featureId) {
+ super.eUnset(featureId);
+
+ EStructuralFeature feature = eDynamicFeature(featureId);
+ ForceValueHelper.unsetValue(findView(), feature);
+ }
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSSemanticListCompartmentImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSSemanticListCompartmentImpl.java
new file mode 100644
index 00000000000..132c94b14de
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSSemanticListCompartmentImpl.java
@@ -0,0 +1,159 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.notation.Filtering;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.Sorting;
+import org.eclipse.gmf.runtime.notation.impl.SemanticListCompartmentImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.ForceValueHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSDrawerStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.impl.CSSDrawerStyleDelegate;
+
+public class CSSSemanticListCompartmentImpl extends SemanticListCompartmentImpl implements CSSDrawerStyle {
+
+ protected ExtendedCSSEngine engine;
+
+ private CSSDrawerStyle drawerStyle;
+
+ protected CSSDrawerStyle getDrawerStyle() {
+ if(drawerStyle == null) {
+ drawerStyle = new CSSDrawerStyleDelegate(this, getEngine());
+ }
+ return drawerStyle;
+ }
+
+ protected ExtendedCSSEngine getEngine() {
+ if(engine == null) {
+ engine = ((CSSDiagramImpl)getDiagram()).getEngine();
+ }
+ return engine;
+ }
+
+
+ //////////////////////////////////////////
+ // Forwards accesses to CSS properties //
+ //////////////////////////////////////////
+
+
+ public boolean isCSSCollapsed(){
+ boolean value = super.isCollapsed();
+
+ if (ForceValueHelper.isSet(this, NotationPackage.eINSTANCE.getDrawerStyle_Collapsed(), value)){
+ return value;
+ } else {
+ return getDrawerStyle().isCSSCollapsed();
+ }
+ }
+
+
+ @Override
+ public boolean isCollapsed(){
+ //return super.isCollapsed();
+ return isCSSCollapsed();
+ }
+
+
+
+ ////////////////////////////////////////////////
+ // Implements a setter for each CSS property //
+ ////////////////////////////////////////////////
+
+ @Override
+ public void setVisible(boolean value){
+ super.setVisible(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getView_Visible();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setType(java.lang.String value){
+ super.setType(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getView_Type();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setMutable(boolean value){
+ super.setMutable(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getView_Mutable();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setCollapsed(boolean value){
+ super.setCollapsed(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getDrawerStyle_Collapsed();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setSorting(Sorting value){
+ super.setSorting(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getSortingStyle_Sorting();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setSortingKeys(java.util.Map value){
+ super.setSortingKeys(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getSortingStyle_SortingKeys();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setFiltering(Filtering value){
+ super.setFiltering(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getFilteringStyle_Filtering();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setFilteringKeys(java.util.List value){
+ super.setFilteringKeys(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getFilteringStyle_FilteringKeys();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setShowTitle(boolean value){
+ super.setShowTitle(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getTitleStyle_ShowTitle();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ //////////////////////////////////
+ // Implements the unset method //
+ //////////////////////////////////
+
+ @Override
+ public void eUnset(int featureId) {
+ super.eUnset(featureId);
+
+ EStructuralFeature feature = eDynamicFeature(featureId);
+ ForceValueHelper.unsetValue(this, feature);
+ }
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSShapeImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSShapeImpl.java
new file mode 100644
index 00000000000..28fe6143d1d
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSShapeImpl.java
@@ -0,0 +1,454 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.impl.ShapeImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.ForceValueHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.provider.CSSCustomStyleDelegate;
+import org.eclipse.papyrus.infra.gmfdiag.css.provider.CustomStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSShapeStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.impl.CSSShapeStyleDelegate;
+
+public class CSSShapeImpl extends ShapeImpl implements CSSShapeStyle, CustomStyle {
+
+ protected ExtendedCSSEngine engine;
+
+ private CSSShapeStyle shapeStyle;
+
+ private CustomStyle customStyle;
+
+ protected CSSShapeStyle getShapeStyle() {
+ if(shapeStyle == null) {
+ shapeStyle = new CSSShapeStyleDelegate(this, getEngine());
+ }
+ return shapeStyle;
+ }
+
+ protected CustomStyle getCustomStyle() {
+ if(customStyle == null) {
+ customStyle = new CSSCustomStyleDelegate(this, getEngine());
+ }
+ return customStyle;
+ }
+
+ protected ExtendedCSSEngine getEngine() {
+ if(engine == null) {
+ engine = ((CSSDiagramImpl)getDiagram()).getEngine();
+ }
+ return engine;
+ }
+
+
+ //////////////////////////////////////////
+ // Forwards accesses to CSS properties //
+ //////////////////////////////////////////
+
+
+ public int getCSSFontColor() {
+ int value = super.getFontColor();
+
+ if(ForceValueHelper.isSet(this, NotationPackage.eINSTANCE.getFontStyle_FontColor(), value)) {
+ return value;
+ } else {
+ return getShapeStyle().getCSSFontColor();
+ }
+ }
+
+ public java.lang.String getCSSFontName() {
+ java.lang.String value = super.getFontName();
+
+ if(ForceValueHelper.isSet(this, NotationPackage.eINSTANCE.getFontStyle_FontName(), value)) {
+ return value;
+ } else {
+ return getShapeStyle().getCSSFontName();
+ }
+ }
+
+ public int getCSSFontHeight() {
+ int value = super.getFontHeight();
+
+ if(ForceValueHelper.isSet(this, NotationPackage.eINSTANCE.getFontStyle_FontHeight(), value)) {
+ return value;
+ } else {
+ return getShapeStyle().getCSSFontHeight();
+ }
+ }
+
+ public boolean isCSSBold() {
+ boolean value = super.isBold();
+
+ if(ForceValueHelper.isSet(this, NotationPackage.eINSTANCE.getFontStyle_Bold(), value)) {
+ return value;
+ } else {
+ return getShapeStyle().isCSSBold();
+ }
+ }
+
+ public boolean isCSSItalic() {
+ boolean value = super.isItalic();
+
+ if(ForceValueHelper.isSet(this, NotationPackage.eINSTANCE.getFontStyle_Italic(), value)) {
+ return value;
+ } else {
+ return getShapeStyle().isCSSItalic();
+ }
+ }
+
+ public boolean isCSSUnderline() {
+ boolean value = super.isUnderline();
+
+ if(ForceValueHelper.isSet(this, NotationPackage.eINSTANCE.getFontStyle_Underline(), value)) {
+ return value;
+ } else {
+ return getShapeStyle().isCSSUnderline();
+ }
+ }
+
+ public boolean isCSSStrikeThrough() {
+ boolean value = super.isStrikeThrough();
+
+ if(ForceValueHelper.isSet(this, NotationPackage.eINSTANCE.getFontStyle_StrikeThrough(), value)) {
+ return value;
+ } else {
+ return getShapeStyle().isCSSStrikeThrough();
+ }
+ }
+
+ public java.lang.String getCSSDescription() {
+ java.lang.String value = super.getDescription();
+
+ if(ForceValueHelper.isSet(this, NotationPackage.eINSTANCE.getDescriptionStyle_Description(), value)) {
+ return value;
+ } else {
+ return getShapeStyle().getCSSDescription();
+ }
+ }
+
+ public int getCSSFillColor() {
+ int value = super.getFillColor();
+
+ if(ForceValueHelper.isSet(this, NotationPackage.eINSTANCE.getFillStyle_FillColor(), value)) {
+ return value;
+ } else {
+ return getShapeStyle().getCSSFillColor();
+ }
+ }
+
+ public int getCSSTransparency() {
+ int value = super.getTransparency();
+
+ if(ForceValueHelper.isSet(this, NotationPackage.eINSTANCE.getFillStyle_Transparency(), value)) {
+ return value;
+ } else {
+ return getShapeStyle().getCSSTransparency();
+ }
+ }
+
+ public org.eclipse.gmf.runtime.notation.datatype.GradientData getCSSGradient() {
+ org.eclipse.gmf.runtime.notation.datatype.GradientData value = super.getGradient();
+
+ if(ForceValueHelper.isSet(this, NotationPackage.eINSTANCE.getFillStyle_Gradient(), value)) {
+ return value;
+ } else {
+ return getShapeStyle().getCSSGradient();
+ }
+ }
+
+ public int getCSSLineColor() {
+ int value = super.getLineColor();
+
+ if(ForceValueHelper.isSet(this, NotationPackage.eINSTANCE.getLineStyle_LineColor(), value)) {
+ return value;
+ } else {
+ return getShapeStyle().getCSSLineColor();
+ }
+ }
+
+ public int getCSSLineWidth() {
+ int value = super.getLineWidth();
+
+ if(ForceValueHelper.isSet(this, NotationPackage.eINSTANCE.getLineStyle_LineWidth(), value)) {
+ return value;
+ } else {
+ return getShapeStyle().getCSSLineWidth();
+ }
+ }
+
+ public int getCSSRoundedBendpointsRadius() {
+ int value = super.getRoundedBendpointsRadius();
+
+ if(ForceValueHelper.isSet(this, NotationPackage.eINSTANCE.getRoundedCornersStyle_RoundedBendpointsRadius(), value)) {
+ return value;
+ } else {
+ return getShapeStyle().getCSSRoundedBendpointsRadius();
+ }
+ }
+
+
+ @Override
+ public int getFontColor() {
+ //return super.getFontColor();
+ return getCSSFontColor();
+ }
+
+ @Override
+ public java.lang.String getFontName() {
+ //return super.getFontName();
+ return getCSSFontName();
+ }
+
+ @Override
+ public int getFontHeight() {
+ //return super.getFontHeight();
+ return getCSSFontHeight();
+ }
+
+ @Override
+ public boolean isBold() {
+ //return super.isBold();
+ return isCSSBold();
+ }
+
+ @Override
+ public boolean isItalic() {
+ //return super.isItalic();
+ return isCSSItalic();
+ }
+
+ @Override
+ public boolean isUnderline() {
+ //return super.isUnderline();
+ return isCSSUnderline();
+ }
+
+ @Override
+ public boolean isStrikeThrough() {
+ //return super.isStrikeThrough();
+ return isCSSStrikeThrough();
+ }
+
+ @Override
+ public java.lang.String getDescription() {
+ //return super.getDescription();
+ return getCSSDescription();
+ }
+
+ @Override
+ public int getFillColor() {
+ //return super.getFillColor();
+ return getCSSFillColor();
+ }
+
+ @Override
+ public int getTransparency() {
+ //return super.getTransparency();
+ return getCSSTransparency();
+ }
+
+ @Override
+ public org.eclipse.gmf.runtime.notation.datatype.GradientData getGradient() {
+ //return super.getGradient();
+ return getCSSGradient();
+ }
+
+ @Override
+ public int getLineColor() {
+ //return super.getLineColor();
+ return getCSSLineColor();
+ }
+
+ @Override
+ public int getLineWidth() {
+ //return super.getLineWidth();
+ return getCSSLineWidth();
+ }
+
+ @Override
+ public int getRoundedBendpointsRadius() {
+ //return super.getRoundedBendpointsRadius();
+ return getCSSRoundedBendpointsRadius();
+ }
+
+
+
+ ////////////////////////////////////////////////
+ // Implements a setter for each CSS property //
+ ////////////////////////////////////////////////
+
+ @Override
+ public void setVisible(boolean value) {
+ super.setVisible(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getView_Visible();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setType(java.lang.String value) {
+ super.setType(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getView_Type();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setMutable(boolean value) {
+ super.setMutable(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getView_Mutable();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setFontColor(int value) {
+ super.setFontColor(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getFontStyle_FontColor();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setFontName(java.lang.String value) {
+ super.setFontName(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getFontStyle_FontName();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setFontHeight(int value) {
+ super.setFontHeight(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getFontStyle_FontHeight();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setBold(boolean value) {
+ super.setBold(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getFontStyle_Bold();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setItalic(boolean value) {
+ super.setItalic(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getFontStyle_Italic();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setUnderline(boolean value) {
+ super.setUnderline(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getFontStyle_Underline();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setStrikeThrough(boolean value) {
+ super.setStrikeThrough(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getFontStyle_StrikeThrough();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setDescription(java.lang.String value) {
+ super.setDescription(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getDescriptionStyle_Description();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setFillColor(int value) {
+ super.setFillColor(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getFillStyle_FillColor();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setTransparency(int value) {
+ super.setTransparency(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getFillStyle_Transparency();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setGradient(org.eclipse.gmf.runtime.notation.datatype.GradientData value) {
+ super.setGradient(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getFillStyle_Gradient();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setLineColor(int value) {
+ super.setLineColor(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getLineStyle_LineColor();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setLineWidth(int value) {
+ super.setLineWidth(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getLineStyle_LineWidth();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setRoundedBendpointsRadius(int value) {
+ super.setRoundedBendpointsRadius(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getRoundedCornersStyle_RoundedBendpointsRadius();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ //////////////////////////////////
+ // Implements the unset method //
+ //////////////////////////////////
+
+ @Override
+ public void eUnset(int featureId) {
+ super.eUnset(featureId);
+
+ EStructuralFeature feature = eDynamicFeature(featureId);
+ if(feature != null) {
+ ForceValueHelper.unsetValue(this, feature);
+ }
+ }
+
+ public boolean showElementIcon() {
+ return getCustomStyle().showElementIcon();
+ }
+
+ public int getQualifiedNameDepth() {
+ return getCustomStyle().getQualifiedNameDepth();
+ }
+
+ public boolean showShadow() {
+ return getCustomStyle().showShadow();
+ }
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSShapeStyleImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSShapeStyleImpl.java
new file mode 100644
index 00000000000..40209121b56
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSShapeStyleImpl.java
@@ -0,0 +1,420 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.runtime.notation.impl.ShapeStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.ForceValueHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSShapeStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.impl.CSSShapeStyleDelegate;
+
+public class CSSShapeStyleImpl extends ShapeStyleImpl implements CSSShapeStyle {
+
+ protected ExtendedCSSEngine engine;
+
+ private CSSShapeStyle shapeStyle;
+
+ protected CSSShapeStyle getShapeStyle() {
+ if(shapeStyle == null) {
+ shapeStyle = new CSSShapeStyleDelegate(this, getEngine());
+ }
+ return shapeStyle;
+ }
+
+ protected ExtendedCSSEngine getEngine(){
+ if (engine == null){
+ engine = ((CSSDiagramImpl)findView().getDiagram()).getEngine();
+ }
+ return engine;
+ }
+
+ protected View findView(){
+ EObject parent = eContainer();
+ while (! (parent instanceof View) && parent != null){
+ parent = parent.eContainer();
+ }
+
+ if (parent != null){
+ return (View)parent;
+ }
+
+ return null;
+ }
+
+
+ //////////////////////////////////////////
+ // Forwards accesses to CSS properties //
+ //////////////////////////////////////////
+
+
+ public int getCSSFontColor(){
+ int value = super.getFontColor();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getFontStyle_FontColor(), value)){
+ return value;
+ } else {
+ return getShapeStyle().getCSSFontColor();
+ }
+ }
+
+ public java.lang.String getCSSFontName(){
+ java.lang.String value = super.getFontName();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getFontStyle_FontName(), value)){
+ return value;
+ } else {
+ return getShapeStyle().getCSSFontName();
+ }
+ }
+
+ public int getCSSFontHeight(){
+ int value = super.getFontHeight();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getFontStyle_FontHeight(), value)){
+ return value;
+ } else {
+ return getShapeStyle().getCSSFontHeight();
+ }
+ }
+
+ public boolean isCSSBold(){
+ boolean value = super.isBold();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getFontStyle_Bold(), value)){
+ return value;
+ } else {
+ return getShapeStyle().isCSSBold();
+ }
+ }
+
+ public boolean isCSSItalic(){
+ boolean value = super.isItalic();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getFontStyle_Italic(), value)){
+ return value;
+ } else {
+ return getShapeStyle().isCSSItalic();
+ }
+ }
+
+ public boolean isCSSUnderline(){
+ boolean value = super.isUnderline();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getFontStyle_Underline(), value)){
+ return value;
+ } else {
+ return getShapeStyle().isCSSUnderline();
+ }
+ }
+
+ public boolean isCSSStrikeThrough(){
+ boolean value = super.isStrikeThrough();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getFontStyle_StrikeThrough(), value)){
+ return value;
+ } else {
+ return getShapeStyle().isCSSStrikeThrough();
+ }
+ }
+
+ public java.lang.String getCSSDescription(){
+ java.lang.String value = super.getDescription();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getDescriptionStyle_Description(), value)){
+ return value;
+ } else {
+ return getShapeStyle().getCSSDescription();
+ }
+ }
+
+ public int getCSSFillColor(){
+ int value = super.getFillColor();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getFillStyle_FillColor(), value)){
+ return value;
+ } else {
+ return getShapeStyle().getCSSFillColor();
+ }
+ }
+
+ public int getCSSTransparency(){
+ int value = super.getTransparency();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getFillStyle_Transparency(), value)){
+ return value;
+ } else {
+ return getShapeStyle().getCSSTransparency();
+ }
+ }
+
+ public org.eclipse.gmf.runtime.notation.datatype.GradientData getCSSGradient(){
+ org.eclipse.gmf.runtime.notation.datatype.GradientData value = super.getGradient();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getFillStyle_Gradient(), value)){
+ return value;
+ } else {
+ return getShapeStyle().getCSSGradient();
+ }
+ }
+
+ public int getCSSLineColor(){
+ int value = super.getLineColor();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getLineStyle_LineColor(), value)){
+ return value;
+ } else {
+ return getShapeStyle().getCSSLineColor();
+ }
+ }
+
+ public int getCSSLineWidth(){
+ int value = super.getLineWidth();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getLineStyle_LineWidth(), value)){
+ return value;
+ } else {
+ return getShapeStyle().getCSSLineWidth();
+ }
+ }
+
+ public int getCSSRoundedBendpointsRadius(){
+ int value = super.getRoundedBendpointsRadius();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getRoundedCornersStyle_RoundedBendpointsRadius(), value)){
+ return value;
+ } else {
+ return getShapeStyle().getCSSRoundedBendpointsRadius();
+ }
+ }
+
+
+ @Override
+ public int getFontColor(){
+ //return super.getFontColor();
+ return getCSSFontColor();
+ }
+
+ @Override
+ public java.lang.String getFontName(){
+ //return super.getFontName();
+ return getCSSFontName();
+ }
+
+ @Override
+ public int getFontHeight(){
+ //return super.getFontHeight();
+ return getCSSFontHeight();
+ }
+
+ @Override
+ public boolean isBold(){
+ //return super.isBold();
+ return isCSSBold();
+ }
+
+ @Override
+ public boolean isItalic(){
+ //return super.isItalic();
+ return isCSSItalic();
+ }
+
+ @Override
+ public boolean isUnderline(){
+ //return super.isUnderline();
+ return isCSSUnderline();
+ }
+
+ @Override
+ public boolean isStrikeThrough(){
+ //return super.isStrikeThrough();
+ return isCSSStrikeThrough();
+ }
+
+ @Override
+ public java.lang.String getDescription(){
+ //return super.getDescription();
+ return getCSSDescription();
+ }
+
+ @Override
+ public int getFillColor(){
+ //return super.getFillColor();
+ return getCSSFillColor();
+ }
+
+ @Override
+ public int getTransparency(){
+ //return super.getTransparency();
+ return getCSSTransparency();
+ }
+
+ @Override
+ public org.eclipse.gmf.runtime.notation.datatype.GradientData getGradient(){
+ //return super.getGradient();
+ return getCSSGradient();
+ }
+
+ @Override
+ public int getLineColor(){
+ //return super.getLineColor();
+ return getCSSLineColor();
+ }
+
+ @Override
+ public int getLineWidth(){
+ //return super.getLineWidth();
+ return getCSSLineWidth();
+ }
+
+ @Override
+ public int getRoundedBendpointsRadius(){
+ //return super.getRoundedBendpointsRadius();
+ return getCSSRoundedBendpointsRadius();
+ }
+
+
+
+ ////////////////////////////////////////////////
+ // Implements a setter for each CSS property //
+ ////////////////////////////////////////////////
+
+ @Override
+ public void setFontColor(int value){
+ super.setFontColor(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getFontStyle_FontColor();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setFontName(java.lang.String value){
+ super.setFontName(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getFontStyle_FontName();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setFontHeight(int value){
+ super.setFontHeight(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getFontStyle_FontHeight();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setBold(boolean value){
+ super.setBold(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getFontStyle_Bold();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setItalic(boolean value){
+ super.setItalic(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getFontStyle_Italic();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setUnderline(boolean value){
+ super.setUnderline(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getFontStyle_Underline();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setStrikeThrough(boolean value){
+ super.setStrikeThrough(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getFontStyle_StrikeThrough();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setDescription(java.lang.String value){
+ super.setDescription(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getDescriptionStyle_Description();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setFillColor(int value){
+ super.setFillColor(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getFillStyle_FillColor();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setTransparency(int value){
+ super.setTransparency(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getFillStyle_Transparency();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setGradient(org.eclipse.gmf.runtime.notation.datatype.GradientData value){
+ super.setGradient(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getFillStyle_Gradient();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setLineColor(int value){
+ super.setLineColor(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getLineStyle_LineColor();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setLineWidth(int value){
+ super.setLineWidth(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getLineStyle_LineWidth();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setRoundedBendpointsRadius(int value){
+ super.setRoundedBendpointsRadius(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getRoundedCornersStyle_RoundedBendpointsRadius();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ //////////////////////////////////
+ // Implements the unset method //
+ //////////////////////////////////
+
+ @Override
+ public void eUnset(int featureId) {
+ super.eUnset(featureId);
+
+ EStructuralFeature feature = eDynamicFeature(featureId);
+ ForceValueHelper.unsetValue(findView(), feature);
+ }
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSSortingStyleImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSSortingStyleImpl.java
new file mode 100644
index 00000000000..b58437bec41
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSSortingStyleImpl.java
@@ -0,0 +1,133 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.Sorting;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.runtime.notation.impl.SortingStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.ForceValueHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSSortingStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.impl.CSSSortingStyleDelegate;
+
+public class CSSSortingStyleImpl extends SortingStyleImpl implements CSSSortingStyle {
+
+ protected ExtendedCSSEngine engine;
+
+ private CSSSortingStyle sortingStyle;
+
+ protected CSSSortingStyle getSortingStyle() {
+ if(sortingStyle == null) {
+ sortingStyle = new CSSSortingStyleDelegate(this, getEngine());
+ }
+ return sortingStyle;
+ }
+
+ protected ExtendedCSSEngine getEngine(){
+ if (engine == null){
+ engine = ((CSSDiagramImpl)findView().getDiagram()).getEngine();
+ }
+ return engine;
+ }
+
+ protected View findView(){
+ EObject parent = eContainer();
+ while (! (parent instanceof View) && parent != null){
+ parent = parent.eContainer();
+ }
+
+ if (parent != null){
+ return (View)parent;
+ }
+
+ return null;
+ }
+
+
+ //////////////////////////////////////////
+ // Forwards accesses to CSS properties //
+ //////////////////////////////////////////
+
+
+ public Sorting getCSSSorting(){
+ Sorting value = super.getSorting();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getSortingStyle_Sorting(), value)){
+ return value;
+ } else {
+ return getSortingStyle().getCSSSorting();
+ }
+ }
+
+ public java.util.Map getCSSSortingKeys(){
+ java.util.Map value = super.getSortingKeys();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getSortingStyle_SortingKeys(), value)){
+ return value;
+ } else {
+ return getSortingStyle().getCSSSortingKeys();
+ }
+ }
+
+
+ @Override
+ public Sorting getSorting(){
+ //return super.getSorting();
+ return getCSSSorting();
+ }
+
+ @Override
+ public java.util.Map getSortingKeys(){
+ //return super.getSortingKeys();
+ return getCSSSortingKeys();
+ }
+
+
+
+ ////////////////////////////////////////////////
+ // Implements a setter for each CSS property //
+ ////////////////////////////////////////////////
+
+ @Override
+ public void setSorting(Sorting value){
+ super.setSorting(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getSortingStyle_Sorting();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ @Override
+ public void setSortingKeys(java.util.Map value){
+ super.setSortingKeys(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getSortingStyle_SortingKeys();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ //////////////////////////////////
+ // Implements the unset method //
+ //////////////////////////////////
+
+ @Override
+ public void eUnset(int featureId) {
+ super.eUnset(featureId);
+
+ EStructuralFeature feature = eDynamicFeature(featureId);
+ ForceValueHelper.unsetValue(findView(), feature);
+ }
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSStandardDiagramImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSStandardDiagramImpl.java
new file mode 100644
index 00000000000..a6d8b3cec04
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSStandardDiagramImpl.java
@@ -0,0 +1,230 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.notation.MeasurementUnit;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.impl.StandardDiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.ForceValueHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSDiagramStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.impl.CSSDiagramStyleDelegate;
+
+public class CSSStandardDiagramImpl extends StandardDiagramImpl implements CSSDiagramStyle {
+
+ protected ExtendedCSSEngine engine;
+
+ private CSSDiagramStyle diagramStyle;
+
+ protected CSSDiagramStyle getDiagramStyle() {
+ if(diagramStyle == null) {
+ diagramStyle = new CSSDiagramStyleDelegate(this, getEngine());
+ }
+ return diagramStyle;
+ }
+
+ protected ExtendedCSSEngine getEngine() {
+ if(engine == null) {
+ engine = ((CSSDiagramImpl)getDiagram()).getEngine();
+ }
+ return engine;
+ }
+
+
+ //////////////////////////////////////////
+ // Forwards accesses to CSS properties //
+ //////////////////////////////////////////
+
+
+ public int getCSSPageX(){
+ int value = super.getPageX();
+
+ if (ForceValueHelper.isSet(this, NotationPackage.eINSTANCE.getPageStyle_PageX(), value)){
+ return value;
+ } else {
+ return getDiagramStyle().getCSSPageX();
+ }
+ }
+
+ public int getCSSPageY(){
+ int value = super.getPageY();
+
+ if (ForceValueHelper.isSet(this, NotationPackage.eINSTANCE.getPageStyle_PageY(), value)){
+ return value;
+ } else {
+ return getDiagramStyle().getCSSPageY();
+ }
+ }
+
+ public int getCSSPageWidth(){
+ int value = super.getPageWidth();
+
+ if (ForceValueHelper.isSet(this, NotationPackage.eINSTANCE.getPageStyle_PageWidth(), value)){
+ return value;
+ } else {
+ return getDiagramStyle().getCSSPageWidth();
+ }
+ }
+
+ public int getCSSPageHeight(){
+ int value = super.getPageHeight();
+
+ if (ForceValueHelper.isSet(this, NotationPackage.eINSTANCE.getPageStyle_PageHeight(), value)){
+ return value;
+ } else {
+ return getDiagramStyle().getCSSPageHeight();
+ }
+ }
+
+ public java.lang.String getCSSDescription(){
+ java.lang.String value = super.getDescription();
+
+ if (ForceValueHelper.isSet(this, NotationPackage.eINSTANCE.getDescriptionStyle_Description(), value)){
+ return value;
+ } else {
+ return getDiagramStyle().getCSSDescription();
+ }
+ }
+
+
+ @Override
+ public int getPageX(){
+ //return super.getPageX();
+ return getCSSPageX();
+ }
+
+ @Override
+ public int getPageY(){
+ //return super.getPageY();
+ return getCSSPageY();
+ }
+
+ @Override
+ public int getPageWidth(){
+ //return super.getPageWidth();
+ return getCSSPageWidth();
+ }
+
+ @Override
+ public int getPageHeight(){
+ //return super.getPageHeight();
+ return getCSSPageHeight();
+ }
+
+ @Override
+ public java.lang.String getDescription(){
+ //return super.getDescription();
+ return getCSSDescription();
+ }
+
+
+
+ ////////////////////////////////////////////////
+ // Implements a setter for each CSS property //
+ ////////////////////////////////////////////////
+
+ @Override
+ public void setVisible(boolean value){
+ super.setVisible(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getView_Visible();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setType(java.lang.String value){
+ super.setType(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getView_Type();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setMutable(boolean value){
+ super.setMutable(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getView_Mutable();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setName(java.lang.String value){
+ super.setName(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getDiagram_Name();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setMeasurementUnit(MeasurementUnit value){
+ super.setMeasurementUnit(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getDiagram_MeasurementUnit();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setPageX(int value){
+ super.setPageX(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getPageStyle_PageX();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setPageY(int value){
+ super.setPageY(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getPageStyle_PageY();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setPageWidth(int value){
+ super.setPageWidth(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getPageStyle_PageWidth();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setPageHeight(int value){
+ super.setPageHeight(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getPageStyle_PageHeight();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ @Override
+ public void setDescription(java.lang.String value){
+ super.setDescription(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getDescriptionStyle_Description();
+ ForceValueHelper.setValue(this, feature, value);
+ }
+
+ //////////////////////////////////
+ // Implements the unset method //
+ //////////////////////////////////
+
+ @Override
+ public void eUnset(int featureId) {
+ super.eUnset(featureId);
+
+ EStructuralFeature feature = eDynamicFeature(featureId);
+ ForceValueHelper.unsetValue(this, feature);
+ }
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSTextStyleImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSTextStyleImpl.java
new file mode 100644
index 00000000000..6e44a44ab1b
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSTextStyleImpl.java
@@ -0,0 +1,109 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.TextAlignment;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.runtime.notation.impl.TextStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.ForceValueHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSTextStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.impl.CSSTextStyleDelegate;
+
+public class CSSTextStyleImpl extends TextStyleImpl implements CSSTextStyle {
+
+ protected ExtendedCSSEngine engine;
+
+ private CSSTextStyle textStyle;
+
+ protected CSSTextStyle getTextStyle() {
+ if(textStyle == null) {
+ textStyle = new CSSTextStyleDelegate(this, getEngine());
+ }
+ return textStyle;
+ }
+
+ protected ExtendedCSSEngine getEngine(){
+ if (engine == null){
+ engine = ((CSSDiagramImpl)findView().getDiagram()).getEngine();
+ }
+ return engine;
+ }
+
+ protected View findView(){
+ EObject parent = eContainer();
+ while (! (parent instanceof View) && parent != null){
+ parent = parent.eContainer();
+ }
+
+ if (parent != null){
+ return (View)parent;
+ }
+
+ return null;
+ }
+
+
+ //////////////////////////////////////////
+ // Forwards accesses to CSS properties //
+ //////////////////////////////////////////
+
+
+ public TextAlignment getCSSTextAlignment(){
+ TextAlignment value = super.getTextAlignment();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getTextStyle_TextAlignment(), value)){
+ return value;
+ } else {
+ return getTextStyle().getCSSTextAlignment();
+ }
+ }
+
+
+ @Override
+ public TextAlignment getTextAlignment(){
+ //return super.getTextAlignment();
+ return getCSSTextAlignment();
+ }
+
+
+
+ ////////////////////////////////////////////////
+ // Implements a setter for each CSS property //
+ ////////////////////////////////////////////////
+
+ @Override
+ public void setTextAlignment(TextAlignment value){
+ super.setTextAlignment(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getTextStyle_TextAlignment();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ //////////////////////////////////
+ // Implements the unset method //
+ //////////////////////////////////
+
+ @Override
+ public void eUnset(int featureId) {
+ super.eUnset(featureId);
+
+ EStructuralFeature feature = eDynamicFeature(featureId);
+ ForceValueHelper.unsetValue(findView(), feature);
+ }
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSTitleStyleImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSTitleStyleImpl.java
new file mode 100644
index 00000000000..4cc1a922ce4
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/CSSTitleStyleImpl.java
@@ -0,0 +1,108 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.runtime.notation.impl.TitleStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.ForceValueHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSTitleStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.impl.CSSTitleStyleDelegate;
+
+public class CSSTitleStyleImpl extends TitleStyleImpl implements CSSTitleStyle {
+
+ protected ExtendedCSSEngine engine;
+
+ private CSSTitleStyle titleStyle;
+
+ protected CSSTitleStyle getTitleStyle() {
+ if(titleStyle == null) {
+ titleStyle = new CSSTitleStyleDelegate(this, getEngine());
+ }
+ return titleStyle;
+ }
+
+ protected ExtendedCSSEngine getEngine(){
+ if (engine == null){
+ engine = ((CSSDiagramImpl)findView().getDiagram()).getEngine();
+ }
+ return engine;
+ }
+
+ protected View findView(){
+ EObject parent = eContainer();
+ while (! (parent instanceof View) && parent != null){
+ parent = parent.eContainer();
+ }
+
+ if (parent != null){
+ return (View)parent;
+ }
+
+ return null;
+ }
+
+
+ //////////////////////////////////////////
+ // Forwards accesses to CSS properties //
+ //////////////////////////////////////////
+
+
+ public boolean isCSSShowTitle(){
+ boolean value = super.isShowTitle();
+
+ if (ForceValueHelper.isSet(findView(), this, NotationPackage.eINSTANCE.getTitleStyle_ShowTitle(), value)){
+ return value;
+ } else {
+ return getTitleStyle().isCSSShowTitle();
+ }
+ }
+
+
+ @Override
+ public boolean isShowTitle(){
+ //return super.isShowTitle();
+ return isCSSShowTitle();
+ }
+
+
+
+ ////////////////////////////////////////////////
+ // Implements a setter for each CSS property //
+ ////////////////////////////////////////////////
+
+ @Override
+ public void setShowTitle(boolean value){
+ super.setShowTitle(value);
+
+ EStructuralFeature feature = NotationPackage.eINSTANCE.getTitleStyle_ShowTitle();
+ ForceValueHelper.setValue(findView(), feature, value);
+ }
+
+ //////////////////////////////////
+ // Implements the unset method //
+ //////////////////////////////////
+
+ @Override
+ public void eUnset(int featureId) {
+ super.eUnset(featureId);
+
+ EStructuralFeature feature = eDynamicFeature(featureId);
+ ForceValueHelper.unsetValue(findView(), feature);
+ }
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/factory/CSSNotationFactory.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/factory/CSSNotationFactory.java
new file mode 100644
index 00000000000..21f9695faf5
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/factory/CSSNotationFactory.java
@@ -0,0 +1,272 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.factory;
+
+import org.eclipse.gmf.runtime.notation.ArrowStyle;
+import org.eclipse.gmf.runtime.notation.BasicCompartment;
+import org.eclipse.gmf.runtime.notation.BasicSemanticCompartment;
+import org.eclipse.gmf.runtime.notation.CanonicalStyle;
+import org.eclipse.gmf.runtime.notation.Compartment;
+import org.eclipse.gmf.runtime.notation.Connector;
+import org.eclipse.gmf.runtime.notation.ConnectorStyle;
+import org.eclipse.gmf.runtime.notation.DataTypeStyle;
+import org.eclipse.gmf.runtime.notation.DescriptionStyle;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.DiagramLinkStyle;
+import org.eclipse.gmf.runtime.notation.DiagramStyle;
+import org.eclipse.gmf.runtime.notation.DrawerStyle;
+import org.eclipse.gmf.runtime.notation.FillStyle;
+import org.eclipse.gmf.runtime.notation.FilteringStyle;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.GuideStyle;
+import org.eclipse.gmf.runtime.notation.HintedDiagramLinkStyle;
+import org.eclipse.gmf.runtime.notation.ImageBufferStyle;
+import org.eclipse.gmf.runtime.notation.ImageStyle;
+import org.eclipse.gmf.runtime.notation.LineStyle;
+import org.eclipse.gmf.runtime.notation.LineTypeStyle;
+import org.eclipse.gmf.runtime.notation.ListCompartment;
+import org.eclipse.gmf.runtime.notation.MultiDiagramLinkStyle;
+import org.eclipse.gmf.runtime.notation.NamedStyle;
+import org.eclipse.gmf.runtime.notation.PageStyle;
+import org.eclipse.gmf.runtime.notation.PropertiesSetStyle;
+import org.eclipse.gmf.runtime.notation.RoundedCornersStyle;
+import org.eclipse.gmf.runtime.notation.RoutingStyle;
+import org.eclipse.gmf.runtime.notation.SemanticListCompartment;
+import org.eclipse.gmf.runtime.notation.Shape;
+import org.eclipse.gmf.runtime.notation.ShapeStyle;
+import org.eclipse.gmf.runtime.notation.SortingStyle;
+import org.eclipse.gmf.runtime.notation.StandardDiagram;
+import org.eclipse.gmf.runtime.notation.TextStyle;
+import org.eclipse.gmf.runtime.notation.TitleStyle;
+import org.eclipse.gmf.runtime.notation.impl.NotationFactoryImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.CSSArrowStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.CSSBasicCompartmentImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.CSSBasicSemanticCompartmentImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.CSSCanonicalStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.CSSCompartmentImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.CSSConnectorImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.CSSConnectorStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.CSSDataTypeStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.CSSDescriptionStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.CSSDiagramLinkStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.CSSDiagramStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.CSSDrawerStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.CSSFillStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.CSSFilteringStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.CSSFontStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.CSSGuideStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.CSSHintedDiagramLinkStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.CSSImageBufferStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.CSSImageStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.CSSLineStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.CSSLineTypeStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.CSSListCompartmentImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.CSSMultiDiagramLinkStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.CSSNamedStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.CSSPageStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.CSSPropertiesSetStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.CSSRoundedCornersStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.CSSRoutingStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.CSSSemanticListCompartmentImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.CSSShapeImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.CSSShapeStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.CSSSortingStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.CSSStandardDiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.CSSTextStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.CSSTitleStyleImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagramImpl;
+
+public class CSSNotationFactory extends NotationFactoryImpl {
+
+ public static CSSNotationFactory eINSTANCE = new CSSNotationFactory();
+
+ @Override
+ public Diagram createDiagram() {
+ return new CSSDiagramImpl();
+ }
+
+ @Override
+ public FillStyle createFillStyle() {
+ return new CSSFillStyleImpl();
+ }
+
+ @Override
+ public LineStyle createLineStyle() {
+ return new CSSLineStyleImpl();
+ }
+
+ @Override
+ public FontStyle createFontStyle() {
+ return new CSSFontStyleImpl();
+ }
+
+ @Override
+ public TitleStyle createTitleStyle() {
+ return new CSSTitleStyleImpl();
+ }
+
+ @Override
+ public SortingStyle createSortingStyle() {
+ return new CSSSortingStyleImpl();
+ }
+
+ @Override
+ public DescriptionStyle createDescriptionStyle() {
+ return new CSSDescriptionStyleImpl();
+ }
+
+ @Override
+ public RoutingStyle createRoutingStyle() {
+ return new CSSRoutingStyleImpl();
+ }
+
+ @Override
+ public CanonicalStyle createCanonicalStyle() {
+ return new CSSCanonicalStyleImpl();
+ }
+
+ @Override
+ public ShapeStyle createShapeStyle() {
+ return new CSSShapeStyleImpl();
+ }
+
+ @Override
+ public ConnectorStyle createConnectorStyle() {
+ return new CSSConnectorStyleImpl();
+ }
+
+ @Override
+ public PageStyle createPageStyle() {
+ return new CSSPageStyleImpl();
+ }
+
+ @Override
+ public DrawerStyle createDrawerStyle() {
+ return new CSSDrawerStyleImpl();
+ }
+
+ @Override
+ public GuideStyle createGuideStyle() {
+ return new CSSGuideStyleImpl();
+ }
+
+ @Override
+ public FilteringStyle createFilteringStyle() {
+ return new CSSFilteringStyleImpl();
+ }
+
+ @Override
+ public DiagramStyle createDiagramStyle() {
+ return new CSSDiagramStyleImpl();
+ }
+
+ @Override
+ public ImageStyle createImageStyle() {
+ return new CSSImageStyleImpl();
+ }
+
+ @Override
+ public ImageBufferStyle createImageBufferStyle() {
+ return new CSSImageBufferStyleImpl();
+ }
+
+ @Override
+ public PropertiesSetStyle createPropertiesSetStyle() {
+ return new CSSPropertiesSetStyleImpl();
+ }
+
+ @Override
+ public NamedStyle createNamedStyle() {
+ return new CSSNamedStyleImpl();
+ }
+
+ @Override
+ public DataTypeStyle createDataTypeStyle() {
+ return new CSSDataTypeStyleImpl();
+ }
+
+ @Override
+ public HintedDiagramLinkStyle createHintedDiagramLinkStyle() {
+ return new CSSHintedDiagramLinkStyleImpl();
+ }
+
+ @Override
+ public DiagramLinkStyle createDiagramLinkStyle() {
+ return new CSSDiagramLinkStyleImpl();
+ }
+
+ @Override
+ public MultiDiagramLinkStyle createMultiDiagramLinkStyle() {
+ return new CSSMultiDiagramLinkStyleImpl();
+ }
+
+ @Override
+ public TextStyle createTextStyle() {
+ return new CSSTextStyleImpl();
+ }
+
+ @Override
+ public LineTypeStyle createLineTypeStyle() {
+ return new CSSLineTypeStyleImpl();
+ }
+
+ @Override
+ public ArrowStyle createArrowStyle() {
+ return new CSSArrowStyleImpl();
+ }
+
+ @Override
+ public Shape createShape() {
+ return new CSSShapeImpl();
+ }
+
+ @Override
+ public Compartment createCompartment() {
+ return new CSSCompartmentImpl();
+ }
+
+ @Override
+ public ListCompartment createListCompartment() {
+ return new CSSListCompartmentImpl();
+ }
+
+ @Override
+ public Connector createConnector() {
+ return new CSSConnectorImpl();
+ }
+
+ @Override
+ public StandardDiagram createStandardDiagram() {
+ return new CSSStandardDiagramImpl();
+ }
+
+ @Override
+ public BasicCompartment createBasicCompartment() {
+ return new CSSBasicCompartmentImpl();
+ }
+
+ @Override
+ public BasicSemanticCompartment createBasicSemanticCompartment() {
+ return new CSSBasicSemanticCompartmentImpl();
+ }
+
+ @Override
+ public SemanticListCompartment createSemanticListCompartment() {
+ return new CSSSemanticListCompartmentImpl();
+ }
+
+ @Override
+ public RoundedCornersStyle createRoundedCornersStyle() {
+ return new CSSRoundedCornersStyleImpl();
+ }
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSArrowStyle.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSArrowStyle.java
new file mode 100644
index 00000000000..fbb6e165f43
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSArrowStyle.java
@@ -0,0 +1,23 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style;
+
+import org.eclipse.gmf.runtime.notation.ArrowType;
+
+public interface CSSArrowStyle {
+
+ public ArrowType getCSSArrowSource();
+
+
+ public ArrowType getCSSArrowTarget();
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSCanonicalStyle.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSCanonicalStyle.java
new file mode 100644
index 00000000000..b1ee98c8e62
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSCanonicalStyle.java
@@ -0,0 +1,19 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style;
+
+
+public interface CSSCanonicalStyle {
+
+ public boolean isCSSCanonical();
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSConnectorStyle.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSConnectorStyle.java
new file mode 100644
index 00000000000..9f50152b2c2
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSConnectorStyle.java
@@ -0,0 +1,18 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style;
+
+
+public interface CSSConnectorStyle extends CSSRoundedCornersStyle, CSSRoutingStyle, CSSLineStyle{
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSDataTypeStyle.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSDataTypeStyle.java
new file mode 100644
index 00000000000..2868401218a
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSDataTypeStyle.java
@@ -0,0 +1,18 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style;
+
+
+public interface CSSDataTypeStyle extends CSSNamedStyle{
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSDescriptionStyle.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSDescriptionStyle.java
new file mode 100644
index 00000000000..88e5cfb06d8
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSDescriptionStyle.java
@@ -0,0 +1,19 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style;
+
+
+public interface CSSDescriptionStyle {
+
+ public java.lang.String getCSSDescription();
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSDiagramLinkStyle.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSDiagramLinkStyle.java
new file mode 100644
index 00000000000..0db0b204e8c
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSDiagramLinkStyle.java
@@ -0,0 +1,18 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style;
+
+
+public interface CSSDiagramLinkStyle {
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSDiagramStyle.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSDiagramStyle.java
new file mode 100644
index 00000000000..f170fac480a
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSDiagramStyle.java
@@ -0,0 +1,18 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style;
+
+
+public interface CSSDiagramStyle extends CSSPageStyle, CSSGuideStyle, CSSDescriptionStyle{
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSDrawerStyle.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSDrawerStyle.java
new file mode 100644
index 00000000000..1ec950900f5
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSDrawerStyle.java
@@ -0,0 +1,19 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style;
+
+
+public interface CSSDrawerStyle {
+
+ public boolean isCSSCollapsed();
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSFillStyle.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSFillStyle.java
new file mode 100644
index 00000000000..fd6a89219b0
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSFillStyle.java
@@ -0,0 +1,25 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style;
+
+
+public interface CSSFillStyle {
+
+ public int getCSSFillColor();
+
+
+ public int getCSSTransparency();
+
+
+ public org.eclipse.gmf.runtime.notation.datatype.GradientData getCSSGradient();
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSFilteringStyle.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSFilteringStyle.java
new file mode 100644
index 00000000000..2de3c9f3b32
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSFilteringStyle.java
@@ -0,0 +1,23 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style;
+
+import org.eclipse.gmf.runtime.notation.Filtering;
+
+public interface CSSFilteringStyle {
+
+ public Filtering getCSSFiltering();
+
+
+ public java.util.List getCSSFilteringKeys();
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSFontStyle.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSFontStyle.java
new file mode 100644
index 00000000000..027d267e8b6
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSFontStyle.java
@@ -0,0 +1,37 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style;
+
+
+public interface CSSFontStyle {
+
+ public int getCSSFontColor();
+
+
+ public java.lang.String getCSSFontName();
+
+
+ public int getCSSFontHeight();
+
+
+ public boolean isCSSBold();
+
+
+ public boolean isCSSItalic();
+
+
+ public boolean isCSSUnderline();
+
+
+ public boolean isCSSStrikeThrough();
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSGuideStyle.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSGuideStyle.java
new file mode 100644
index 00000000000..32181eb4f1e
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSGuideStyle.java
@@ -0,0 +1,18 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style;
+
+
+public interface CSSGuideStyle {
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSHintedDiagramLinkStyle.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSHintedDiagramLinkStyle.java
new file mode 100644
index 00000000000..ecb8ec897fb
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSHintedDiagramLinkStyle.java
@@ -0,0 +1,19 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style;
+
+
+public interface CSSHintedDiagramLinkStyle extends CSSDiagramLinkStyle{
+
+ public java.lang.String getCSSHint();
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSImageBufferStyle.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSImageBufferStyle.java
new file mode 100644
index 00000000000..5c3a842084a
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSImageBufferStyle.java
@@ -0,0 +1,18 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style;
+
+
+public interface CSSImageBufferStyle extends CSSImageStyle{
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSImageStyle.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSImageStyle.java
new file mode 100644
index 00000000000..b8beaa6496b
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSImageStyle.java
@@ -0,0 +1,22 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style;
+
+
+public interface CSSImageStyle {
+
+ public java.lang.Boolean getCSSAntiAlias();
+
+
+ public java.lang.Boolean getCSSMaintainAspectRatio();
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSLineStyle.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSLineStyle.java
new file mode 100644
index 00000000000..270f27ca46b
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSLineStyle.java
@@ -0,0 +1,22 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style;
+
+
+public interface CSSLineStyle {
+
+ public int getCSSLineColor();
+
+
+ public int getCSSLineWidth();
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSLineTypeStyle.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSLineTypeStyle.java
new file mode 100644
index 00000000000..0184f72e80e
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSLineTypeStyle.java
@@ -0,0 +1,20 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style;
+
+import org.eclipse.gmf.runtime.notation.LineType;
+
+public interface CSSLineTypeStyle {
+
+ public LineType getCSSLineType();
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSMultiDiagramLinkStyle.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSMultiDiagramLinkStyle.java
new file mode 100644
index 00000000000..964bb81e747
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSMultiDiagramLinkStyle.java
@@ -0,0 +1,18 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style;
+
+
+public interface CSSMultiDiagramLinkStyle {
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSNamedStyle.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSNamedStyle.java
new file mode 100644
index 00000000000..e3a61075cf3
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSNamedStyle.java
@@ -0,0 +1,19 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style;
+
+
+public interface CSSNamedStyle {
+
+ public java.lang.String getCSSName();
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSPageStyle.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSPageStyle.java
new file mode 100644
index 00000000000..ee993dca5ef
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSPageStyle.java
@@ -0,0 +1,28 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style;
+
+
+public interface CSSPageStyle {
+
+ public int getCSSPageX();
+
+
+ public int getCSSPageY();
+
+
+ public int getCSSPageWidth();
+
+
+ public int getCSSPageHeight();
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSPropertiesSetStyle.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSPropertiesSetStyle.java
new file mode 100644
index 00000000000..10e7c9eec5a
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSPropertiesSetStyle.java
@@ -0,0 +1,18 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style;
+
+
+public interface CSSPropertiesSetStyle extends CSSNamedStyle{
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSRoundedCornersStyle.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSRoundedCornersStyle.java
new file mode 100644
index 00000000000..2f08a0fefb0
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSRoundedCornersStyle.java
@@ -0,0 +1,19 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style;
+
+
+public interface CSSRoundedCornersStyle {
+
+ public int getCSSRoundedBendpointsRadius();
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSRoutingStyle.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSRoutingStyle.java
new file mode 100644
index 00000000000..9d4d5508f72
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSRoutingStyle.java
@@ -0,0 +1,41 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style;
+
+import org.eclipse.gmf.runtime.notation.JumpLinkStatus;
+import org.eclipse.gmf.runtime.notation.JumpLinkType;
+import org.eclipse.gmf.runtime.notation.Routing;
+import org.eclipse.gmf.runtime.notation.Smoothness;
+
+public interface CSSRoutingStyle extends CSSRoundedCornersStyle{
+
+ public Routing getCSSRouting();
+
+
+ public Smoothness getCSSSmoothness();
+
+
+ public boolean isCSSAvoidObstructions();
+
+
+ public boolean isCSSClosestDistance();
+
+
+ public JumpLinkStatus getCSSJumpLinkStatus();
+
+
+ public JumpLinkType getCSSJumpLinkType();
+
+
+ public boolean isCSSJumpLinksReverse();
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSShapeStyle.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSShapeStyle.java
new file mode 100644
index 00000000000..930e30b4ab7
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSShapeStyle.java
@@ -0,0 +1,18 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style;
+
+
+public interface CSSShapeStyle extends CSSFontStyle, CSSDescriptionStyle, CSSFillStyle, CSSLineStyle, CSSRoundedCornersStyle{
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSSortingStyle.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSSortingStyle.java
new file mode 100644
index 00000000000..f0ef31f175f
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSSortingStyle.java
@@ -0,0 +1,23 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style;
+
+import org.eclipse.gmf.runtime.notation.Sorting;
+
+public interface CSSSortingStyle {
+
+ public Sorting getCSSSorting();
+
+
+ public java.util.Map getCSSSortingKeys();
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSTextStyle.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSTextStyle.java
new file mode 100644
index 00000000000..9be4935f83b
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSTextStyle.java
@@ -0,0 +1,20 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style;
+
+import org.eclipse.gmf.runtime.notation.TextAlignment;
+
+public interface CSSTextStyle {
+
+ public TextAlignment getCSSTextAlignment();
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSTitleStyle.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSTitleStyle.java
new file mode 100644
index 00000000000..ca35bb83871
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/CSSTitleStyle.java
@@ -0,0 +1,19 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style;
+
+
+public interface CSSTitleStyle {
+
+ public boolean isCSSShowTitle();
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSArrowStyleDelegate.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSArrowStyleDelegate.java
new file mode 100644
index 00000000000..00c2db80d43
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSArrowStyleDelegate.java
@@ -0,0 +1,53 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style.impl;
+
+import org.eclipse.gmf.runtime.notation.ArrowStyle;
+import org.eclipse.gmf.runtime.notation.ArrowType;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSArrowStyle;
+import org.w3c.dom.css.CSSValue;
+
+public class CSSArrowStyleDelegate implements CSSArrowStyle {
+
+ private ArrowStyle arrowStyle;
+
+ private ExtendedCSSEngine engine;
+
+ public CSSArrowStyleDelegate(ArrowStyle arrowStyle, ExtendedCSSEngine engine) {
+ this.arrowStyle = arrowStyle;
+ this.engine = engine;
+ }
+
+ ////////////////////////////////////////////////
+ // Implements a getter for each CSS property //
+ ////////////////////////////////////////////////
+
+ public ArrowType getCSSArrowSource() {
+ CSSValue cssValue = engine.retrievePropertyValue(arrowStyle, "arrowSource");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getArrowStyle_ArrowSource().getDefaultValue();
+ return (ArrowType)defaultValue;
+ }
+ return ArrowType.get(cssValue.getCssText());
+ }
+
+ public ArrowType getCSSArrowTarget() {
+ CSSValue cssValue = engine.retrievePropertyValue(arrowStyle, "arrowTarget");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getArrowStyle_ArrowTarget().getDefaultValue();
+ return (ArrowType)defaultValue;
+ }
+ return ArrowType.get(cssValue.getCssText());
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSCanonicalStyleDelegate.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSCanonicalStyleDelegate.java
new file mode 100644
index 00000000000..9fbc8650e84
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSCanonicalStyleDelegate.java
@@ -0,0 +1,43 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style.impl;
+
+import org.eclipse.gmf.runtime.notation.CanonicalStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSCanonicalStyle;
+import org.w3c.dom.css.CSSValue;
+
+public class CSSCanonicalStyleDelegate implements CSSCanonicalStyle {
+
+ private CanonicalStyle canonicalStyle;
+
+ private ExtendedCSSEngine engine;
+
+ public CSSCanonicalStyleDelegate(CanonicalStyle canonicalStyle, ExtendedCSSEngine engine) {
+ this.canonicalStyle = canonicalStyle;
+ this.engine = engine;
+ }
+
+ ////////////////////////////////////////////////
+ // Implements a getter for each CSS property //
+ ////////////////////////////////////////////////
+
+ public boolean isCSSCanonical() {
+ CSSValue cssValue = engine.retrievePropertyValue(canonicalStyle, "canonical");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getCanonicalStyle_Canonical().getDefaultValue();
+ return (Boolean)defaultValue;
+ }
+ return (Boolean)engine.convert(cssValue, Boolean.class, null);
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSConnectorStyleDelegate.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSConnectorStyleDelegate.java
new file mode 100644
index 00000000000..e32d67fb72b
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSConnectorStyleDelegate.java
@@ -0,0 +1,128 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style.impl;
+
+import org.eclipse.gmf.runtime.notation.ConnectorStyle;
+import org.eclipse.gmf.runtime.notation.JumpLinkStatus;
+import org.eclipse.gmf.runtime.notation.JumpLinkType;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.Routing;
+import org.eclipse.gmf.runtime.notation.Smoothness;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSConnectorStyle;
+import org.w3c.dom.css.CSSValue;
+
+public class CSSConnectorStyleDelegate implements CSSConnectorStyle {
+
+ private ConnectorStyle connectorStyle;
+
+ private ExtendedCSSEngine engine;
+
+ public CSSConnectorStyleDelegate(ConnectorStyle connectorStyle, ExtendedCSSEngine engine) {
+ this.connectorStyle = connectorStyle;
+ this.engine = engine;
+ }
+
+ ////////////////////////////////////////////////
+ // Implements a getter for each CSS property //
+ ////////////////////////////////////////////////
+
+ public int getCSSRoundedBendpointsRadius() {
+ CSSValue cssValue = engine.retrievePropertyValue(connectorStyle, "roundedBendpointsRadius");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getRoundedCornersStyle_RoundedBendpointsRadius().getDefaultValue();
+ return (Integer)defaultValue;
+ }
+ return (Integer)engine.convert(cssValue, Integer.class, null);
+ }
+
+ public Routing getCSSRouting() {
+ CSSValue cssValue = engine.retrievePropertyValue(connectorStyle, "routing");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getRoutingStyle_Routing().getDefaultValue();
+ return (Routing)defaultValue;
+ }
+ return Routing.get(cssValue.getCssText());
+ }
+
+ public Smoothness getCSSSmoothness() {
+ CSSValue cssValue = engine.retrievePropertyValue(connectorStyle, "smoothness");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getRoutingStyle_Smoothness().getDefaultValue();
+ return (Smoothness)defaultValue;
+ }
+ return Smoothness.get(cssValue.getCssText());
+ }
+
+ public boolean isCSSAvoidObstructions() {
+ CSSValue cssValue = engine.retrievePropertyValue(connectorStyle, "avoidObstructions");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getRoutingStyle_AvoidObstructions().getDefaultValue();
+ return (Boolean)defaultValue;
+ }
+ return (Boolean)engine.convert(cssValue, Boolean.class, null);
+ }
+
+ public boolean isCSSClosestDistance() {
+ CSSValue cssValue = engine.retrievePropertyValue(connectorStyle, "closestDistance");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getRoutingStyle_ClosestDistance().getDefaultValue();
+ return (Boolean)defaultValue;
+ }
+ return (Boolean)engine.convert(cssValue, Boolean.class, null);
+ }
+
+ public JumpLinkStatus getCSSJumpLinkStatus() {
+ CSSValue cssValue = engine.retrievePropertyValue(connectorStyle, "jumpLinkStatus");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getRoutingStyle_JumpLinkStatus().getDefaultValue();
+ return (JumpLinkStatus)defaultValue;
+ }
+ return JumpLinkStatus.get(cssValue.getCssText());
+ }
+
+ public JumpLinkType getCSSJumpLinkType() {
+ CSSValue cssValue = engine.retrievePropertyValue(connectorStyle, "jumpLinkType");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getRoutingStyle_JumpLinkType().getDefaultValue();
+ return (JumpLinkType)defaultValue;
+ }
+ return JumpLinkType.get(cssValue.getCssText());
+ }
+
+ public boolean isCSSJumpLinksReverse() {
+ CSSValue cssValue = engine.retrievePropertyValue(connectorStyle, "jumpLinksReverse");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getRoutingStyle_JumpLinksReverse().getDefaultValue();
+ return (Boolean)defaultValue;
+ }
+ return (Boolean)engine.convert(cssValue, Boolean.class, null);
+ }
+
+ public int getCSSLineColor() {
+ CSSValue cssValue = engine.retrievePropertyValue(connectorStyle, "lineColor");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getLineStyle_LineColor().getDefaultValue();
+ return (Integer)defaultValue;
+ }
+ return (Integer)engine.convert(cssValue, "GMFColor", null);
+ }
+
+ public int getCSSLineWidth() {
+ CSSValue cssValue = engine.retrievePropertyValue(connectorStyle, "lineWidth");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getLineStyle_LineWidth().getDefaultValue();
+ return (Integer)defaultValue;
+ }
+ return (Integer)engine.convert(cssValue, Integer.class, null);
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSDataTypeStyleDelegate.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSDataTypeStyleDelegate.java
new file mode 100644
index 00000000000..11747c803c5
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSDataTypeStyleDelegate.java
@@ -0,0 +1,43 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style.impl;
+
+import org.eclipse.gmf.runtime.notation.DataTypeStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSDataTypeStyle;
+import org.w3c.dom.css.CSSValue;
+
+public class CSSDataTypeStyleDelegate implements CSSDataTypeStyle {
+
+ private DataTypeStyle dataTypeStyle;
+
+ private ExtendedCSSEngine engine;
+
+ public CSSDataTypeStyleDelegate(DataTypeStyle dataTypeStyle, ExtendedCSSEngine engine) {
+ this.dataTypeStyle = dataTypeStyle;
+ this.engine = engine;
+ }
+
+ ////////////////////////////////////////////////
+ // Implements a getter for each CSS property //
+ ////////////////////////////////////////////////
+
+ public java.lang.String getCSSName() {
+ CSSValue cssValue = engine.retrievePropertyValue(dataTypeStyle, "name");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getNamedStyle_Name().getDefaultValue();
+ return (String)defaultValue;
+ }
+ return (String)engine.convert(cssValue, String.class, null);
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSDescriptionStyleDelegate.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSDescriptionStyleDelegate.java
new file mode 100644
index 00000000000..9cf85f7ef02
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSDescriptionStyleDelegate.java
@@ -0,0 +1,43 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style.impl;
+
+import org.eclipse.gmf.runtime.notation.DescriptionStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSDescriptionStyle;
+import org.w3c.dom.css.CSSValue;
+
+public class CSSDescriptionStyleDelegate implements CSSDescriptionStyle {
+
+ private DescriptionStyle descriptionStyle;
+
+ private ExtendedCSSEngine engine;
+
+ public CSSDescriptionStyleDelegate(DescriptionStyle descriptionStyle, ExtendedCSSEngine engine) {
+ this.descriptionStyle = descriptionStyle;
+ this.engine = engine;
+ }
+
+ ////////////////////////////////////////////////
+ // Implements a getter for each CSS property //
+ ////////////////////////////////////////////////
+
+ public java.lang.String getCSSDescription() {
+ CSSValue cssValue = engine.retrievePropertyValue(descriptionStyle, "description");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getDescriptionStyle_Description().getDefaultValue();
+ return (String)defaultValue;
+ }
+ return (String)engine.convert(cssValue, String.class, null);
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSDiagramLinkStyleDelegate.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSDiagramLinkStyleDelegate.java
new file mode 100644
index 00000000000..5c3f276b80d
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSDiagramLinkStyleDelegate.java
@@ -0,0 +1,33 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style.impl;
+
+import org.eclipse.gmf.runtime.notation.DiagramLinkStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSDiagramLinkStyle;
+
+public class CSSDiagramLinkStyleDelegate implements CSSDiagramLinkStyle {
+
+ private DiagramLinkStyle diagramLinkStyle;
+
+ private ExtendedCSSEngine engine;
+
+ public CSSDiagramLinkStyleDelegate(DiagramLinkStyle diagramLinkStyle, ExtendedCSSEngine engine) {
+ this.diagramLinkStyle = diagramLinkStyle;
+ this.engine = engine;
+ }
+
+ ////////////////////////////////////////////////
+ // Implements a getter for each CSS property //
+ ////////////////////////////////////////////////
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSDiagramStyleDelegate.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSDiagramStyleDelegate.java
new file mode 100644
index 00000000000..74a03e1d251
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSDiagramStyleDelegate.java
@@ -0,0 +1,79 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style.impl;
+
+import org.eclipse.gmf.runtime.notation.DiagramStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSDiagramStyle;
+import org.w3c.dom.css.CSSValue;
+
+public class CSSDiagramStyleDelegate implements CSSDiagramStyle {
+
+ private DiagramStyle diagramStyle;
+
+ private ExtendedCSSEngine engine;
+
+ public CSSDiagramStyleDelegate(DiagramStyle diagramStyle, ExtendedCSSEngine engine) {
+ this.diagramStyle = diagramStyle;
+ this.engine = engine;
+ }
+
+ ////////////////////////////////////////////////
+ // Implements a getter for each CSS property //
+ ////////////////////////////////////////////////
+
+ public int getCSSPageX() {
+ CSSValue cssValue = engine.retrievePropertyValue(diagramStyle, "pageX");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getPageStyle_PageX().getDefaultValue();
+ return (Integer)defaultValue;
+ }
+ return (Integer)engine.convert(cssValue, Integer.class, null);
+ }
+
+ public int getCSSPageY() {
+ CSSValue cssValue = engine.retrievePropertyValue(diagramStyle, "pageY");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getPageStyle_PageY().getDefaultValue();
+ return (Integer)defaultValue;
+ }
+ return (Integer)engine.convert(cssValue, Integer.class, null);
+ }
+
+ public int getCSSPageWidth() {
+ CSSValue cssValue = engine.retrievePropertyValue(diagramStyle, "pageWidth");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getPageStyle_PageWidth().getDefaultValue();
+ return (Integer)defaultValue;
+ }
+ return (Integer)engine.convert(cssValue, Integer.class, null);
+ }
+
+ public int getCSSPageHeight() {
+ CSSValue cssValue = engine.retrievePropertyValue(diagramStyle, "pageHeight");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getPageStyle_PageHeight().getDefaultValue();
+ return (Integer)defaultValue;
+ }
+ return (Integer)engine.convert(cssValue, Integer.class, null);
+ }
+
+ public java.lang.String getCSSDescription() {
+ CSSValue cssValue = engine.retrievePropertyValue(diagramStyle, "description");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getDescriptionStyle_Description().getDefaultValue();
+ return (String)defaultValue;
+ }
+ return (String)engine.convert(cssValue, String.class, null);
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSDrawerStyleDelegate.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSDrawerStyleDelegate.java
new file mode 100644
index 00000000000..a12158362ed
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSDrawerStyleDelegate.java
@@ -0,0 +1,43 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style.impl;
+
+import org.eclipse.gmf.runtime.notation.DrawerStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSDrawerStyle;
+import org.w3c.dom.css.CSSValue;
+
+public class CSSDrawerStyleDelegate implements CSSDrawerStyle {
+
+ private DrawerStyle drawerStyle;
+
+ private ExtendedCSSEngine engine;
+
+ public CSSDrawerStyleDelegate(DrawerStyle drawerStyle, ExtendedCSSEngine engine) {
+ this.drawerStyle = drawerStyle;
+ this.engine = engine;
+ }
+
+ ////////////////////////////////////////////////
+ // Implements a getter for each CSS property //
+ ////////////////////////////////////////////////
+
+ public boolean isCSSCollapsed() {
+ CSSValue cssValue = engine.retrievePropertyValue(drawerStyle, "collapsed");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getDrawerStyle_Collapsed().getDefaultValue();
+ return (Boolean)defaultValue;
+ }
+ return (Boolean)engine.convert(cssValue, Boolean.class, null);
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSFillStyleDelegate.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSFillStyleDelegate.java
new file mode 100644
index 00000000000..cf8e083cfa3
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSFillStyleDelegate.java
@@ -0,0 +1,57 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style.impl;
+
+import org.eclipse.gmf.runtime.notation.FillStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.helper.GradientHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSFillStyle;
+import org.w3c.dom.css.CSSValue;
+
+public class CSSFillStyleDelegate implements CSSFillStyle {
+
+ private FillStyle fillStyle;
+
+ private ExtendedCSSEngine engine;
+
+ public CSSFillStyleDelegate(FillStyle fillStyle, ExtendedCSSEngine engine) {
+ this.fillStyle = fillStyle;
+ this.engine = engine;
+ }
+
+ ////////////////////////////////////////////////
+ // Implements a getter for each CSS property //
+ ////////////////////////////////////////////////
+
+ public int getCSSFillColor() {
+ CSSValue cssValue = engine.retrievePropertyValue(fillStyle, "fillColor");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getFillStyle_FillColor().getDefaultValue();
+ return (Integer)defaultValue;
+ }
+ return (Integer)engine.convert(cssValue, "GMFColor", null);
+ }
+
+ public int getCSSTransparency() {
+ CSSValue cssValue = engine.retrievePropertyValue(fillStyle, "transparency");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getFillStyle_Transparency().getDefaultValue();
+ return (Integer)defaultValue;
+ }
+ return (Integer)engine.convert(cssValue, Integer.class, null);
+ }
+
+ public org.eclipse.gmf.runtime.notation.datatype.GradientData getCSSGradient() {
+ return GradientHelper.computeGradient(engine, fillStyle);
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSFilteringStyleDelegate.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSFilteringStyleDelegate.java
new file mode 100644
index 00000000000..9bcf85bb90d
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSFilteringStyleDelegate.java
@@ -0,0 +1,53 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style.impl;
+
+import org.eclipse.gmf.runtime.notation.Filtering;
+import org.eclipse.gmf.runtime.notation.FilteringStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSFilteringStyle;
+import org.w3c.dom.css.CSSValue;
+
+public class CSSFilteringStyleDelegate implements CSSFilteringStyle {
+
+ private FilteringStyle filteringStyle;
+
+ private ExtendedCSSEngine engine;
+
+ public CSSFilteringStyleDelegate(FilteringStyle filteringStyle, ExtendedCSSEngine engine) {
+ this.filteringStyle = filteringStyle;
+ this.engine = engine;
+ }
+
+ ////////////////////////////////////////////////
+ // Implements a getter for each CSS property //
+ ////////////////////////////////////////////////
+
+ public Filtering getCSSFiltering() {
+ CSSValue cssValue = engine.retrievePropertyValue(filteringStyle, "filtering");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getFilteringStyle_Filtering().getDefaultValue();
+ return (Filtering)defaultValue;
+ }
+ return Filtering.get(cssValue.getCssText());
+ }
+
+ public java.util.List getCSSFilteringKeys() {
+ CSSValue cssValue = engine.retrievePropertyValue(filteringStyle, "filteringKeys");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getFilteringStyle_FilteringKeys().getDefaultValue();
+ return (java.util.List)defaultValue;
+ }
+ return null;
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSFontStyleDelegate.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSFontStyleDelegate.java
new file mode 100644
index 00000000000..4e90054981d
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSFontStyleDelegate.java
@@ -0,0 +1,97 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style.impl;
+
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSFontStyle;
+import org.w3c.dom.css.CSSValue;
+
+public class CSSFontStyleDelegate implements CSSFontStyle {
+
+ private FontStyle fontStyle;
+
+ private ExtendedCSSEngine engine;
+
+ public CSSFontStyleDelegate(FontStyle fontStyle, ExtendedCSSEngine engine) {
+ this.fontStyle = fontStyle;
+ this.engine = engine;
+ }
+
+ ////////////////////////////////////////////////
+ // Implements a getter for each CSS property //
+ ////////////////////////////////////////////////
+
+ public int getCSSFontColor() {
+ CSSValue cssValue = engine.retrievePropertyValue(fontStyle, "fontColor");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getFontStyle_FontColor().getDefaultValue();
+ return (Integer)defaultValue;
+ }
+ return (Integer)engine.convert(cssValue, "GMFColor", null);
+ }
+
+ public java.lang.String getCSSFontName() {
+ CSSValue cssValue = engine.retrievePropertyValue(fontStyle, "fontName");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getFontStyle_FontName().getDefaultValue();
+ return (String)defaultValue;
+ }
+ return (String)engine.convert(cssValue, String.class, null);
+ }
+
+ public int getCSSFontHeight() {
+ CSSValue cssValue = engine.retrievePropertyValue(fontStyle, "fontHeight");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getFontStyle_FontHeight().getDefaultValue();
+ return (Integer)defaultValue;
+ }
+ return (Integer)engine.convert(cssValue, Integer.class, null);
+ }
+
+ public boolean isCSSBold() {
+ CSSValue cssValue = engine.retrievePropertyValue(fontStyle, "bold");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getFontStyle_Bold().getDefaultValue();
+ return (Boolean)defaultValue;
+ }
+ return (Boolean)engine.convert(cssValue, Boolean.class, null);
+ }
+
+ public boolean isCSSItalic() {
+ CSSValue cssValue = engine.retrievePropertyValue(fontStyle, "italic");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getFontStyle_Italic().getDefaultValue();
+ return (Boolean)defaultValue;
+ }
+ return (Boolean)engine.convert(cssValue, Boolean.class, null);
+ }
+
+ public boolean isCSSUnderline() {
+ CSSValue cssValue = engine.retrievePropertyValue(fontStyle, "underline");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getFontStyle_Underline().getDefaultValue();
+ return (Boolean)defaultValue;
+ }
+ return (Boolean)engine.convert(cssValue, Boolean.class, null);
+ }
+
+ public boolean isCSSStrikeThrough() {
+ CSSValue cssValue = engine.retrievePropertyValue(fontStyle, "strikeThrough");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().getDefaultValue();
+ return (Boolean)defaultValue;
+ }
+ return (Boolean)engine.convert(cssValue, Boolean.class, null);
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSGuideStyleDelegate.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSGuideStyleDelegate.java
new file mode 100644
index 00000000000..b486201d060
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSGuideStyleDelegate.java
@@ -0,0 +1,33 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style.impl;
+
+import org.eclipse.gmf.runtime.notation.GuideStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSGuideStyle;
+
+public class CSSGuideStyleDelegate implements CSSGuideStyle {
+
+ private GuideStyle guideStyle;
+
+ private ExtendedCSSEngine engine;
+
+ public CSSGuideStyleDelegate(GuideStyle guideStyle, ExtendedCSSEngine engine) {
+ this.guideStyle = guideStyle;
+ this.engine = engine;
+ }
+
+ ////////////////////////////////////////////////
+ // Implements a getter for each CSS property //
+ ////////////////////////////////////////////////
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSHintedDiagramLinkStyleDelegate.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSHintedDiagramLinkStyleDelegate.java
new file mode 100644
index 00000000000..eaf7a3554a2
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSHintedDiagramLinkStyleDelegate.java
@@ -0,0 +1,43 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style.impl;
+
+import org.eclipse.gmf.runtime.notation.HintedDiagramLinkStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSHintedDiagramLinkStyle;
+import org.w3c.dom.css.CSSValue;
+
+public class CSSHintedDiagramLinkStyleDelegate implements CSSHintedDiagramLinkStyle {
+
+ private HintedDiagramLinkStyle hintedDiagramLinkStyle;
+
+ private ExtendedCSSEngine engine;
+
+ public CSSHintedDiagramLinkStyleDelegate(HintedDiagramLinkStyle hintedDiagramLinkStyle, ExtendedCSSEngine engine) {
+ this.hintedDiagramLinkStyle = hintedDiagramLinkStyle;
+ this.engine = engine;
+ }
+
+ ////////////////////////////////////////////////
+ // Implements a getter for each CSS property //
+ ////////////////////////////////////////////////
+
+ public java.lang.String getCSSHint() {
+ CSSValue cssValue = engine.retrievePropertyValue(hintedDiagramLinkStyle, "hint");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getHintedDiagramLinkStyle_Hint().getDefaultValue();
+ return (String)defaultValue;
+ }
+ return (String)engine.convert(cssValue, String.class, null);
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSImageBufferStyleDelegate.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSImageBufferStyleDelegate.java
new file mode 100644
index 00000000000..0338871689e
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSImageBufferStyleDelegate.java
@@ -0,0 +1,52 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style.impl;
+
+import org.eclipse.gmf.runtime.notation.ImageBufferStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSImageBufferStyle;
+import org.w3c.dom.css.CSSValue;
+
+public class CSSImageBufferStyleDelegate implements CSSImageBufferStyle {
+
+ private ImageBufferStyle imageBufferStyle;
+
+ private ExtendedCSSEngine engine;
+
+ public CSSImageBufferStyleDelegate(ImageBufferStyle imageBufferStyle, ExtendedCSSEngine engine) {
+ this.imageBufferStyle = imageBufferStyle;
+ this.engine = engine;
+ }
+
+ ////////////////////////////////////////////////
+ // Implements a getter for each CSS property //
+ ////////////////////////////////////////////////
+
+ public java.lang.Boolean getCSSAntiAlias() {
+ CSSValue cssValue = engine.retrievePropertyValue(imageBufferStyle, "antiAlias");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getImageStyle_AntiAlias().getDefaultValue();
+ return (java.lang.Boolean)defaultValue;
+ }
+ return null;
+ }
+
+ public java.lang.Boolean getCSSMaintainAspectRatio() {
+ CSSValue cssValue = engine.retrievePropertyValue(imageBufferStyle, "maintainAspectRatio");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getImageStyle_MaintainAspectRatio().getDefaultValue();
+ return (java.lang.Boolean)defaultValue;
+ }
+ return null;
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSImageStyleDelegate.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSImageStyleDelegate.java
new file mode 100644
index 00000000000..848cefac75a
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSImageStyleDelegate.java
@@ -0,0 +1,52 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style.impl;
+
+import org.eclipse.gmf.runtime.notation.ImageStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSImageStyle;
+import org.w3c.dom.css.CSSValue;
+
+public class CSSImageStyleDelegate implements CSSImageStyle {
+
+ private ImageStyle imageStyle;
+
+ private ExtendedCSSEngine engine;
+
+ public CSSImageStyleDelegate(ImageStyle imageStyle, ExtendedCSSEngine engine) {
+ this.imageStyle = imageStyle;
+ this.engine = engine;
+ }
+
+ ////////////////////////////////////////////////
+ // Implements a getter for each CSS property //
+ ////////////////////////////////////////////////
+
+ public java.lang.Boolean getCSSAntiAlias() {
+ CSSValue cssValue = engine.retrievePropertyValue(imageStyle, "antiAlias");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getImageStyle_AntiAlias().getDefaultValue();
+ return (java.lang.Boolean)defaultValue;
+ }
+ return null;
+ }
+
+ public java.lang.Boolean getCSSMaintainAspectRatio() {
+ CSSValue cssValue = engine.retrievePropertyValue(imageStyle, "maintainAspectRatio");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getImageStyle_MaintainAspectRatio().getDefaultValue();
+ return (java.lang.Boolean)defaultValue;
+ }
+ return null;
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSLineStyleDelegate.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSLineStyleDelegate.java
new file mode 100644
index 00000000000..a8bd75d6cbf
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSLineStyleDelegate.java
@@ -0,0 +1,52 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style.impl;
+
+import org.eclipse.gmf.runtime.notation.LineStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSLineStyle;
+import org.w3c.dom.css.CSSValue;
+
+public class CSSLineStyleDelegate implements CSSLineStyle {
+
+ private LineStyle lineStyle;
+
+ private ExtendedCSSEngine engine;
+
+ public CSSLineStyleDelegate(LineStyle lineStyle, ExtendedCSSEngine engine) {
+ this.lineStyle = lineStyle;
+ this.engine = engine;
+ }
+
+ ////////////////////////////////////////////////
+ // Implements a getter for each CSS property //
+ ////////////////////////////////////////////////
+
+ public int getCSSLineColor() {
+ CSSValue cssValue = engine.retrievePropertyValue(lineStyle, "lineColor");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getLineStyle_LineColor().getDefaultValue();
+ return (Integer)defaultValue;
+ }
+ return (Integer)engine.convert(cssValue, "GMFColor", null);
+ }
+
+ public int getCSSLineWidth() {
+ CSSValue cssValue = engine.retrievePropertyValue(lineStyle, "lineWidth");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getLineStyle_LineWidth().getDefaultValue();
+ return (Integer)defaultValue;
+ }
+ return (Integer)engine.convert(cssValue, Integer.class, null);
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSLineTypeStyleDelegate.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSLineTypeStyleDelegate.java
new file mode 100644
index 00000000000..18e62462cb1
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSLineTypeStyleDelegate.java
@@ -0,0 +1,44 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style.impl;
+
+import org.eclipse.gmf.runtime.notation.LineType;
+import org.eclipse.gmf.runtime.notation.LineTypeStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSLineTypeStyle;
+import org.w3c.dom.css.CSSValue;
+
+public class CSSLineTypeStyleDelegate implements CSSLineTypeStyle {
+
+ private LineTypeStyle lineTypeStyle;
+
+ private ExtendedCSSEngine engine;
+
+ public CSSLineTypeStyleDelegate(LineTypeStyle lineTypeStyle, ExtendedCSSEngine engine) {
+ this.lineTypeStyle = lineTypeStyle;
+ this.engine = engine;
+ }
+
+ ////////////////////////////////////////////////
+ // Implements a getter for each CSS property //
+ ////////////////////////////////////////////////
+
+ public LineType getCSSLineType() {
+ CSSValue cssValue = engine.retrievePropertyValue(lineTypeStyle, "lineType");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getLineTypeStyle_LineType().getDefaultValue();
+ return (LineType)defaultValue;
+ }
+ return LineType.get(cssValue.getCssText());
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSMultiDiagramLinkStyleDelegate.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSMultiDiagramLinkStyleDelegate.java
new file mode 100644
index 00000000000..74e06c37010
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSMultiDiagramLinkStyleDelegate.java
@@ -0,0 +1,33 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style.impl;
+
+import org.eclipse.gmf.runtime.notation.MultiDiagramLinkStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSMultiDiagramLinkStyle;
+
+public class CSSMultiDiagramLinkStyleDelegate implements CSSMultiDiagramLinkStyle {
+
+ private MultiDiagramLinkStyle multiDiagramLinkStyle;
+
+ private ExtendedCSSEngine engine;
+
+ public CSSMultiDiagramLinkStyleDelegate(MultiDiagramLinkStyle multiDiagramLinkStyle, ExtendedCSSEngine engine) {
+ this.multiDiagramLinkStyle = multiDiagramLinkStyle;
+ this.engine = engine;
+ }
+
+ ////////////////////////////////////////////////
+ // Implements a getter for each CSS property //
+ ////////////////////////////////////////////////
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSNamedStyleDelegate.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSNamedStyleDelegate.java
new file mode 100644
index 00000000000..6da8c32c504
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSNamedStyleDelegate.java
@@ -0,0 +1,43 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style.impl;
+
+import org.eclipse.gmf.runtime.notation.NamedStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSNamedStyle;
+import org.w3c.dom.css.CSSValue;
+
+public class CSSNamedStyleDelegate implements CSSNamedStyle {
+
+ private NamedStyle namedStyle;
+
+ private ExtendedCSSEngine engine;
+
+ public CSSNamedStyleDelegate(NamedStyle namedStyle, ExtendedCSSEngine engine) {
+ this.namedStyle = namedStyle;
+ this.engine = engine;
+ }
+
+ ////////////////////////////////////////////////
+ // Implements a getter for each CSS property //
+ ////////////////////////////////////////////////
+
+ public java.lang.String getCSSName() {
+ CSSValue cssValue = engine.retrievePropertyValue(namedStyle, "name");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getNamedStyle_Name().getDefaultValue();
+ return (String)defaultValue;
+ }
+ return (String)engine.convert(cssValue, String.class, null);
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSPageStyleDelegate.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSPageStyleDelegate.java
new file mode 100644
index 00000000000..de900903bb2
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSPageStyleDelegate.java
@@ -0,0 +1,70 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style.impl;
+
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.PageStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSPageStyle;
+import org.w3c.dom.css.CSSValue;
+
+public class CSSPageStyleDelegate implements CSSPageStyle {
+
+ private PageStyle pageStyle;
+
+ private ExtendedCSSEngine engine;
+
+ public CSSPageStyleDelegate(PageStyle pageStyle, ExtendedCSSEngine engine) {
+ this.pageStyle = pageStyle;
+ this.engine = engine;
+ }
+
+ ////////////////////////////////////////////////
+ // Implements a getter for each CSS property //
+ ////////////////////////////////////////////////
+
+ public int getCSSPageX() {
+ CSSValue cssValue = engine.retrievePropertyValue(pageStyle, "pageX");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getPageStyle_PageX().getDefaultValue();
+ return (Integer)defaultValue;
+ }
+ return (Integer)engine.convert(cssValue, Integer.class, null);
+ }
+
+ public int getCSSPageY() {
+ CSSValue cssValue = engine.retrievePropertyValue(pageStyle, "pageY");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getPageStyle_PageY().getDefaultValue();
+ return (Integer)defaultValue;
+ }
+ return (Integer)engine.convert(cssValue, Integer.class, null);
+ }
+
+ public int getCSSPageWidth() {
+ CSSValue cssValue = engine.retrievePropertyValue(pageStyle, "pageWidth");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getPageStyle_PageWidth().getDefaultValue();
+ return (Integer)defaultValue;
+ }
+ return (Integer)engine.convert(cssValue, Integer.class, null);
+ }
+
+ public int getCSSPageHeight() {
+ CSSValue cssValue = engine.retrievePropertyValue(pageStyle, "pageHeight");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getPageStyle_PageHeight().getDefaultValue();
+ return (Integer)defaultValue;
+ }
+ return (Integer)engine.convert(cssValue, Integer.class, null);
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSPropertiesSetStyleDelegate.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSPropertiesSetStyleDelegate.java
new file mode 100644
index 00000000000..7f3a79b69e8
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSPropertiesSetStyleDelegate.java
@@ -0,0 +1,43 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style.impl;
+
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.PropertiesSetStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSPropertiesSetStyle;
+import org.w3c.dom.css.CSSValue;
+
+public class CSSPropertiesSetStyleDelegate implements CSSPropertiesSetStyle {
+
+ private PropertiesSetStyle propertiesSetStyle;
+
+ private ExtendedCSSEngine engine;
+
+ public CSSPropertiesSetStyleDelegate(PropertiesSetStyle propertiesSetStyle, ExtendedCSSEngine engine) {
+ this.propertiesSetStyle = propertiesSetStyle;
+ this.engine = engine;
+ }
+
+ ////////////////////////////////////////////////
+ // Implements a getter for each CSS property //
+ ////////////////////////////////////////////////
+
+ public java.lang.String getCSSName() {
+ CSSValue cssValue = engine.retrievePropertyValue(propertiesSetStyle, "name");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getNamedStyle_Name().getDefaultValue();
+ return (String)defaultValue;
+ }
+ return (String)engine.convert(cssValue, String.class, null);
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSRoundedCornersStyleDelegate.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSRoundedCornersStyleDelegate.java
new file mode 100644
index 00000000000..60ecd63fb03
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSRoundedCornersStyleDelegate.java
@@ -0,0 +1,43 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style.impl;
+
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.RoundedCornersStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSRoundedCornersStyle;
+import org.w3c.dom.css.CSSValue;
+
+public class CSSRoundedCornersStyleDelegate implements CSSRoundedCornersStyle {
+
+ private RoundedCornersStyle roundedCornersStyle;
+
+ private ExtendedCSSEngine engine;
+
+ public CSSRoundedCornersStyleDelegate(RoundedCornersStyle roundedCornersStyle, ExtendedCSSEngine engine) {
+ this.roundedCornersStyle = roundedCornersStyle;
+ this.engine = engine;
+ }
+
+ ////////////////////////////////////////////////
+ // Implements a getter for each CSS property //
+ ////////////////////////////////////////////////
+
+ public int getCSSRoundedBendpointsRadius() {
+ CSSValue cssValue = engine.retrievePropertyValue(roundedCornersStyle, "roundedBendpointsRadius");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getRoundedCornersStyle_RoundedBendpointsRadius().getDefaultValue();
+ return (Integer)defaultValue;
+ }
+ return (Integer)engine.convert(cssValue, Integer.class, null);
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSRoutingStyleDelegate.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSRoutingStyleDelegate.java
new file mode 100644
index 00000000000..129db80c098
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSRoutingStyleDelegate.java
@@ -0,0 +1,110 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style.impl;
+
+import org.eclipse.gmf.runtime.notation.JumpLinkStatus;
+import org.eclipse.gmf.runtime.notation.JumpLinkType;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.Routing;
+import org.eclipse.gmf.runtime.notation.RoutingStyle;
+import org.eclipse.gmf.runtime.notation.Smoothness;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSRoutingStyle;
+import org.w3c.dom.css.CSSValue;
+
+public class CSSRoutingStyleDelegate implements CSSRoutingStyle {
+
+ private RoutingStyle routingStyle;
+
+ private ExtendedCSSEngine engine;
+
+ public CSSRoutingStyleDelegate(RoutingStyle routingStyle, ExtendedCSSEngine engine) {
+ this.routingStyle = routingStyle;
+ this.engine = engine;
+ }
+
+ ////////////////////////////////////////////////
+ // Implements a getter for each CSS property //
+ ////////////////////////////////////////////////
+
+ public int getCSSRoundedBendpointsRadius() {
+ CSSValue cssValue = engine.retrievePropertyValue(routingStyle, "roundedBendpointsRadius");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getRoundedCornersStyle_RoundedBendpointsRadius().getDefaultValue();
+ return (Integer)defaultValue;
+ }
+ return (Integer)engine.convert(cssValue, Integer.class, null);
+ }
+
+ public Routing getCSSRouting() {
+ CSSValue cssValue = engine.retrievePropertyValue(routingStyle, "routing");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getRoutingStyle_Routing().getDefaultValue();
+ return (Routing)defaultValue;
+ }
+ return Routing.get(cssValue.getCssText());
+ }
+
+ public Smoothness getCSSSmoothness() {
+ CSSValue cssValue = engine.retrievePropertyValue(routingStyle, "smoothness");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getRoutingStyle_Smoothness().getDefaultValue();
+ return (Smoothness)defaultValue;
+ }
+ return Smoothness.get(cssValue.getCssText());
+ }
+
+ public boolean isCSSAvoidObstructions() {
+ CSSValue cssValue = engine.retrievePropertyValue(routingStyle, "avoidObstructions");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getRoutingStyle_AvoidObstructions().getDefaultValue();
+ return (Boolean)defaultValue;
+ }
+ return (Boolean)engine.convert(cssValue, Boolean.class, null);
+ }
+
+ public boolean isCSSClosestDistance() {
+ CSSValue cssValue = engine.retrievePropertyValue(routingStyle, "closestDistance");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getRoutingStyle_ClosestDistance().getDefaultValue();
+ return (Boolean)defaultValue;
+ }
+ return (Boolean)engine.convert(cssValue, Boolean.class, null);
+ }
+
+ public JumpLinkStatus getCSSJumpLinkStatus() {
+ CSSValue cssValue = engine.retrievePropertyValue(routingStyle, "jumpLinkStatus");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getRoutingStyle_JumpLinkStatus().getDefaultValue();
+ return (JumpLinkStatus)defaultValue;
+ }
+ return JumpLinkStatus.get(cssValue.getCssText());
+ }
+
+ public JumpLinkType getCSSJumpLinkType() {
+ CSSValue cssValue = engine.retrievePropertyValue(routingStyle, "jumpLinkType");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getRoutingStyle_JumpLinkType().getDefaultValue();
+ return (JumpLinkType)defaultValue;
+ }
+ return JumpLinkType.get(cssValue.getCssText());
+ }
+
+ public boolean isCSSJumpLinksReverse() {
+ CSSValue cssValue = engine.retrievePropertyValue(routingStyle, "jumpLinksReverse");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getRoutingStyle_JumpLinksReverse().getDefaultValue();
+ return (Boolean)defaultValue;
+ }
+ return (Boolean)engine.convert(cssValue, Boolean.class, null);
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSShapeStyleDelegate.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSShapeStyleDelegate.java
new file mode 100644
index 00000000000..2695076a88d
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSShapeStyleDelegate.java
@@ -0,0 +1,156 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style.impl;
+
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.ShapeStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.helper.GradientHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSShapeStyle;
+import org.w3c.dom.css.CSSValue;
+
+public class CSSShapeStyleDelegate implements CSSShapeStyle {
+
+ private ShapeStyle shapeStyle;
+
+ private ExtendedCSSEngine engine;
+
+ public CSSShapeStyleDelegate(ShapeStyle shapeStyle, ExtendedCSSEngine engine) {
+ this.shapeStyle = shapeStyle;
+ this.engine = engine;
+ }
+
+ ////////////////////////////////////////////////
+ // Implements a getter for each CSS property //
+ ////////////////////////////////////////////////
+
+ public int getCSSFontColor() {
+ CSSValue cssValue = engine.retrievePropertyValue(shapeStyle, "fontColor");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getFontStyle_FontColor().getDefaultValue();
+ return (Integer)defaultValue;
+ }
+ return (Integer)engine.convert(cssValue, "GMFColor", null);
+ }
+
+ public java.lang.String getCSSFontName() {
+ CSSValue cssValue = engine.retrievePropertyValue(shapeStyle, "fontName");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getFontStyle_FontName().getDefaultValue();
+ return (String)defaultValue;
+ }
+ return (String)engine.convert(cssValue, String.class, null);
+ }
+
+ public int getCSSFontHeight() {
+ CSSValue cssValue = engine.retrievePropertyValue(shapeStyle, "fontHeight");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getFontStyle_FontHeight().getDefaultValue();
+ return (Integer)defaultValue;
+ }
+ return (Integer)engine.convert(cssValue, Integer.class, null);
+ }
+
+ public boolean isCSSBold() {
+ CSSValue cssValue = engine.retrievePropertyValue(shapeStyle, "bold");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getFontStyle_Bold().getDefaultValue();
+ return (Boolean)defaultValue;
+ }
+ return (Boolean)engine.convert(cssValue, Boolean.class, null);
+ }
+
+ public boolean isCSSItalic() {
+ CSSValue cssValue = engine.retrievePropertyValue(shapeStyle, "italic");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getFontStyle_Italic().getDefaultValue();
+ return (Boolean)defaultValue;
+ }
+ return (Boolean)engine.convert(cssValue, Boolean.class, null);
+ }
+
+ public boolean isCSSUnderline() {
+ CSSValue cssValue = engine.retrievePropertyValue(shapeStyle, "underline");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getFontStyle_Underline().getDefaultValue();
+ return (Boolean)defaultValue;
+ }
+ return (Boolean)engine.convert(cssValue, Boolean.class, null);
+ }
+
+ public boolean isCSSStrikeThrough() {
+ CSSValue cssValue = engine.retrievePropertyValue(shapeStyle, "strikeThrough");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().getDefaultValue();
+ return (Boolean)defaultValue;
+ }
+ return (Boolean)engine.convert(cssValue, Boolean.class, null);
+ }
+
+ public java.lang.String getCSSDescription() {
+ CSSValue cssValue = engine.retrievePropertyValue(shapeStyle, "description");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getDescriptionStyle_Description().getDefaultValue();
+ return (String)defaultValue;
+ }
+ return (String)engine.convert(cssValue, String.class, null);
+ }
+
+ public int getCSSFillColor() {
+ CSSValue cssValue = engine.retrievePropertyValue(shapeStyle, "fillColor");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getFillStyle_FillColor().getDefaultValue();
+ return (Integer)defaultValue;
+ }
+ return (Integer)engine.convert(cssValue, "GMFColor", null);
+ }
+
+ public int getCSSTransparency() {
+ CSSValue cssValue = engine.retrievePropertyValue(shapeStyle, "transparency");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getFillStyle_Transparency().getDefaultValue();
+ return (Integer)defaultValue;
+ }
+ return (Integer)engine.convert(cssValue, Integer.class, null);
+ }
+
+ public org.eclipse.gmf.runtime.notation.datatype.GradientData getCSSGradient() {
+ return GradientHelper.computeGradient(engine, shapeStyle);
+ }
+
+ public int getCSSLineColor() {
+ CSSValue cssValue = engine.retrievePropertyValue(shapeStyle, "lineColor");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getLineStyle_LineColor().getDefaultValue();
+ return (Integer)defaultValue;
+ }
+ return (Integer)engine.convert(cssValue, "GMFColor", null);
+ }
+
+ public int getCSSLineWidth() {
+ CSSValue cssValue = engine.retrievePropertyValue(shapeStyle, "lineWidth");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getLineStyle_LineWidth().getDefaultValue();
+ return (Integer)defaultValue;
+ }
+ return (Integer)engine.convert(cssValue, Integer.class, null);
+ }
+
+ public int getCSSRoundedBendpointsRadius() {
+ CSSValue cssValue = engine.retrievePropertyValue(shapeStyle, "roundedBendpointsRadius");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getRoundedCornersStyle_RoundedBendpointsRadius().getDefaultValue();
+ return (Integer)defaultValue;
+ }
+ return (Integer)engine.convert(cssValue, Integer.class, null);
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSSortingStyleDelegate.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSSortingStyleDelegate.java
new file mode 100644
index 00000000000..15294bf1926
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSSortingStyleDelegate.java
@@ -0,0 +1,53 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style.impl;
+
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.Sorting;
+import org.eclipse.gmf.runtime.notation.SortingStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSSortingStyle;
+import org.w3c.dom.css.CSSValue;
+
+public class CSSSortingStyleDelegate implements CSSSortingStyle {
+
+ private SortingStyle sortingStyle;
+
+ private ExtendedCSSEngine engine;
+
+ public CSSSortingStyleDelegate(SortingStyle sortingStyle, ExtendedCSSEngine engine) {
+ this.sortingStyle = sortingStyle;
+ this.engine = engine;
+ }
+
+ ////////////////////////////////////////////////
+ // Implements a getter for each CSS property //
+ ////////////////////////////////////////////////
+
+ public Sorting getCSSSorting() {
+ CSSValue cssValue = engine.retrievePropertyValue(sortingStyle, "sorting");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getSortingStyle_Sorting().getDefaultValue();
+ return (Sorting)defaultValue;
+ }
+ return Sorting.get(cssValue.getCssText());
+ }
+
+ public java.util.Map getCSSSortingKeys() {
+ CSSValue cssValue = engine.retrievePropertyValue(sortingStyle, "sortingKeys");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getSortingStyle_SortingKeys().getDefaultValue();
+ return (java.util.Map)defaultValue;
+ }
+ return null;
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSTextStyleDelegate.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSTextStyleDelegate.java
new file mode 100644
index 00000000000..c815646b8a0
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSTextStyleDelegate.java
@@ -0,0 +1,44 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style.impl;
+
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.TextAlignment;
+import org.eclipse.gmf.runtime.notation.TextStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSTextStyle;
+import org.w3c.dom.css.CSSValue;
+
+public class CSSTextStyleDelegate implements CSSTextStyle {
+
+ private TextStyle textStyle;
+
+ private ExtendedCSSEngine engine;
+
+ public CSSTextStyleDelegate(TextStyle textStyle, ExtendedCSSEngine engine) {
+ this.textStyle = textStyle;
+ this.engine = engine;
+ }
+
+ ////////////////////////////////////////////////
+ // Implements a getter for each CSS property //
+ ////////////////////////////////////////////////
+
+ public TextAlignment getCSSTextAlignment() {
+ CSSValue cssValue = engine.retrievePropertyValue(textStyle, "textAlignment");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getTextStyle_TextAlignment().getDefaultValue();
+ return (TextAlignment)defaultValue;
+ }
+ return TextAlignment.get(cssValue.getCssText());
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSTitleStyleDelegate.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSTitleStyleDelegate.java
new file mode 100644
index 00000000000..85225e42316
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/style/impl/CSSTitleStyleDelegate.java
@@ -0,0 +1,43 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.style.impl;
+
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.TitleStyle;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.style.CSSTitleStyle;
+import org.w3c.dom.css.CSSValue;
+
+public class CSSTitleStyleDelegate implements CSSTitleStyle {
+
+ private TitleStyle titleStyle;
+
+ private ExtendedCSSEngine engine;
+
+ public CSSTitleStyleDelegate(TitleStyle titleStyle, ExtendedCSSEngine engine) {
+ this.titleStyle = titleStyle;
+ this.engine = engine;
+ }
+
+ ////////////////////////////////////////////////
+ // Implements a getter for each CSS property //
+ ////////////////////////////////////////////////
+
+ public boolean isCSSShowTitle() {
+ CSSValue cssValue = engine.retrievePropertyValue(titleStyle, "showTitle");
+ if(cssValue == null) {
+ Object defaultValue = NotationPackage.eINSTANCE.getTitleStyle_ShowTitle().getDefaultValue();
+ return (Boolean)defaultValue;
+ }
+ return (Boolean)engine.convert(cssValue, Boolean.class, null);
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/Activator.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/Activator.java
new file mode 100644
index 00000000000..2fb88878e2e
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/Activator.java
@@ -0,0 +1,75 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css;
+
+import org.eclipse.papyrus.infra.core.log.LogHelper;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.contexts.IContextService;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.papyrus.infra.gmfdiag.css"; //$NON-NLS-1$
+
+ public static final String CSS = "Papyrus CSS"; //ID of the CSS context //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ public static LogHelper log;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ log = new LogHelper(this);
+ IContextService contextService = (IContextService)PlatformUI.getWorkbench().getService(IContextService.class);
+ contextService.activateContext(CSS);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/converters/BooleanConverter.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/converters/BooleanConverter.java
new file mode 100644
index 00000000000..bf0dcd0ec79
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/converters/BooleanConverter.java
@@ -0,0 +1,38 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.converters;
+
+import org.eclipse.e4.ui.css.core.dom.properties.converters.AbstractCSSValueConverter;
+import org.eclipse.e4.ui.css.core.dom.properties.converters.ICSSValueConverterConfig;
+import org.eclipse.e4.ui.css.core.engine.CSSEngine;
+import org.w3c.dom.css.CSSPrimitiveValue;
+import org.w3c.dom.css.CSSValue;
+
+
+public class BooleanConverter extends AbstractCSSValueConverter {
+
+ public BooleanConverter() {
+ super(Boolean.class);
+ }
+
+ public Object convert(CSSValue value, CSSEngine engine, Object context) throws Exception {
+ if(value instanceof CSSPrimitiveValue) {
+ return Boolean.parseBoolean(((CSSPrimitiveValue)value).getStringValue());
+ }
+ throw new IllegalArgumentException("The value " + value + " is not a valid Boolean");
+ }
+
+ public String convert(Object value, CSSEngine engine, Object context, ICSSValueConverterConfig config) throws Exception {
+ throw new UnsupportedOperationException();
+ }
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/converters/ColorToGMFConverter.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/converters/ColorToGMFConverter.java
new file mode 100644
index 00000000000..02028af4de8
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/converters/ColorToGMFConverter.java
@@ -0,0 +1,86 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.converters;
+
+import org.eclipse.e4.ui.css.core.css2.CSS2ColorHelper;
+import org.eclipse.e4.ui.css.core.dom.properties.converters.AbstractCSSValueConverter;
+import org.eclipse.e4.ui.css.core.dom.properties.converters.ICSSValueConverterConfig;
+import org.eclipse.e4.ui.css.core.engine.CSSEngine;
+import org.eclipse.e4.ui.css.core.impl.dom.Measure;
+import org.w3c.dom.css.CSSPrimitiveValue;
+import org.w3c.dom.css.CSSValue;
+import org.w3c.dom.css.RGBColor;
+
+@SuppressWarnings("restriction")
+public class ColorToGMFConverter extends AbstractCSSValueConverter {
+
+ public static final String GMFColor = "GMFColor"; //$NON-NLS-1$
+
+ public ColorToGMFConverter() {
+ super(GMFColor);
+ }
+
+ public Object convert(CSSValue value, CSSEngine engine, Object context) throws Exception {
+ RGBColor color;
+ if(value instanceof RGBColor) {
+ color = (RGBColor)value;
+ } else if(value instanceof CSSPrimitiveValue) {
+ CSSPrimitiveValue cssValue = (CSSPrimitiveValue)value;
+ color = CSS2ColorHelper.getRGBColor(cssValue.getStringValue());
+ } else {
+ throw new IllegalArgumentException("Cannot convert " + value + " to GMF Color");
+ }
+
+ return getIntColor(color);
+ }
+
+ public String convert(Object value, CSSEngine engine, Object context, ICSSValueConverterConfig config) throws Exception {
+ throw new UnsupportedOperationException();
+ }
+
+ public static int getIntColor(RGBColor color) {
+ int red = getInt(color.getRed());
+ int green = getInt(color.getGreen());
+ int blue = getInt(color.getBlue());
+
+ return blue * 256 * 256 + green * 256 + red;
+ }
+
+ public static int getInt(CSSPrimitiveValue value) {
+ if(value instanceof Measure) {
+ Measure measure = (Measure)value;
+ return measure.getIntegerValue(CSSValue.CSS_PRIMITIVE_VALUE);
+ }
+ return (int)value.getFloatValue(CSSValue.CSS_PRIMITIVE_VALUE);
+ }
+
+ public static int getIntColor(String value, CSSValue cssValue) {
+ RGBColor color;
+ if(cssValue instanceof RGBColor) {
+ //color:rgb(125, 255, 0);
+ color = (RGBColor)cssValue;
+ } else {
+ //color:red; || color:#FFFFFF;
+ color = CSS2ColorHelper.getRGBColor(value);
+ }
+
+ if(color == null) {
+ try {
+ return Integer.parseInt(value);
+ } catch (NumberFormatException ex) {
+ return -1;
+ }
+ }
+
+ return getIntColor(color);
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/converters/IntegerConverter.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/converters/IntegerConverter.java
new file mode 100644
index 00000000000..aa0f15ad206
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/converters/IntegerConverter.java
@@ -0,0 +1,41 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.converters;
+
+import org.eclipse.e4.ui.css.core.dom.properties.converters.AbstractCSSValueConverter;
+import org.eclipse.e4.ui.css.core.dom.properties.converters.ICSSValueConverterConfig;
+import org.eclipse.e4.ui.css.core.engine.CSSEngine;
+import org.eclipse.e4.ui.css.core.impl.dom.Measure;
+import org.w3c.dom.css.CSSPrimitiveValue;
+import org.w3c.dom.css.CSSValue;
+
+
+public class IntegerConverter extends AbstractCSSValueConverter {
+
+ public IntegerConverter() {
+ super(Integer.class);
+ }
+
+ public Object convert(CSSValue value, CSSEngine engine, Object context) throws Exception {
+ if(value instanceof CSSPrimitiveValue) {
+ return (int)((CSSPrimitiveValue)value).getFloatValue(CSSPrimitiveValue.CSS_NUMBER);
+ }
+ if(value instanceof Measure) {
+ return (int)((Measure)value).getIntegerValue(Measure.CSS_NUMBER);
+ }
+ throw new IllegalArgumentException("The value " + value + " is not a valid Integer");
+ }
+
+ public String convert(Object value, CSSEngine engine, Object context, ICSSValueConverterConfig config) throws Exception {
+ throw new UnsupportedOperationException();
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/converters/StringConverter.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/converters/StringConverter.java
new file mode 100644
index 00000000000..c17671ad762
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/converters/StringConverter.java
@@ -0,0 +1,37 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.converters;
+
+import org.eclipse.e4.ui.css.core.dom.properties.converters.AbstractCSSValueConverter;
+import org.eclipse.e4.ui.css.core.dom.properties.converters.ICSSValueConverterConfig;
+import org.eclipse.e4.ui.css.core.engine.CSSEngine;
+import org.w3c.dom.css.CSSPrimitiveValue;
+import org.w3c.dom.css.CSSValue;
+
+
+public class StringConverter extends AbstractCSSValueConverter {
+
+ public StringConverter() {
+ super(String.class);
+ }
+
+ public Object convert(CSSValue value, CSSEngine engine, Object context) throws Exception {
+ if(value instanceof CSSPrimitiveValue) {
+ return ((CSSPrimitiveValue)value).getStringValue();
+ }
+ throw new IllegalArgumentException("The value " + value + " is not a valid String");
+ }
+
+ public String convert(Object value, CSSEngine engine, Object context, ICSSValueConverterConfig config) throws Exception {
+ throw new UnsupportedOperationException();
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/dom/GMFElementAdapter.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/dom/GMFElementAdapter.java
new file mode 100644
index 00000000000..93ef761dd34
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/dom/GMFElementAdapter.java
@@ -0,0 +1,420 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.dom;
+
+import static org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSAnnotations.CSS_ANNOTATION;
+import static org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSAnnotations.CSS_DIAGRAM_STYLESHEETS_KEY;
+import static org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSAnnotations.CSS_GMF_CLASS_KEY;
+import static org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSAnnotations.CSS_GMF_ID_KEY;
+import static org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSAnnotations.CSS_GMF_STYLE_KEY;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.databinding.observable.ChangeEvent;
+import org.eclipse.core.databinding.observable.IChangeListener;
+import org.eclipse.e4.ui.css.core.dom.ElementAdapter;
+import org.eclipse.e4.ui.css.core.engine.CSSEngine;
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EModelElement;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.NamedStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.StringListValueStyle;
+import org.eclipse.gmf.runtime.notation.StringValueStyle;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
+import org.eclipse.papyrus.infra.gmfdiag.common.listener.CustomStyleListener;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.helper.SemanticElementHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagram;
+import org.eclipse.papyrus.infra.tools.util.ListHelper;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+@SuppressWarnings("restriction")
+public class GMFElementAdapter extends ElementAdapter implements NodeList, IChangeListener {
+
+ //TODO : Use an extension point for this map, or find another way to map Diagram ID to CSS Element name
+ public static final Map<String, String> diagramNameMappings = new HashMap<String, String>();
+
+ static {
+ //UML
+ diagramNameMappings.put("CompositeStructure", "CompositeDiagram");
+ diagramNameMappings.put("Package", "PackageDiagram");
+ diagramNameMappings.put("PapyrusUMLActivityDiagram", "ActivityDiagram");
+ diagramNameMappings.put("PapyrusUMLClassDiagram", "ClassDiagram");
+ diagramNameMappings.put("PapyrusUMLCommunicationDiagram", "CommunicationDiagram");
+ diagramNameMappings.put("PapyrusUMLComponentDiagram", "ComponentDiagram");
+ diagramNameMappings.put("PapyrusUMLDeploymentDiagram", "DeploymentDiagram");
+ diagramNameMappings.put("PapyrusUMLProfileDiagram", "ProfileDiagram");
+ diagramNameMappings.put("PapyrusUMLSequenceDiagram", "SequenceDiagram");
+ diagramNameMappings.put("PapyrusUMLStateMachineDiagram", "StateMachineDiagram");
+ diagramNameMappings.put("UseCase", "UseCaseDiagram");
+
+ //SysML
+ diagramNameMappings.put("BlockDefinition", "BlockDiagram");
+ diagramNameMappings.put("InternalBlock", "InternalBlockDiagram");
+ diagramNameMappings.put("PapyrusSysMLRequirement", "RequirementDiagram");
+ diagramNameMappings.put("Parametric", "ParametricDiagram");
+ }
+
+ /**
+ * The Semantic Model Element associated to the current styled element
+ * Might also be a GMF Diagram
+ */
+ private EObject semanticElement;
+
+ /**
+ * The current GMF Element
+ */
+ private View notationElement;
+
+ /**
+ * The namespace URI of the semanticElement
+ */
+ private String namespaceURI;
+
+ /**
+ * The unqualified name of the semantic Element
+ */
+ private String localName;
+
+ /**
+ * The list of child nodes for this element
+ */
+ private Node[] children;
+
+ /**
+ * The parent node of this element
+ */
+ private Node parentNode;
+
+ private Adapter styleListener;
+
+ private CustomStyleListener cssStyleListener;
+
+ public static String getCSSID(EObject sourceElement) {
+ return getCSSValue(sourceElement, CSS_GMF_ID_KEY);
+ }
+
+ public static String getCSSClass(EObject sourceElement) {
+ List<String> allClasses = getCSSValues(sourceElement, CSS_GMF_CLASS_KEY);
+ return ListHelper.deepToString(allClasses, " "); //$NON-NLS-1$
+ }
+
+ public static String getCSSStyle(EObject sourceElement) {
+ return getCSSValue(sourceElement, CSS_GMF_STYLE_KEY);
+ }
+
+ public static EAnnotation getStyleAnnotation(EModelElement modelElement) {
+ if(modelElement == null) {
+ return null;
+ }
+
+ return modelElement.getEAnnotation(CSS_ANNOTATION);
+ }
+
+ private static String getCSSValue(EObject sourceElement, String key) {
+ StringValueStyle style = (StringValueStyle)findStyle(sourceElement, key, NotationPackage.eINSTANCE.getStringValueStyle());
+ if(style == null) {
+ return null;
+ }
+
+ return style.getStringValue();
+ }
+
+ private static List<String> getCSSValues(EObject sourceElement, String key) {
+ StringListValueStyle style = (StringListValueStyle)findStyle(sourceElement, key, NotationPackage.eINSTANCE.getStringListValueStyle());
+ if(style == null) {
+ return Collections.emptyList();
+ }
+
+ return style.getStringListValue();
+ }
+
+ private static NamedStyle findStyle(EObject sourceElement, String key, EClass type) {
+ View view = findView(sourceElement);
+ if(view == null) {
+ return null;
+ }
+
+ return view.getNamedStyle(type, key);
+ }
+
+ private static View findView(EObject sourceElement) {
+ if(sourceElement == null) {
+ return null;
+ }
+
+ if(sourceElement instanceof View) {
+ return (View)sourceElement;
+ }
+
+ return findView(sourceElement.eContainer());
+ }
+
+ public GMFElementAdapter(View view, ExtendedCSSEngine engine) {
+ super(view, engine);
+ notationElement = view;
+ listenNotationElement();
+ }
+
+ public EObject getSemanticElement() {
+ if(semanticElement == null) {
+ semanticElement = SemanticElementHelper.findSemanticElement(notationElement);
+ listenSemanticElement();
+ }
+ return semanticElement;
+ }
+
+ private Adapter getStyleListener() {
+ if(styleListener == null) {
+ styleListener = new StyleListener(this);
+ }
+ return styleListener;
+ }
+
+ private void listenNotationElement() {
+ notationElement.eAdapters().add(getStyleListener());
+
+ Collection<String> cssStyles = Arrays.asList(new String[]{ CSS_GMF_CLASS_KEY, CSS_GMF_ID_KEY, CSS_GMF_STYLE_KEY, CSS_DIAGRAM_STYLESHEETS_KEY });
+
+ notationElement.eAdapters().add(cssStyleListener = new CustomStyleListener(notationElement, this, cssStyles));
+ }
+
+ private ExtendedCSSEngine getEngine() {
+ return (ExtendedCSSEngine)engine;
+ }
+
+ private void listenSemanticElement() {
+ //FIXME: The semantic hierarchy is never refresh (children & parentNode)
+ if(semanticElement != null) {
+ semanticElement.eAdapters().add(getStyleListener());
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * Returns the first parent Notation Element representing a different semantic object
+ * than self.
+ */
+ public Node getParentNode() {
+ if(parentNode == null) {
+ View gmfElement = notationElement;
+ while(gmfElement != null) {
+ EObject semanticElement = SemanticElementHelper.findSemanticElement(gmfElement);
+
+ if(semanticElement != this.getSemanticElement()) {
+ break;
+ }
+
+ if(gmfElement == gmfElement.eContainer()) {
+ gmfElement = null;
+ break;
+ }
+
+ gmfElement = (View)gmfElement.eContainer();
+ }
+
+ parentNode = engine.getElement(gmfElement);
+ }
+
+ return parentNode;
+ }
+
+ public NodeList getChildNodes() {
+ return this;
+ }
+
+ public String getNamespaceURI() {
+ if(namespaceURI == null) {
+ namespaceURI = EMFHelper.getQualifiedName(getSemanticElement().eClass().getEPackage(), ".");
+ }
+ return namespaceURI;
+ }
+
+ public String getCSSId() {
+ return getCSSID(notationElement);
+ }
+
+ public String getCSSClass() {
+ return getCSSClass(notationElement);
+ }
+
+ public String getCSSStyle() {
+ return getCSSStyle(notationElement);
+ }
+
+ @Override
+ public String getLocalName() {
+ if(localName == null) {
+ if(getSemanticElement() instanceof Diagram) {
+ Diagram diagram = (Diagram)getSemanticElement();
+ String type = diagram.getType();
+ if(diagramNameMappings.containsKey(type)) {
+ localName = diagramNameMappings.get(type);
+ } else {
+ localName = type;
+ }
+ } else {
+ localName = getSemanticElement().eClass().getName();
+ }
+ }
+
+ return localName;
+ }
+
+ @Override
+ public String getAttribute(String attr) {
+ EStructuralFeature feature = getSemanticElement().eClass().getEStructuralFeature(attr);
+ if(feature != null) {
+ Object value = semanticElement.eGet(feature);
+ if(value != null) {
+ return value.toString();
+ }
+ }
+
+ return "";
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * Returns the GMF EObject handled by this adapter
+ */
+ @Override
+ public EObject getNativeWidget() {
+ return notationElement;
+ }
+
+
+
+ /////////////
+ //Node List//
+ /////////////
+
+
+
+ public Node item(int index) {
+ return getChildren()[index];
+ }
+
+ public int getLength() {
+ return getChildren().length;
+ }
+
+ private Node[] getChildren() {
+ if(children == null) {
+ children = computeChildren(notationElement, engine);
+ }
+
+ return children;
+ }
+
+ /**
+ * Returns the list of notation child elements attached to semantic
+ * elements different than self's semantic element.
+ *
+ * If a notation child element represents the same semantic element
+ * than self, returns its own children (Recursively).
+ */
+ private static Node[] computeChildren(View notationElement, CSSEngine engine) {
+ EObject semanticElement = SemanticElementHelper.findSemanticElement(notationElement);
+ List<Node> childList = new LinkedList<Node>();
+ for(EObject child : notationElement.eContents()) {
+ if(child instanceof View) {
+ View notationChild = (View)child;
+ if(SemanticElementHelper.findSemanticElement(notationChild) != semanticElement) {
+ childList.add(engine.getElement(notationChild));
+ } else {
+ childList.addAll(Arrays.asList(computeChildren(notationChild, engine)));
+ }
+ }
+ }
+
+ return childList.toArray(new Node[childList.size()]);
+ }
+
+ //////////////////////
+ // Handle events //
+ //////////////////////
+
+ public EObject getNotationElement() {
+ return notationElement;
+ }
+
+ public void semanticElementChanged() {
+ if(semanticElement != null && semanticElement != notationElement) {
+ semanticElement.eAdapters().remove(styleListener);
+ semanticElement = null;
+ }
+
+ localName = null;
+ parentNode = null;
+ namespaceURI = null;
+ children = null;
+ getEngine().notifyChange(this);
+ }
+
+ //Change incoming from one of the cssCustomStyles (class, id, local style or diagram stylesheets)
+ public void handleChange(ChangeEvent event) {
+ if(notationElement instanceof CSSDiagram) {
+ //TODO: Use a finer grained event (We should reset only when the
+ //change occurs on a DiagramStyleSheet)
+ getEngine().reset();
+ }
+
+ //Notify the CSS Engine
+ getEngine().notifyChange(this);
+ }
+
+ @Override
+ public void dispose() {
+ super.dispose();
+ notationElement.eAdapters().remove(cssStyleListener);
+ cssStyleListener.dispose();
+
+ notationElement.eAdapters().remove(styleListener);
+
+ if(semanticElement != null) {
+ semanticElement.eAdapters().remove(styleListener);
+ }
+ }
+
+ public void notationPropertyChanged() {
+ //Notify the CSSEngine
+ getEngine().notifyChange(this);
+ }
+
+ public void semanticPropertyChanged() {
+ //Notify the CSSEngine
+ getEngine().notifyChange(this);
+ }
+
+ public void notationElementDisposed() {
+ dispose();
+ //Notify the CSSEngine
+ getEngine().handleDispose(notationElement);
+ }
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/dom/StyleListener.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/dom/StyleListener.java
new file mode 100644
index 00000000000..cf290bc77bb
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/dom/StyleListener.java
@@ -0,0 +1,52 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.dom;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.impl.AdapterImpl;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+
+
+public class StyleListener extends AdapterImpl {
+
+ private final GMFElementAdapter elementAdapter;
+
+ public StyleListener(GMFElementAdapter elementAdapter) {
+ this.elementAdapter = elementAdapter;
+ }
+
+ @Override
+ public void notifyChanged(Notification notification) {
+ if(notification.isTouch()) {
+ return;
+ }
+
+ if(notification.getFeature() == NotationPackage.eINSTANCE.getView_Element()) {
+ if(notification.getNewValue() == null) {
+ elementAdapter.notationElementDisposed();
+ } else {
+ elementAdapter.semanticElementChanged();
+ }
+ return;
+ }
+
+ if(notification.getNotifier() == elementAdapter.getNotationElement()) {
+ elementAdapter.notationPropertyChanged();
+ return;
+ }
+
+ if(notification.getNotifier() == elementAdapter.getSemanticElement()) {
+ elementAdapter.semanticPropertyChanged();
+ return;
+ }
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/BaseCSSEngine.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/BaseCSSEngine.java
new file mode 100644
index 00000000000..f2a75e19974
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/BaseCSSEngine.java
@@ -0,0 +1,62 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.engine;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.eclipse.e4.ui.css.core.dom.IElementProvider;
+import org.eclipse.e4.ui.css.core.engine.CSSElementContext;
+import org.eclipse.papyrus.infra.gmfdiag.css.Activator;
+import org.w3c.dom.Element;
+
+/**
+ * The base CSS Engine. It contains the default stylesheet, which will be applied
+ * in all cases (With the lowest priority).
+ *
+ * @author Camille Letavernier
+ */
+@SuppressWarnings("restriction")
+public class BaseCSSEngine extends ExtendedCSSEngineImpl {
+
+ private BaseCSSEngine() {
+ try {
+ styleSheetURLs.add(new URL("platform:/plugin/" + Activator.PLUGIN_ID + "/resources/base.css")); //$NON-NLS-1$ //$NON-NLS-2$
+ } catch (MalformedURLException ex) {
+ Activator.log.error(ex);
+ }
+ }
+
+ public static ExtendedCSSEngine instance = new BaseCSSEngine();
+
+ //Unsupported operations. The BaseCSSEngine should never be used directly.
+
+ @Override
+ public Element getElement(Object node) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public IElementProvider getElementProvider() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void setElementProvider(IElementProvider elementProvider) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public CSSElementContext getCSSElementContext(Object node) {
+ throw new UnsupportedOperationException();
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/DiagramCSSEngine.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/DiagramCSSEngine.java
new file mode 100644
index 00000000000..50df1a436c3
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/DiagramCSSEngine.java
@@ -0,0 +1,117 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.engine;
+
+import java.io.IOException;
+import java.net.URL;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.databinding.observable.ChangeEvent;
+import org.eclipse.core.databinding.observable.IChangeListener;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.handler.RefreshHandler;
+import org.eclipse.papyrus.infra.gmfdiag.css.Activator;
+import org.eclipse.papyrus.infra.gmfdiag.css.helper.SemanticElementHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagram;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheet;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheetReference;
+import org.w3c.dom.Element;
+
+@SuppressWarnings("restriction")
+public class DiagramCSSEngine extends ExtendedCSSEngineImpl implements IChangeListener {
+
+ private CSSDiagram diagram;
+
+ public DiagramCSSEngine(ExtendedCSSEngine parent, CSSDiagram diagram) {
+ super(parent);
+ this.diagram = diagram;
+
+ setElementProvider(new GMFElementProvider());
+ }
+
+ @Override
+ protected void reloadStyleSheets() {
+ styleSheets.clear();
+ for(StyleSheet styleSheet : diagram.getStyleSheets()) {
+ //Do not call super#addStyleSheet(styleSheet) to avoid a StackOverFlow
+ styleSheets.add(styleSheet);
+ }
+ }
+
+ @Override
+ protected void parseStyleSheet(StyleSheetReference styleSheet) throws IOException {
+ String path = styleSheet.getPath();
+ if(path.startsWith("/")) { //Either plug-in or workspace
+ path = "platform:/resource" + path;
+ URL url = new URL(path);
+ try {
+ url.openConnection();
+ } catch (IOException ex) {
+ path = "platform:/plugin" + styleSheet.getPath();
+ }
+ } else {
+ URI uri = URI.createURI(styleSheet.getPath());
+ uri = uri.resolve(diagram.eResource().getURI());
+ path = uri.toString();
+ }
+ URL url = new URL(path);
+ parseStyleSheet(url.openStream());
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * Returns the GMF Notation EObject
+ */
+ @Override
+ public EObject getNativeWidget(Object element) {
+ element = super.getNativeWidget(element);
+
+ if(element == null) {
+ return null;
+ }
+
+ if(!(element instanceof EObject)) {
+ throw new IllegalArgumentException("Unknown element : " + element);
+ }
+
+ return (EObject)element; //GMFElement
+ }
+
+ public void handleChange(ChangeEvent event) {
+ resetCache();
+ try {
+ (new RefreshHandler()).execute(null);
+ } catch (ExecutionException ex) {
+ Activator.log.error(ex);
+ }
+ }
+
+ @Override
+ public Element getElement(Object node) {
+ if(node == null) {
+ return null;
+ }
+
+ EObject notationElement = getNativeWidget(node);
+ View canonicalNotationElement = SemanticElementHelper.findPrimaryView(notationElement);
+
+ //A View and a Compartment associated to the same Semantic Element
+ //must have the same XML Element. They share the same children.
+ //This is required to map the Semantic model (Used by the CSS selectors)
+ //to the Notation model (Used by the CSS properties)
+ return super.getElement(canonicalNotationElement);
+ }
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/ExtendedCSSEngine.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/ExtendedCSSEngine.java
new file mode 100644
index 00000000000..82164db9688
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/ExtendedCSSEngine.java
@@ -0,0 +1,77 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.engine;
+
+import org.eclipse.e4.ui.css.core.engine.CSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.listener.StyleSheetChangeListener;
+import org.eclipse.papyrus.infra.gmfdiag.css.lists.ExtendedStyleSheetList;
+import org.w3c.dom.Element;
+import org.w3c.dom.css.CSSValue;
+
+@SuppressWarnings("restriction")
+public interface ExtendedCSSEngine extends LazyCSSEngine, CSSEngine {
+
+ /**
+ * Adds a listener to be notified each time a StyleSheet has changed
+ *
+ * @param listener
+ */
+ public void addStyleSheetChangeListener(StyleSheetChangeListener listener);
+
+ /**
+ * Removes a StyleSheetChangeListener
+ *
+ * @param listener
+ */
+ public void removeStyleSheetChangedListener(StyleSheetChangeListener listener);
+
+ /**
+ * @return The list of all stylesheets for this Engine, including the
+ * parent ones
+ */
+ public ExtendedStyleSheetList getAllStylesheets();
+
+ /**
+ * {@inheritDoc}
+ *
+ * This method never throws an Exception
+ */
+ public Object convert(CSSValue cssValue, Object toType, Object context);
+
+ /**
+ * {@inheritDoc}
+ *
+ * Should be called when the StyleSheets have changed
+ */
+ public void reset();
+
+ /**
+ * Resets the CSS cache
+ *
+ * Should be called when the semantic model has changed.
+ */
+ public void resetCache();
+
+ /**
+ * Notifies a change from the given Element
+ *
+ * @param element
+ */
+ public void notifyChange(Element element);
+
+ /**
+ * Notifies the Engine that the given widget has been disposed
+ *
+ * @param nativeWidget
+ */
+ public void handleDispose(Object nativeWidget);
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/ExtendedCSSEngineImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/ExtendedCSSEngineImpl.java
new file mode 100644
index 00000000000..0015e8947bb
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/ExtendedCSSEngineImpl.java
@@ -0,0 +1,343 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.engine;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.io.StringReader;
+import java.net.URL;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.e4.ui.css.core.dom.ExtendedDocumentCSS;
+import org.eclipse.e4.ui.css.core.dom.parsers.CSSParser;
+import org.eclipse.e4.ui.css.core.dom.parsers.CSSParserFactory;
+import org.eclipse.e4.ui.css.core.dom.parsers.ICSSParserFactory;
+import org.eclipse.e4.ui.css.core.dom.properties.converters.ICSSValueConverter;
+import org.eclipse.e4.ui.css.core.impl.engine.AbstractCSSEngine;
+import org.eclipse.e4.ui.css.core.impl.sac.CSSConditionFactoryImpl;
+import org.eclipse.e4.ui.css.core.impl.sac.CSSSelectorFactoryImpl;
+import org.eclipse.papyrus.infra.gmfdiag.common.handler.RefreshHandler;
+import org.eclipse.papyrus.infra.gmfdiag.css.Activator;
+import org.eclipse.papyrus.infra.gmfdiag.css.converters.BooleanConverter;
+import org.eclipse.papyrus.infra.gmfdiag.css.converters.ColorToGMFConverter;
+import org.eclipse.papyrus.infra.gmfdiag.css.converters.IntegerConverter;
+import org.eclipse.papyrus.infra.gmfdiag.css.converters.StringConverter;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.enginecopy.ExtendedViewCSSImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.listener.StyleSheetChangeListener;
+import org.eclipse.papyrus.infra.gmfdiag.css.lists.ExtendedStyleSheetList;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.EmbeddedStyleSheet;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheet;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheetReference;
+import org.eclipse.swt.widgets.Display;
+import org.w3c.css.sac.ConditionFactory;
+import org.w3c.dom.Element;
+import org.w3c.dom.css.CSSStyleDeclaration;
+import org.w3c.dom.css.CSSValue;
+import org.w3c.dom.css.ViewCSS;
+import org.w3c.dom.stylesheets.StyleSheetList;
+
+/**
+ * Base implementation for a hierarchic, lazy CSS Engine.
+ *
+ * @author Camille Letavernier
+ */
+//TODO : Listen on stylesheet modifications
+@SuppressWarnings("restriction")
+public abstract class ExtendedCSSEngineImpl extends AbstractCSSEngine implements ExtendedCSSEngine, StyleSheetChangeListener {
+
+ public static final ConditionFactory CONDITIONFACTORY_INSTANCE = new CSSConditionFactoryImpl(null, "class", null, "id");
+
+ private final Map<Element, CSSStyleDeclaration> declarationsCache = new HashMap<Element, CSSStyleDeclaration>();
+
+ private ExtendedViewCSSImpl viewCSS;
+
+ protected ExtendedCSSEngine parent;
+
+ private ExtendedStyleSheetList styleSheetsList;
+
+ private final Set<StyleSheetChangeListener> styleSheetListeners = new HashSet<StyleSheetChangeListener>();
+
+ private final Map<String, Collection<String>> availableClasses = new HashMap<String, Collection<String>>();
+
+ /**
+ * Owned stylesheets
+ */
+ protected final List<StyleSheet> styleSheets = new LinkedList<StyleSheet>();
+
+ /**
+ * Owned stylesheets, by URL
+ */
+ protected final List<URL> styleSheetURLs = new LinkedList<URL>();
+
+ public ExtendedCSSEngineImpl() {
+ this(null);
+ }
+
+ public ExtendedCSSEngineImpl(ExtendedCSSEngine parent) {
+ super();
+ init(parent);
+ }
+
+ public ExtendedCSSEngineImpl(ExtendedCSSEngine parent, ExtendedDocumentCSS documentCSS) {
+ super(documentCSS);
+ init(parent);
+ }
+
+ private void init(ExtendedCSSEngine parent) {
+ if(parent != null) {
+ parent.addStyleSheetChangeListener(this);
+ }
+ viewCSS = new ExtendedViewCSSImpl(this);
+ this.parent = parent;
+
+ this.registerCSSValueConverter(new ColorToGMFConverter());
+ this.registerCSSValueConverter(new IntegerConverter());
+ this.registerCSSValueConverter(new StringConverter());
+ this.registerCSSValueConverter(new BooleanConverter());
+
+ setErrorHandler(new GMFErrorHandler());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String retrieveCSSProperty(Object widget, String property, String pseudo) {
+ Element element;
+ if(widget instanceof Element) {
+ element = (Element)widget;
+ } else {
+ element = getElement(widget);
+ }
+ CSSValue value = retrievePropertyValue(element, property);
+ if(value == null) {
+ return null;
+ }
+ return value.getCssText();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public CSSValue retrievePropertyValue(Object node, String property) {
+ if(node == null || property == null) {
+ return null;
+ }
+
+ CSSStyleDeclaration declaration = getStyleDeclaration(node);
+
+ return declaration.getPropertyCSSValue(property);
+ }
+
+ private CSSStyleDeclaration getStyleDeclaration(Object node) {
+ return getStyleDeclaration(node, null);
+ }
+
+ private CSSStyleDeclaration getStyleDeclaration(Object node, String pseudo) {
+ Element element = getElement(node);
+ if(!declarationsCache.containsKey(element)) {
+ declarationsCache.put(element, getViewCSS().getComputedStyle(element, pseudo));
+ }
+ return declarationsCache.get(element);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void reset() {
+ resetCache();
+ super.reset();
+ fireStyleSheetChanged();
+ }
+
+ protected void reloadStyleSheets() {
+ //Do nothing
+ }
+
+ //FIXME : Determine precisely the lifecycle of the cache
+ //When is it built ; when is it cleaned
+ /**
+ * {@inheritDoc}
+ */
+ public void resetCache() {
+ declarationsCache.clear();
+ styleSheetsList = null;
+ availableClasses.clear();
+ }
+
+ protected void parseStyleSheets() {
+ reloadStyleSheets();
+ for(URL styleSheet : styleSheetURLs) {
+ try {
+ parseStyleSheet(styleSheet.openStream());
+ } catch (IOException ex) {
+ handleExceptions(ex);
+ }
+ }
+ for(StyleSheet styleSheet : styleSheets) {
+ try {
+ if(styleSheet instanceof EmbeddedStyleSheet) {
+ parseStyleSheet((EmbeddedStyleSheet)styleSheet);
+ } else if(styleSheet instanceof StyleSheetReference) {
+ parseStyleSheet((StyleSheetReference)styleSheet);
+ }
+ } catch (IOException ex) {
+ handleExceptions(ex);
+ }
+ }
+ }
+
+ /**
+ * @see #addStyleSheet(StyleSheet)
+ */
+ private void parseStyleSheet(EmbeddedStyleSheet styleSheet) throws IOException {
+ Reader reader = new StringReader(styleSheet.getContent());
+ parseStyleSheet(reader);
+ }
+
+ /**
+ * @see #addStyleSheet(StyleSheet)
+ */
+ protected void parseStyleSheet(StyleSheetReference styleSheet) throws IOException {
+ String path = styleSheet.getPath();
+ if(path.startsWith("/")) {
+ path = "platform:/resource" + path;
+ }
+
+ URL url = new URL(path);
+ parseStyleSheet(url.openStream());
+ }
+
+ @Override
+ public CSSParser makeCSSParser() {
+ //TODO : Extended parser (CSSX)
+ //if(isExtended) {
+ // return makeExtendedCSSParser();
+ //}
+
+ // Create CSS Parser
+ ICSSParserFactory factory = CSSParserFactory.newInstance();
+ CSSParser parser = factory.makeCSSParser();
+
+ // Register Batik CSS Selector factory.
+ parser.setSelectorFactory(CSSSelectorFactoryImpl.INSTANCE);
+
+ // Register Custom CSS Condition factory.
+ parser.setConditionFactory(CONDITIONFACTORY_INSTANCE);
+
+ return parser;
+ }
+
+ @Override
+ public ViewCSS getViewCSS() {
+ return viewCSS;
+ }
+
+ public void styleSheetChanged(ExtendedCSSEngine owner) {
+ reset();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ private void fireStyleSheetChanged() {
+ for(StyleSheetChangeListener listener : styleSheetListeners) {
+ listener.styleSheetChanged(this);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void addStyleSheetChangeListener(StyleSheetChangeListener listener) {
+ styleSheetListeners.add(listener);
+ }
+
+ public void removeStyleSheetChangedListener(StyleSheetChangeListener listener) {
+ styleSheetListeners.remove(listener);
+ }
+
+ public ExtendedStyleSheetList getAllStylesheets() {
+ if(styleSheetsList == null) {
+ parseStyleSheets();
+ styleSheetsList = new ExtendedStyleSheetList();
+ if(parent != null) {
+ styleSheetsList.addAll((StyleSheetList)parent.getAllStylesheets());
+ }
+ styleSheetsList.addAll(getDocumentCSS().getStyleSheets());
+ }
+
+ return styleSheetsList;
+ }
+
+ @Override
+ public Object convert(CSSValue value, Object toType, Object context) {
+ try {
+ return super.convert(value, toType, context);
+ } catch (Exception ex) {
+ //Activator.log.warn("Unsupported CSS value: " + value.getCssText() + ". Trying to convert it...");
+ return convert(value, toType); //FIXME: Sometimes, the conversion is not supported by the AbstractCSSEngine
+ }
+ }
+
+ //Smaller implementation of convert(). Doesn't rely on cache nor any kind of registry
+ //Call this method when the super implementation fails (UnsupportedOperationException...)
+ protected Object convert(CSSValue value, Object toType) {
+ ICSSValueConverter converter = getCSSValueConverter(toType);
+ if(converter != null) {
+ try {
+ return converter.convert(value, this, null);
+ } catch (Exception ex) {
+ handleExceptions(ex);
+ }
+ }
+ return value;
+ }
+
+ @Override
+ public void dispose() {
+ styleSheetListeners.clear();
+ if(parent != null) {
+ parent.removeStyleSheetChangedListener(this);
+ }
+
+ getElementsContext(); //FIXME: Avoid a NullPointerException in super.dispose()...
+ super.dispose();
+ }
+
+ public void notifyChange(Element elementAdapter) {
+ resetCache(); //TODO: We should only refresh a subset of the cache
+ Display.getCurrent().asyncExec(new Runnable() {
+
+ public void run() {
+ try {
+ (new RefreshHandler()).execute(null);
+ } catch (ExecutionException ex) {
+ Activator.log.error(ex);
+ }
+ }
+ });
+
+ }
+
+ public void handleDispose(Object nativeWidget) {
+ super.handleWidgetDisposed(nativeWidget);
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/GMFElementProvider.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/GMFElementProvider.java
new file mode 100644
index 00000000000..44415df8e83
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/GMFElementProvider.java
@@ -0,0 +1,41 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.engine;
+
+import org.eclipse.e4.ui.css.core.dom.IElementProvider;
+import org.eclipse.e4.ui.css.core.engine.CSSEngine;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.css.dom.GMFElementAdapter;
+import org.w3c.dom.Element;
+
+/**
+ * Provides an Element for a GMF Notation object.
+ *
+ * @author Camille Letavernier
+ */
+@SuppressWarnings("restriction")
+public class GMFElementProvider implements IElementProvider {
+
+ public Element getElement(Object element, CSSEngine engine) {
+
+ if(!(element instanceof View)) {
+ throw new IllegalArgumentException("Unknown element : " + element);
+ }
+
+ if(!(engine instanceof ExtendedCSSEngine)) {
+ throw new IllegalArgumentException("Invalid CSS Engine : " + engine);
+ }
+
+ return new GMFElementAdapter((View)element, (ExtendedCSSEngine)engine);
+ }
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/GMFErrorHandler.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/GMFErrorHandler.java
new file mode 100644
index 00000000000..c238332735c
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/GMFErrorHandler.java
@@ -0,0 +1,24 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.engine;
+
+import org.eclipse.e4.ui.css.core.engine.CSSErrorHandler;
+import org.eclipse.papyrus.infra.gmfdiag.css.Activator;
+
+@SuppressWarnings("restriction")
+public class GMFErrorHandler implements CSSErrorHandler {
+
+ public void error(Exception ex) {
+ Activator.log.error("CSS Error", ex); //$NON-NLS-1$
+ }
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/LazyCSSEngine.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/LazyCSSEngine.java
new file mode 100644
index 00000000000..45cd8ec95cf
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/LazyCSSEngine.java
@@ -0,0 +1,29 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.engine;
+
+import org.w3c.dom.css.CSSValue;
+
+
+/**
+ * An interface for Lazy CSS Engine
+ *
+ * The Engine doesn't modify an Element. Instead, for an element, it returns the
+ * value of the required property.
+ *
+ * @author Camille Letavernier
+ */
+public interface LazyCSSEngine {
+
+ public CSSValue retrievePropertyValue(Object node, String property);
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/ModelCSSEngine.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/ModelCSSEngine.java
new file mode 100644
index 00000000000..b7af7ab1cce
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/ModelCSSEngine.java
@@ -0,0 +1,85 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.engine;
+
+import java.io.IOException;
+import java.net.URL;
+
+import org.eclipse.e4.ui.css.core.dom.IElementProvider;
+import org.eclipse.e4.ui.css.core.engine.CSSElementContext;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.ModelStyleSheets;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheet;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheetReference;
+import org.w3c.dom.Element;
+
+@SuppressWarnings("restriction")
+public class ModelCSSEngine extends ExtendedCSSEngineImpl {
+
+ private final Resource model;
+
+ public ModelCSSEngine(Resource model) {
+ super(WorkspaceCSSEngine.instance);
+ this.model = model;
+ }
+
+ @Override
+ protected void reloadStyleSheets() {
+ this.styleSheets.clear();
+ for(EObject eObject : model.getContents()) {
+ if(eObject instanceof ModelStyleSheets) {
+ ModelStyleSheets styleSheets = (ModelStyleSheets)eObject;
+ for(StyleSheet styleSheet : styleSheets.getStylesheets()) {
+ this.styleSheets.add(styleSheet);
+ }
+ }
+ }
+ }
+
+ @Override
+ protected void parseStyleSheet(StyleSheetReference styleSheet) throws IOException {
+ String path = styleSheet.getPath();
+ if(path.startsWith("/")) {
+ path = "platform:/plugin" + path;
+ } else {
+ URI uri = URI.createURI(styleSheet.getPath());
+ uri = uri.resolve(model.getURI());
+ path = uri.toString();
+ }
+ URL url = new URL(path);
+ parseStyleSheet(url.openStream());
+ }
+
+ //Unsupported operations. The ModelCSSEngine should not be used directly.
+
+ @Override
+ public Element getElement(Object node) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public IElementProvider getElementProvider() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void setElementProvider(IElementProvider elementProvider) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public CSSElementContext getCSSElementContext(Object node) {
+ throw new UnsupportedOperationException();
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/WorkspaceCSSEngine.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/WorkspaceCSSEngine.java
new file mode 100644
index 00000000000..f30219a8a9d
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/WorkspaceCSSEngine.java
@@ -0,0 +1,66 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.engine;
+
+import java.net.URL;
+
+import org.eclipse.e4.ui.css.core.dom.IElementProvider;
+import org.eclipse.e4.ui.css.core.engine.CSSElementContext;
+import org.eclipse.papyrus.infra.gmfdiag.css.theme.ThemeManager;
+import org.w3c.dom.Element;
+
+/**
+ * A Singleton CSSEngine, handling the CSS stylesheets applied to the whole
+ * workspace
+ *
+ * @author Camille Letavernier
+ *
+ */
+@SuppressWarnings("restriction")
+public class WorkspaceCSSEngine extends ExtendedCSSEngineImpl {
+
+ private WorkspaceCSSEngine() {
+ super(BaseCSSEngine.instance);
+ }
+
+ public static ExtendedCSSEngine instance = new WorkspaceCSSEngine();
+
+ @Override
+ protected void reloadStyleSheets() {
+ styleSheetURLs.clear();
+ for(URL styleSheetURL : ThemeManager.instance.getWorkspaceStyleSheets()) {
+ styleSheetURLs.add(styleSheetURL);
+ }
+ }
+
+ //Unsupported operations. The WorkspaceCSSEngine should never be used directly.
+
+ @Override
+ public Element getElement(Object node) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public IElementProvider getElementProvider() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void setElementProvider(IElementProvider elementProvider) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public CSSElementContext getCSSElementContext(Object node) {
+ throw new UnsupportedOperationException();
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/enginecopy/CSSComputedStyleImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/enginecopy/CSSComputedStyleImpl.java
new file mode 100644
index 00000000000..a4e6bab386e
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/enginecopy/CSSComputedStyleImpl.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2009 Angelo Zerr and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
+ * EclipseSource - revision
+ * IBM Corporation - ongoing development
+ *******************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.engine.enginecopy;
+
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.e4.ui.css.core.dom.CSSProperty;
+import org.eclipse.e4.ui.css.core.dom.CSSPropertyList;
+import org.eclipse.e4.ui.css.core.impl.dom.CSSStyleDeclarationImpl;
+import org.w3c.dom.css.CSSStyleDeclaration;
+
+
+/**
+ * CSS computed style which concatenate list of CSSComputedStyleImpl to manage
+ * styles coming from Condition Selector (ex : Label#MyId) and other selectors
+ * (ex : Label).
+ */
+@SuppressWarnings({ "serial", "restriction" })
+public class CSSComputedStyleImpl extends CSSStyleDeclarationImpl implements CSSStyleDeclaration {
+
+ private List<StyleWrapper> styleRules;
+
+ public CSSComputedStyleImpl(List<StyleWrapper> styleRules) {
+ super(null);
+ this.styleRules = styleRules;
+ // TODO [rst] Optimize: A list of StyleWrapper instances could be sorted
+ // only once after reading the stylesheet(s).
+ Collections.sort(this.styleRules, StyleWrapper.COMPARATOR);
+ Iterator<StyleWrapper> iterator = this.styleRules.iterator();
+ while(iterator.hasNext()) {
+ StyleWrapper styleWrapper = iterator.next();
+ addCSSPropertyList(((CSSStyleDeclarationImpl)styleWrapper.style).getCSSPropertyList());
+ }
+ }
+
+ private void addCSSPropertyList(CSSPropertyList properties) {
+ int length = properties.getLength();
+ for(int i = 0; i < length; i++) {
+ CSSProperty property = properties.item(i);
+
+ super.removeProperty(property.getName());
+ super.addProperty(property);
+ }
+ }
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/enginecopy/ExtendedViewCSSImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/enginecopy/ExtendedViewCSSImpl.java
new file mode 100644
index 00000000000..367100010cb
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/enginecopy/ExtendedViewCSSImpl.java
@@ -0,0 +1,146 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.engine.enginecopy;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.e4.ui.css.core.dom.CSSStylableElement;
+import org.eclipse.e4.ui.css.core.dom.ExtendedCSSRule;
+import org.eclipse.e4.ui.css.core.impl.dom.ViewCSSImpl;
+import org.eclipse.e4.ui.css.core.impl.sac.ExtendedSelector;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.lists.ExtendedStyleSheetList;
+import org.w3c.css.sac.Selector;
+import org.w3c.css.sac.SelectorList;
+import org.w3c.dom.Element;
+import org.w3c.dom.css.CSSRule;
+import org.w3c.dom.css.CSSRuleList;
+import org.w3c.dom.css.CSSStyleDeclaration;
+import org.w3c.dom.css.CSSStyleRule;
+import org.w3c.dom.css.CSSStyleSheet;
+import org.w3c.dom.css.ViewCSS;
+import org.w3c.dom.stylesheets.StyleSheet;
+import org.w3c.dom.views.DocumentView;
+
+
+@SuppressWarnings("restriction")
+public class ExtendedViewCSSImpl implements ViewCSS {
+
+ protected ExtendedCSSEngine engine;
+
+ public ExtendedViewCSSImpl(ExtendedCSSEngine extendedCSSEngine) {
+ this.engine = extendedCSSEngine;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * Implementation based on {@link ViewCSSImpl#getComputedStyle(Element, String)}.
+ * The base implementations returns the first CSSStyleDeclaration.
+ *
+ * When a StyleDeclaration is found in a StyleSheet, it is added to a list of declarations.
+ * Then, these declarations are merged
+ */
+ public CSSStyleDeclaration getComputedStyle(Element elt, String pseudo) {
+
+ ExtendedStyleSheetList styleSheetList = engine.getAllStylesheets();
+
+ List<StyleWrapper> declarations = new ArrayList<StyleWrapper>();
+
+ //Stylesheets
+ for(StyleSheet styleSheet : styleSheetList) {
+ List<StyleWrapper> styleWrappers = getStyleWrappers((CSSStyleSheet)styleSheet, elt, pseudo, declarations.size());
+ declarations.addAll(styleWrappers);
+ }
+
+ //Local styles
+ String localStyles = ((CSSStylableElement)elt).getCSSStyle();
+ if(localStyles != null) {
+ StyleWrapper wrapper = getStyleWrapper(localStyles);
+ if(wrapper != null) {
+ declarations.add(wrapper);
+ }
+ }
+
+ return new CSSComputedStyleImpl(declarations);
+ }
+
+ private StyleWrapper getStyleWrapper(String localStyles) {
+ CSSStyleDeclaration style;
+ try {
+ style = engine.parseStyleDeclaration(localStyles);
+ StyleWrapper wrapper = new StyleWrapper(style, Integer.MAX_VALUE, 0);
+ return wrapper;
+ } catch (IOException ex) {
+ engine.handleExceptions(ex);
+ }
+ return null;
+ }
+
+ /**
+ * Implementation based on {@link ViewCSSImpl#getComputedStyle(CSSStyleSheet, Element, String)}
+ *
+ * Returns the StyleWrappers instead of a StyleDeclaration
+ */
+ private List<StyleWrapper> getStyleWrappers(CSSStyleSheet styleSheet, Element elt, String pseudoElt, int position) {
+ List<StyleWrapper> styleDeclarations = new ArrayList<StyleWrapper>();
+ CSSRuleList ruleList = styleSheet.getCssRules();
+ int length = ruleList.getLength();
+ for(int i = 0; i < length; i++) {
+ CSSRule rule = ruleList.item(i);
+ switch(rule.getType()) {
+ case CSSRule.STYLE_RULE:
+ {
+ CSSStyleRule styleRule = (CSSStyleRule)rule;
+ if(rule instanceof ExtendedCSSRule) {
+ ExtendedCSSRule r = (ExtendedCSSRule)rule;
+ SelectorList selectorList = r.getSelectorList();
+ // Loop for SelectorList
+ int l = selectorList.getLength();
+ for(int j = 0; j < l; j++) {
+ Selector selector = selectorList.item(j);
+ if(selector instanceof ExtendedSelector) {
+ ExtendedSelector extendedSelector = (ExtendedSelector)selector;
+ if(extendedSelector.match(elt, pseudoElt)) {
+ CSSStyleDeclaration style = styleRule.getStyle();
+ int specificity = extendedSelector.getSpecificity();
+ StyleWrapper wrapper = new StyleWrapper(style, specificity, position++);
+ styleDeclarations.add(wrapper);
+ }
+ } else {
+ // TODO : selector is not batik ExtendedSelector,
+ // Manage this case...
+ }
+ }
+ } else {
+ // TODO : CSS rule is not ExtendedCSSRule,
+ // Manage this case...
+ }
+ }
+ }
+ }
+
+ return styleDeclarations;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * Unsupported
+ * TODO : Do we need an implementation ?
+ */
+ public DocumentView getDocument() {
+ return null;
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/enginecopy/StyleWrapper.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/enginecopy/StyleWrapper.java
new file mode 100644
index 00000000000..3a0ef91f134
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/enginecopy/StyleWrapper.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2009 EclipseSource and others. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * EclipseSource - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.engine.enginecopy;
+
+import java.util.Comparator;
+
+import org.w3c.dom.css.CSSStyleDeclaration;
+
+/**
+ * A wrapper that holds a reference to the styles defined in a CSS rule block,
+ * together with all the information needed to calculate a matching selector's
+ * precedence.
+ */
+final class StyleWrapper {
+
+ private static class StyleWrapperComparator implements Comparator<StyleWrapper> {
+
+ public int compare(final StyleWrapper wrapper1, final StyleWrapper wrapper2) {
+ int result = 0;
+ if(wrapper1.specificity > wrapper2.specificity) {
+ result = 1;
+ } else if(wrapper1.specificity < wrapper2.specificity) {
+ result = -1;
+ } else if(wrapper1.position > wrapper2.position) {
+ result = 1;
+ } else if(wrapper1.position < wrapper2.position) {
+ result = -1;
+ }
+ return result;
+ }
+ }
+
+ /**
+ * A comparator for {@link StyleWrapper}s.
+ */
+ public static final StyleWrapperComparator COMPARATOR = new StyleWrapperComparator();
+
+ public final CSSStyleDeclaration style;
+
+ public final int specificity;
+
+ public final int position;
+
+ public StyleWrapper(CSSStyleDeclaration style, int specificity, int position) {
+ this.style = style;
+ this.specificity = specificity;
+ this.position = position;
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/handler/CSSRefreshHandler.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/handler/CSSRefreshHandler.java
new file mode 100644
index 00000000000..891135daf05
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/handler/CSSRefreshHandler.java
@@ -0,0 +1,27 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.handler;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.papyrus.infra.gmfdiag.common.handler.RefreshHandler;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.BaseCSSEngine;
+
+
+public class CSSRefreshHandler extends RefreshHandler {
+
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ BaseCSSEngine.instance.reset();
+ return super.execute(event);
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/handler/ResetStyleHandler.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/handler/ResetStyleHandler.java
new file mode 100644
index 00000000000..850220e1da4
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/handler/ResetStyleHandler.java
@@ -0,0 +1,185 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.handler;
+
+import java.util.Iterator;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.NamedStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.Style;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.core.utils.ServiceUtilsForActionHandlers;
+import org.eclipse.papyrus.infra.emf.Activator;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
+import org.eclipse.papyrus.infra.gmfdiag.common.helper.NotationHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSAnnotations;
+
+
+/**
+ * This handler resets all the local appearance to their default value
+ * for a set of GMF Views.
+ *
+ * @author Camille Letavernier
+ */
+public class ResetStyleHandler extends AbstractHandler {
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ ISelection selection;
+ try {
+ selection = ServiceUtilsForActionHandlers.getInstance().getNestedActiveIEditorPart().getSite().getSelectionProvider().getSelection();
+ if(selection.isEmpty()) {
+ return null;
+ }
+ } catch (ServiceException ex) {
+ // TODO Auto-generated catch block
+ Activator.log.error(ex);
+ return null;
+ }
+
+ if(!(selection instanceof IStructuredSelection)) {
+ return null;
+ }
+
+ IStructuredSelection sSelection = (IStructuredSelection)selection;
+ Iterator<?> iterator = sSelection.iterator();
+
+ TransactionalEditingDomain domain = null;
+ while(iterator.hasNext()) {
+ Object selectedItem = iterator.next();
+ View view = NotationHelper.findView(selectedItem);
+ if(view == null) {
+ continue;
+ }
+
+ EditingDomain editingDomain = EMFHelper.resolveEditingDomain(view);
+ if(editingDomain instanceof TransactionalEditingDomain) {
+ domain = (TransactionalEditingDomain)editingDomain;
+ }
+ break;
+ }
+
+ if(domain == null) {
+ return null;
+ }
+
+ Command command = new ResetStyleCommand(domain, sSelection);
+ domain.getCommandStack().execute(command);
+
+ return null;
+ }
+
+ private class ResetStyleCommand extends RecordingCommand {
+
+ private IStructuredSelection selection;
+
+ public ResetStyleCommand(TransactionalEditingDomain domain, IStructuredSelection selection) {
+ super(domain);
+ this.selection = selection;
+ }
+
+ @Override
+ public void doExecute() {
+ Iterator<?> iterator = selection.iterator();
+ while(iterator.hasNext()) {
+ Object selectedItem = iterator.next();
+ View view = NotationHelper.findView(selectedItem);
+ if(view == null) {
+ continue;
+ }
+
+ if(view instanceof Diagram) {
+ resetDiagram((Diagram)view);
+ break;
+ } else {
+ //Reset the style attribute to their default value
+ resetStyle(view);
+ }
+ }
+ }
+
+ private void resetDiagram(Diagram diagram) {
+ for(Object viewObject : diagram.getChildren()) {
+ if(viewObject instanceof View) {
+ resetStyle((View)viewObject, true);
+ }
+ }
+ }
+
+ private void resetStyle(View view, boolean recursive) {
+ resetStyle(view);
+ if(recursive) {
+ for(Object childObject : view.getChildren()) {
+ if(childObject instanceof View) {
+ resetStyle((View)childObject, recursive);
+ }
+ }
+ }
+ }
+
+ private void resetStyle(View view) {
+ for(Object styleObject : view.getStyles()) {
+ if(styleObject instanceof Style) {
+ resetStyle((Style)styleObject);
+ }
+ }
+ if(view instanceof Style) {
+ resetStyle((Style)view);
+ }
+
+ //Remove the "forceValue" annotations
+ resetAnnotations(view);
+ }
+
+ private void resetStyle(Style style) {
+ if(style instanceof NamedStyle) {
+ //Skip custom styles.
+ //TODO: We should skip CSS Styles (CSSClass, CSSId, CSSStyle, DiagramStyleSheets),
+ //and reset custom GMF Styles (elementIcon, shadow, ...).
+ //What about external custom styles (ie. unkwnown styles)?
+ //They should be stylable, but they might contain something we don't want to reset...
+ return;
+ }
+
+ for(EStructuralFeature feature : style.eClass().getEAllStructuralFeatures()) {
+ //Only edit Style features
+ if(NotationPackage.eINSTANCE.getStyle().isSuperTypeOf(feature.getEContainingClass())) {
+ //Reset the value to default
+ style.eUnset(feature);
+ }
+ }
+ }
+
+ private void resetAnnotations(View view) {
+ Iterator<EAnnotation> iterator = view.getEAnnotations().iterator();
+ while(iterator.hasNext()) {
+ if(CSSAnnotations.CSS_FORCE_VALUE.equals(iterator.next().getSource())) {
+ iterator.remove();
+ }
+ }
+ }
+ }
+
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/CSSHelper.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/CSSHelper.java
new file mode 100644
index 00000000000..7394859778f
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/CSSHelper.java
@@ -0,0 +1,24 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.helper;
+
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.papyrus.infra.gmfdiag.css.resource.CSSNotationResourceFactory;
+
+
+public class CSSHelper {
+
+ public static void installCSSSupport(ResourceSet resourceSet) {
+ CSSNotationResourceFactory factory = new CSSNotationResourceFactory();
+ resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("notation", factory); //$NON-NLS-1$
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/GradientHelper.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/GradientHelper.java
new file mode 100644
index 00000000000..8c933b7b617
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/GradientHelper.java
@@ -0,0 +1,136 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.helper;
+
+import java.io.IOException;
+
+import org.eclipse.gmf.runtime.notation.GradientStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.datatype.GradientData;
+import org.eclipse.papyrus.infra.gmfdiag.css.converters.ColorToGMFConverter;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.w3c.dom.css.CSSValue;
+
+
+public class GradientHelper {
+
+ public static final String GRADIENT_VERTICAL = "vertical";
+
+ public static final String GRADIENT_HORIZONTAL = "horizontal";
+
+ //Type 1 :
+ //gradientColor:#ABCDEF;
+ //gradientStyle:vertical;
+
+ //Type 2 :
+ //(gradient:#FEDCBA #ABCDEF horizontal;) //Currently not supported, as diagrams usually seek for #fillColor()
+ //gradient:#ABCDEF horizontal;
+ //gradient:#ABCDEF
+ //gradient:horizontal
+
+ //TODO: The Engine should provide a method to handle complex composite properties.
+ //The base CSS Engine provides such a feature. However, it is not powerful enough.
+ public static GradientData computeGradient(ExtendedCSSEngine engine, Object node) {
+ //Type 1
+ CSSValue gradientColor = engine.retrievePropertyValue(node, "gradientColor");
+ CSSValue gradientStyle = engine.retrievePropertyValue(node, "gradientStyle");
+
+ if(gradientColor != null || gradientStyle != null) {
+ int color1 = (Integer)engine.convert(gradientColor, ColorToGMFConverter.GMFColor, null);
+ int color2 = 0; //Unused by Papyrus diagrams
+ int style = getGradientStyle(gradientStyle.getCssText());
+ GradientData data = new GradientData(color1, color2, style);
+ return data;
+ }
+
+ //Type 2
+ CSSValue gradient = engine.retrievePropertyValue(node, "gradient");
+
+ if(gradient != null) {
+ String gradientString = gradient.getCssText();
+
+ if(StringHelper.equals(gradientString, "none")) {
+ return null;
+ }
+
+ int[] gradientValues = parseGradient(engine, gradientString);
+ return new GradientData(gradientValues[0], gradientValues[1], gradientValues[2]);
+ }
+
+ //Default
+ return (GradientData)NotationPackage.eINSTANCE.getFillStyle_Gradient().getDefaultValue();
+ }
+
+ /** [color1, color2, style] */
+ private static int[] parseGradient(ExtendedCSSEngine engine, String gradient) {
+ String color1, color2, style;
+ color1 = color2 = style = null;
+
+ String[] values = ParserHelper.parseValues(engine, gradient);
+
+ if(values.length == 3) {
+ color1 = values[0];
+ color2 = values[1];
+ style = values[2];
+ } else if(values.length == 2) {
+ color1 = values[0];
+ String value = values[1];
+ if(isGradientStyle(value)) {
+ style = value;
+ } else {
+ color2 = value;
+ }
+ } else if(values.length == 1) {
+ String value = values[0];
+ if(isGradientStyle(value)) {
+ style = value;
+ } else {
+ color1 = value;
+ }
+ }
+
+ return parseGradient(engine, color1, color2, style);
+ }
+
+ private static int[] parseGradient(ExtendedCSSEngine engine, String sColor1, String sColor2, String sStyle) {
+ int color1, color2, style;
+ color1 = color2 = style = -1;
+
+ CSSValue cssColor1;
+ try {
+ cssColor1 = engine.parsePropertyValue(sColor1);
+ color1 = (Integer)engine.convert(cssColor1, ColorToGMFConverter.GMFColor, null);
+ color2 = 0; //Unused
+ style = getGradientStyle(sStyle);
+ } catch (IOException ex) {
+ engine.handleExceptions(ex);
+ }
+
+
+ return new int[]{ color1, color2, style };
+ }
+
+ private static boolean isGradientStyle(String value) {
+ return StringHelper.equals(GRADIENT_VERTICAL, value) || StringHelper.equals(GRADIENT_HORIZONTAL, value);
+ }
+
+ private static int getGradientStyle(String gradientStyle) {
+ if(StringHelper.equals(GRADIENT_VERTICAL, gradientStyle)) {
+ return GradientStyle.VERTICAL;
+ } else if(StringHelper.equals(GRADIENT_HORIZONTAL, gradientStyle)) {
+ return GradientStyle.HORIZONTAL;
+ }
+
+ //Default value
+ return new GradientData().getGradientStyle();
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/ParserHelper.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/ParserHelper.java
new file mode 100644
index 00000000000..3c81614ac77
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/ParserHelper.java
@@ -0,0 +1,48 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.helper;
+
+import java.io.IOException;
+
+import org.eclipse.e4.ui.css.core.engine.CSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.Activator;
+import org.w3c.dom.css.CSSValue;
+import org.w3c.dom.css.CSSValueList;
+
+@SuppressWarnings("restriction")
+public class ParserHelper {
+
+ public static String[] parseValues(CSSEngine engine, String value) {
+ CSSValue cssValue;
+ try {
+ cssValue = engine.parsePropertyValue(value);
+ } catch (IOException ex) {
+ Activator.log.error(ex);
+ return new String[0];
+ }
+
+ if(cssValue instanceof CSSValueList) {
+ CSSValueList list = (CSSValueList)cssValue;
+ return toArray(list);
+ }
+
+ return new String[]{ cssValue.getCssText() };
+ }
+
+ public static String[] toArray(CSSValueList valueList) {
+ String[] result = new String[valueList.getLength()];
+ for(int i = 0; i < result.length; i++) {
+ result[i] = valueList.item(i).getCssText();
+ }
+ return result;
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/SemanticElementHelper.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/SemanticElementHelper.java
new file mode 100644
index 00000000000..0f8abdc840d
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/SemanticElementHelper.java
@@ -0,0 +1,98 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.helper;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.emf.Activator;
+
+public class SemanticElementHelper {
+
+ /**
+ * Returns the semantic element attached to the given notation element
+ *
+ * The result element can also be a Diagram
+ */
+ public static EObject findSemanticElement(EObject notationElement) {
+ if (notationElement == null){
+ return null;
+ }
+ if(notationElement instanceof Diagram) {
+ return notationElement;
+ }
+ if(notationElement instanceof View) {
+ View view = (View)notationElement;
+ EObject semanticElement = view.getElement();
+ if(semanticElement != null) {
+ return semanticElement;
+ }
+ //The graphical element isn't related to a Semantic Element. The view becomes the semantic element.
+ //e.g. : Links in UML
+ return view;
+ }
+
+ EObject currentElement = notationElement.eContainer();
+
+ do {
+ if(currentElement instanceof View) {
+ return findSemanticElement(currentElement);
+ }
+ currentElement = currentElement.eContainer();
+ } while(currentElement != null);
+
+ Activator.log.warn("Cannot find a valid source for " + notationElement);
+ return notationElement;
+ }
+
+ /**
+ * Retrieves the primary view associated to the argument.
+ *
+ * For example, for a compartment, this method will return the top-most
+ * view associated to the same semantic element.
+ *
+ * @param notationElement
+ * @return
+ */
+ public static View findPrimaryView(EObject notationElement) {
+ return findTopView(notationElement);
+ }
+
+ /**
+ * Finds the top-most View associated to the same semantic
+ * element as the argument.
+ *
+ * @param notationElement
+ * @return
+ */
+ public static View findTopView(EObject notationElement) {
+ EObject semanticElement = findSemanticElement(notationElement);
+
+ if(semanticElement == notationElement) {
+ return (View)notationElement;
+ }
+
+ EObject lastNotationElement = notationElement;
+ while(notationElement != null) {
+ notationElement = notationElement.eContainer();
+ if(findSemanticElement(notationElement) != semanticElement) {
+ return (View)lastNotationElement;
+ }
+
+ if(notationElement != null) {
+ lastNotationElement = notationElement;
+ }
+ }
+
+ return (View)lastNotationElement;
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/StringHelper.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/StringHelper.java
new file mode 100644
index 00000000000..c3ac1d215fc
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/StringHelper.java
@@ -0,0 +1,32 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.helper;
+
+public class StringHelper {
+
+ /**
+ * Compares two strings. Case insensitive. The Strings are trimed.
+ *
+ * Null strings already return false
+ *
+ * @param s1
+ * @param s2
+ * @return
+ */
+ public static boolean equals(String s1, String s2) {
+ if(s1 == null || s2 == null) {
+ return false;
+ }
+
+ return s1.trim().toLowerCase().equals(s2.trim().toLowerCase());
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/listener/StyleSheetChangeListener.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/listener/StyleSheetChangeListener.java
new file mode 100644
index 00000000000..5c4352eedad
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/listener/StyleSheetChangeListener.java
@@ -0,0 +1,20 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.listener;
+
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+
+
+public interface StyleSheetChangeListener {
+
+ public void styleSheetChanged(ExtendedCSSEngine owner);
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/lists/ExtendedCSSRuleList.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/lists/ExtendedCSSRuleList.java
new file mode 100644
index 00000000000..ccb4a7e6e6d
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/lists/ExtendedCSSRuleList.java
@@ -0,0 +1,47 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.lists;
+
+import java.util.Collection;
+import java.util.LinkedList;
+
+import org.w3c.dom.css.CSSRule;
+import org.w3c.dom.css.CSSRuleList;
+
+
+public class ExtendedCSSRuleList extends LinkedList<CSSRule> implements CSSRuleList {
+
+ private static final long serialVersionUID = 1L;
+
+ public ExtendedCSSRuleList() {
+
+ }
+
+ public ExtendedCSSRuleList(CSSRuleList listToCopy) {
+ for(int i = 0; i < listToCopy.getLength(); i++) {
+ add(listToCopy.item(i));
+ }
+ }
+
+ public ExtendedCSSRuleList(Collection<? extends CSSRule> listToCopy) {
+ super(listToCopy);
+ }
+
+ public int getLength() {
+ return size();
+ }
+
+ public CSSRule item(int index) {
+ return get(index);
+ }
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/lists/ExtendedSelectorList.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/lists/ExtendedSelectorList.java
new file mode 100644
index 00000000000..4f227fe62c5
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/lists/ExtendedSelectorList.java
@@ -0,0 +1,47 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.lists;
+
+import java.util.Collection;
+import java.util.LinkedList;
+
+import org.w3c.css.sac.Selector;
+import org.w3c.css.sac.SelectorList;
+
+
+public class ExtendedSelectorList extends LinkedList<Selector> implements SelectorList {
+
+ private static final long serialVersionUID = 0;
+
+ public ExtendedSelectorList() {
+
+ }
+
+ public ExtendedSelectorList(SelectorList listToCopy) {
+ for(int i = 0; i < listToCopy.getLength(); i++) {
+ add(listToCopy.item(i));
+ }
+ }
+
+ public ExtendedSelectorList(Collection<? extends Selector> listToCopy) {
+ super(listToCopy);
+ }
+
+ public int getLength() {
+ return size();
+ }
+
+ public Selector item(int index) {
+ return get(index);
+ }
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/lists/ExtendedStyleSheetList.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/lists/ExtendedStyleSheetList.java
new file mode 100644
index 00000000000..ae28bf25a59
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/lists/ExtendedStyleSheetList.java
@@ -0,0 +1,51 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.lists;
+
+import java.util.Collection;
+import java.util.LinkedList;
+
+import org.w3c.dom.stylesheets.StyleSheet;
+import org.w3c.dom.stylesheets.StyleSheetList;
+
+
+public class ExtendedStyleSheetList extends LinkedList<StyleSheet> implements StyleSheetList {
+
+ private static final long serialVersionUID = 1L;
+
+ public ExtendedStyleSheetList() {
+
+ }
+
+ public ExtendedStyleSheetList(StyleSheetList listToCopy) {
+ addAll(listToCopy);
+ }
+
+ public ExtendedStyleSheetList(Collection<? extends StyleSheet> listToCopy) {
+ super(listToCopy);
+ }
+
+ public int getLength() {
+ return size();
+ }
+
+ public StyleSheet item(int index) {
+ return get(index);
+ }
+
+ public void addAll(StyleSheetList styleSheets) {
+ for(int i = 0; i < styleSheets.getLength(); i++) {
+ add(styleSheets.item(i));
+ }
+ }
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/CSSAnnotations.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/CSSAnnotations.java
new file mode 100644
index 00000000000..05141e43bea
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/CSSAnnotations.java
@@ -0,0 +1,50 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.notation;
+
+public interface CSSAnnotations {
+
+ /**
+ * The css id property
+ */
+ public static final String CSS_GMF_ID_KEY = "cssId"; //$NON-NLS-1$
+
+ /**
+ * The css class property
+ */
+ public static final String CSS_GMF_CLASS_KEY = "cssClass"; //$NON-NLS-1$
+
+ /**
+ * The css style property
+ */
+ public static final String CSS_GMF_STYLE_KEY = "cssStyle"; //$NON-NLS-1$
+
+ /**
+ * The Diagram Stylesheets key
+ */
+ public static final String CSS_DIAGRAM_STYLESHEETS_KEY = "css_stylesheets"; //$NON-NLS-1$
+
+ /**
+ * The name of the EAnnotation containing css informations
+ *
+ * @see CSS_GMF_ID_KEY
+ * @see CSS_GMF_CLASS_KEY
+ * @see CSS_GMF_STYLE_KEY
+ */
+ public static final String CSS_ANNOTATION = "PapyrusCSS"; //$NON-NLS-1$
+
+ /**
+ * The name of the EAnnotation containing the list of feature names
+ * for which the value has been forced by the user.
+ */
+ public static final String CSS_FORCE_VALUE = "PapyrusCSSForceValue"; //$NON-NLS-1$
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/CSSDiagram.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/CSSDiagram.java
new file mode 100644
index 00000000000..c879f074240
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/CSSDiagram.java
@@ -0,0 +1,26 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.notation;
+
+import java.util.List;
+
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheet;
+
+public interface CSSDiagram extends Diagram {
+
+ public List<StyleSheet> getStyleSheets();
+
+ public ExtendedCSSEngine getEngine();
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/CSSDiagramImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/CSSDiagramImpl.java
new file mode 100644
index 00000000000..50975bfe4ee
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/CSSDiagramImpl.java
@@ -0,0 +1,107 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.notation;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.impl.AdapterImpl;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.gmf.runtime.notation.EObjectListValueStyle;
+import org.eclipse.gmf.runtime.notation.NamedStyle;
+import org.eclipse.gmf.runtime.notation.impl.DiagramImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.DiagramCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.resource.CSSNotationResource;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheet;
+
+@SuppressWarnings("restriction")
+public class CSSDiagramImpl extends DiagramImpl implements CSSDiagram {
+
+ protected ExtendedCSSEngine engine;
+
+ private Adapter disposeListener;
+
+ public ExtendedCSSEngine getEngine() {
+ if(engine == null) {
+ engine = new DiagramCSSEngine(getModelEngine(), this);
+ eResource().eAdapters().add(disposeListener = new DiagramDisposeListener());
+ }
+ return engine;
+ }
+
+ private void disposeEngine(Object notifier) {
+ if(engine != null) {
+ engine.dispose();
+ engine = null;
+ ((Resource)notifier).eAdapters().remove(disposeListener);
+ }
+ }
+
+ protected ExtendedCSSEngine getModelEngine() {
+ if(eResource() instanceof CSSNotationResource) {
+ return ((CSSNotationResource)eResource()).getEngine();
+ }
+ return null;
+ }
+
+ public List<StyleSheet> getStyleSheets() {
+ List<StyleSheet> result = new LinkedList<StyleSheet>();
+
+ for(Object styleObject : getStyles()) {
+ if(styleObject instanceof NamedStyle) {
+
+ NamedStyle style = (NamedStyle)styleObject;
+
+ if(CSSAnnotations.CSS_DIAGRAM_STYLESHEETS_KEY.equals(style.getName())) {
+ if(style instanceof EObjectListValueStyle) {
+
+ EObjectListValueStyle stylesheetsStyle = (EObjectListValueStyle)style;
+
+ for(Object eObjectValue : stylesheetsStyle.getEObjectListValue()) {
+ if(eObjectValue instanceof StyleSheet) {
+ result.add((StyleSheet)eObjectValue);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return result;
+ }
+
+ private class DiagramDisposeListener extends AdapterImpl {
+
+ @Override
+ public void notifyChanged(Notification notification) {
+ switch(notification.getEventType()) {
+ case Notification.REMOVE:
+ if(notification.getOldValue() == CSSDiagramImpl.this) {
+ disposeEngine(notification.getNotifier());
+ }
+ break;
+ case Notification.REMOVE_MANY:
+ for(Object object : (Collection<?>)notification.getOldValue()) {
+ if(object == CSSDiagramImpl.this) {
+ disposeEngine(notification.getNotifier());
+ }
+ }
+ break;
+ }
+ }
+ }
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/ForceValueHelper.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/ForceValueHelper.java
new file mode 100644
index 00000000000..914b8022d8a
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/ForceValueHelper.java
@@ -0,0 +1,132 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.notation;
+
+import org.eclipse.emf.common.util.EMap;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.css.resource.CSSNotationResource;
+
+/**
+ * This helper handles the EAnnotation used to distinguish between an EMF
+ * "unset" value and a "default value" (Which cannot be distinguished for
+ * mandatory values in the standard EMF implementation).
+ *
+ * The CSS support is only activated for properties which don't have a value.
+ * The problem is that in GMF, some properties always have a value, which
+ * would prevent the CSS from working.
+ *
+ * Thus, we distinguish three cases:
+ *
+ * - The property has a value different from the default value: isSet = true
+ * - The property has a value equal to the default value: isSet = false
+ * - The property has a value equal to the default value, and the ForceValue
+ * annotation is defined: isSet = true
+ *
+ * unsetValue(object, feature) always results in isSet(object, feature) = false
+ * (Which is not always the EMF behavior)
+ *
+ * In order not to contaminate default GMF Models, these methods are only
+ * applied if the resource is a CSSNotationResource. Otherwise, the behavior
+ * is the standard EMF/GMF one.
+ *
+ * @author Camille Letavernier
+ */
+public class ForceValueHelper {
+
+ public static void setValue(View view, EStructuralFeature feature, Object value) {
+ if(!isCSSView(view)) {
+ //Do not contaminate non-Papyrus models
+ return;
+ }
+
+ //Adds the annotation which indicates that the value has been forced, if needed
+
+ if(equals(value, feature.getDefaultValue())) {
+ // System.out.println("Forcing default value for " + view);
+ String annotationKey = feature.getName();
+ EAnnotation eAnnotation = view.getEAnnotation(CSSAnnotations.CSS_FORCE_VALUE);
+ if(eAnnotation == null) {
+ eAnnotation = EcorePackage.eINSTANCE.getEcoreFactory().createEAnnotation();
+ eAnnotation.setEModelElement(view);
+ eAnnotation.setSource(CSSAnnotations.CSS_FORCE_VALUE);
+ }
+
+ EMap<String, String> details = eAnnotation.getDetails();
+ details.put(annotationKey, Boolean.toString(true));
+ }
+ }
+
+ private static boolean isCSSView(View view) {
+ // return false;
+ return view != null && view.eResource() instanceof CSSNotationResource;
+ }
+
+ private static boolean equals(Object value1, Object value2) {
+ if(value1 == null) {
+ return value2 == null;
+ }
+ return value1.equals(value2);
+ }
+
+ public static void unsetValue(View view, EStructuralFeature feature) {
+ if(feature == null) {
+ return;
+ }
+
+ if(!isCSSView(view)) {
+ //Do not contaminate non-Papyrus models
+ return;
+ }
+
+ //Remove the annotation which forces the value, if needed
+
+ String annotationKey = feature.getName();
+ EAnnotation eAnnotation = view.getEAnnotation(CSSAnnotations.CSS_FORCE_VALUE);
+ if(eAnnotation != null) {
+ EMap<String, String> details = eAnnotation.getDetails();
+ details.remove(annotationKey);
+ if(details.isEmpty()) {
+ view.getEAnnotations().remove(eAnnotation);
+ }
+ }
+ }
+
+ public static boolean isSet(View view, EStructuralFeature feature, Object value) {
+ return isSet(view, view, feature, value);
+ }
+
+ public static boolean isSet(View annotationContext, EObject style, EStructuralFeature feature, Object value) {
+ if(!isCSSView(annotationContext)) {
+ //Do not contaminate non-Papyrus models
+ return true;
+ }
+
+ // return false;
+
+ if(equals(value, feature.getDefaultValue())) {
+ EAnnotation eAnnotation = annotationContext.getEAnnotation(CSSAnnotations.CSS_FORCE_VALUE);
+ if(eAnnotation == null) {
+ return false;
+ }
+
+ String annotationKey = feature.getName();
+
+ return eAnnotation.getDetails().containsKey(annotationKey);
+ }
+
+ return true;
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/preferences/ThemePreferenceInitializer.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/preferences/ThemePreferenceInitializer.java
new file mode 100644
index 00000000000..8ac8f88fdc1
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/preferences/ThemePreferenceInitializer.java
@@ -0,0 +1,25 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.preferences;
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+
+
+public class ThemePreferenceInitializer extends AbstractPreferenceInitializer {
+
+ @Override
+ public void initializeDefaultPreferences() {
+ // IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+ // store.setDefault(ThemePreferencesPage.CURRENT_THEME, null);
+ }
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/preferences/ThemePreferences.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/preferences/ThemePreferences.java
new file mode 100644
index 00000000000..c1877eb8bf9
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/preferences/ThemePreferences.java
@@ -0,0 +1,21 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.preferences;
+
+
+public interface ThemePreferences {
+
+ /**
+ * The "Current Theme" preference
+ */
+ public static String CURRENT_THEME = "currentTheme"; //$NON-NLS-1$
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/preferences/ThemePreferencesPage.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/preferences/ThemePreferencesPage.java
new file mode 100644
index 00000000000..2d970dbbc47
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/preferences/ThemePreferencesPage.java
@@ -0,0 +1,128 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.preferences;
+
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.preference.ComboFieldEditor;
+import org.eclipse.jface.preference.FieldEditor;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.papyrus.infra.gmfdiag.common.handler.RefreshHandler;
+import org.eclipse.papyrus.infra.gmfdiag.css.Activator;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.WorkspaceCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.theme.Theme;
+import org.eclipse.papyrus.infra.gmfdiag.css.theme.ThemeManager;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+
+public class ThemePreferencesPage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+
+ public boolean needsRefresh = false;
+
+ /**
+ *
+ * Constructor.
+ *
+ */
+ public ThemePreferencesPage() {
+ }
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param style
+ */
+ public ThemePreferencesPage(int style) {
+ super(style);
+ }
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param title
+ * @param style
+ */
+ public ThemePreferencesPage(String title, int style) {
+ super(title, style);
+ }
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param title
+ * @param image
+ * @param style
+ */
+ public ThemePreferencesPage(String title, ImageDescriptor image, int style) {
+ super(title, image, style);
+ }
+
+ public void init(IWorkbench workbench) {
+ setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ setDescription("Papyrus Theme preferences");
+ }
+
+ @Override
+ protected void createFieldEditors() {
+ String[][] themes = getFieldThemes();
+ ComboFieldEditor editor = new ComboFieldEditor(ThemePreferences.CURRENT_THEME, "Current theme:", themes, getFieldEditorParent());
+ addField(editor);
+ }
+
+ @Override
+ public void propertyChange(PropertyChangeEvent event) {
+ super.propertyChange(event);
+ if(ThemePreferences.CURRENT_THEME.equals(event.getProperty())) {
+ needsRefresh = true;
+ }
+ if(FieldEditor.VALUE.equals(event.getProperty())) {
+ if(ThemePreferences.CURRENT_THEME.equals(((FieldEditor)event.getSource()).getPreferenceName())) {
+ needsRefresh = true;
+ }
+ }
+ }
+
+ @Override
+ public boolean performOk() {
+ boolean result = super.performOk();
+ if(needsRefresh) {
+ WorkspaceCSSEngine.instance.reset();
+ try {
+ (new RefreshHandler()).execute(null);
+ } catch (ExecutionException ex) {
+ Activator.log.error(ex);
+ }
+ }
+ return result;
+ }
+
+ protected String[][] getFieldThemes() {
+ List<Theme> themes = ThemeManager.instance.getThemes();
+
+ String[][] result = new String[themes.size()][2];
+ int i = 0;
+ for(Theme theme : themes) {
+ result[i][0] = theme.getLabel();
+ result[i][1] = theme.getId();
+ i++;
+ }
+ return result;
+ }
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/provider/CSSAppearanceProvider.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/provider/CSSAppearanceProvider.java
new file mode 100644
index 00000000000..ceb08f4a7af
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/provider/CSSAppearanceProvider.java
@@ -0,0 +1,47 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.provider;
+
+import org.eclipse.emf.ecore.EModelElement;
+import org.eclipse.papyrus.infra.emf.appearance.style.AnnotationStyleProvider;
+
+
+public class CSSAppearanceProvider extends AnnotationStyleProvider {
+
+ @Override
+ public boolean showElementIcon(EModelElement modelElement) {
+ boolean result = super.showElementIcon(modelElement);
+ if(!result && modelElement instanceof CustomStyle) {
+ return ((CustomStyle)modelElement).showElementIcon();
+ }
+ return result;
+ }
+
+ @Override
+ public int getQualifiedNameDepth(EModelElement modelElement) {
+ int result = super.getQualifiedNameDepth(modelElement);
+ if(result == 1000 && modelElement instanceof CustomStyle) {
+ return ((CustomStyle)modelElement).getQualifiedNameDepth();
+ }
+ return result;
+ }
+
+ @Override
+ public boolean showShadow(EModelElement modelElement) {
+ boolean result = super.showShadow(modelElement);
+ if(!result && modelElement instanceof CustomStyle) {
+ return ((CustomStyle)modelElement).showShadow();
+ }
+ return result;
+ }
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/provider/CSSClassContentProvider.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/provider/CSSClassContentProvider.java
new file mode 100644
index 00000000000..34fb2aa1567
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/provider/CSSClassContentProvider.java
@@ -0,0 +1,121 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.provider;
+
+import java.text.Collator;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.eclipse.e4.ui.css.core.impl.dom.CSSStyleRuleImpl;
+import org.eclipse.e4.ui.css.core.impl.sac.CSSClassConditionImpl;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.widgets.providers.AbstractStaticContentProvider;
+import org.w3c.css.sac.CombinatorCondition;
+import org.w3c.css.sac.Condition;
+import org.w3c.css.sac.ConditionalSelector;
+import org.w3c.css.sac.DescendantSelector;
+import org.w3c.css.sac.ElementSelector;
+import org.w3c.css.sac.Selector;
+import org.w3c.css.sac.SiblingSelector;
+import org.w3c.dom.css.CSSRule;
+import org.w3c.dom.css.CSSStyleSheet;
+
+@SuppressWarnings("restriction")
+public class CSSClassContentProvider extends AbstractStaticContentProvider {
+
+ private String elementName;
+
+ private ExtendedCSSEngine engine;
+
+ public CSSClassContentProvider(String elementName, ExtendedCSSEngine engine) {
+ this.elementName = elementName;
+ this.engine = engine;
+ }
+
+ public Object[] getElements() {
+ return getAvailableClasses().toArray();
+ }
+
+ public Collection<String> getAvailableClasses() {
+ Set<String> result = new TreeSet<String>(Collator.getInstance());
+
+ for(org.w3c.dom.stylesheets.StyleSheet stylesheet : engine.getAllStylesheets()) {
+ if(stylesheet instanceof CSSStyleSheet) {
+ CSSStyleSheet cssStylesheet = (CSSStyleSheet)stylesheet;
+ for(int i = 0; i < cssStylesheet.getCssRules().getLength(); i++) {
+ CSSRule cssRule = cssStylesheet.getCssRules().item(i);
+ if(cssRule instanceof CSSStyleRuleImpl) {
+ CSSStyleRuleImpl rule = (CSSStyleRuleImpl)cssRule;
+
+ for(int j = 0; j < rule.getSelectorList().getLength(); j++) {
+ Selector selector = rule.getSelectorList().item(j);
+
+ result.addAll(findClassesFromSelector(selector));
+ }
+ }
+ }
+ }
+ }
+
+ return result;
+ }
+
+ private List<String> findClassesFromSelector(Selector selector) {
+ List<String> result = new LinkedList<String>();
+ if(selector instanceof ConditionalSelector) {
+ result.addAll(findClassesFromSelector((ConditionalSelector)selector));
+ } else if(selector instanceof DescendantSelector) { //A B | A > B
+ result.addAll(findClassesFromSelector(((DescendantSelector)selector).getSimpleSelector()));
+ result.addAll(findClassesFromSelector(((DescendantSelector)selector).getAncestorSelector()));
+ } else if(selector instanceof SiblingSelector) { //A + B
+ result.addAll(findClassesFromSelector(((SiblingSelector)selector).getSelector()));
+ result.addAll(findClassesFromSelector(((SiblingSelector)selector).getSiblingSelector()));
+ }
+ return result;
+ }
+
+ private List<String> findClassesFromSelector(ConditionalSelector selector) {
+ List<String> result = new LinkedList<String>();
+
+ Selector simpleSelector = selector.getSimpleSelector();
+
+ if(simpleSelector instanceof ElementSelector) {
+ ElementSelector elementSelector = (ElementSelector)simpleSelector;
+ String localName = elementSelector.getLocalName();
+ if("*".equals(localName) || "*".equals(elementName) || elementName.equals(localName) || localName == null) {
+ Condition condition = selector.getCondition();
+ result.addAll(findClassesFromCondition(condition));
+ }
+ }
+
+ return result;
+ }
+
+ private List<String> findClassesFromCondition(Condition condition) {
+ if(condition instanceof CSSClassConditionImpl) {
+ return Collections.singletonList(((CSSClassConditionImpl)condition).getValue());
+ } else if(condition instanceof CombinatorCondition) {
+ CombinatorCondition combinatorCondition = (CombinatorCondition)condition;
+ List<String> result = new LinkedList<String>();
+ result.addAll(findClassesFromCondition(combinatorCondition.getFirstCondition()));
+ result.addAll(findClassesFromCondition(combinatorCondition.getSecondCondition()));
+ return result;
+ }
+
+ return Collections.emptyList();
+ }
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/provider/CSSCustomStyleDelegate.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/provider/CSSCustomStyleDelegate.java
new file mode 100644
index 00000000000..e1e83ef1097
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/provider/CSSCustomStyleDelegate.java
@@ -0,0 +1,83 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.provider;
+
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.helper.StringHelper;
+import org.w3c.dom.Element;
+import org.w3c.dom.css.CSSValue;
+
+@SuppressWarnings("restriction")
+public class CSSCustomStyleDelegate implements CustomStyle {
+
+ private View view;
+
+ private ExtendedCSSEngine engine;
+
+ private Element element;
+
+ private static final String NONE = "none";
+
+ private static final String FULL = "full";
+
+ private static int NONE_VALUE = 1000;
+
+ private static int FULL_VALUE = 0;
+
+ public CSSCustomStyleDelegate(View view, ExtendedCSSEngine engine) {
+ this.view = view;
+ this.engine = engine;
+ this.element = engine.getElement(this.view);
+ }
+
+ public boolean showElementIcon() {
+ CSSValue cssValue = engine.retrievePropertyValue(element, "elementIcon");
+ if(cssValue == null) {
+ return false;
+ }
+ return (Boolean)engine.convert(cssValue, Boolean.class, null);
+ }
+
+ public int getQualifiedNameDepth() {
+ CSSValue cssValue = engine.retrievePropertyValue(element, "qualifiedNameDepth");
+ if(cssValue == null) {
+ return NONE_VALUE;
+ }
+
+ String cssText = cssValue.getCssText();
+
+ if(StringHelper.equals(FULL, cssText)) {
+ return FULL_VALUE;
+ }
+
+ if(StringHelper.equals(NONE, cssText)) {
+ return NONE_VALUE;
+ }
+
+ try {
+ int value = Integer.parseInt(cssText);
+ return value > 0 ? -value : value;
+ } catch (NumberFormatException ex) {
+ engine.handleExceptions(ex);
+ return NONE_VALUE;
+ }
+ }
+
+ public boolean showShadow() {
+ CSSValue cssValue = engine.retrievePropertyValue(element, "shadow");
+ if(cssValue == null) {
+ return false;
+ }
+ return (Boolean)engine.convert(cssValue, Boolean.class, null);
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/provider/CustomStyle.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/provider/CustomStyle.java
new file mode 100644
index 00000000000..6674a5033c2
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/provider/CustomStyle.java
@@ -0,0 +1,22 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.provider;
+
+
+public interface CustomStyle {
+
+ public boolean showElementIcon();
+
+ public int getQualifiedNameDepth();
+
+ public boolean showShadow();
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/resource/CSSNotationModel.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/resource/CSSNotationModel.java
new file mode 100644
index 00000000000..dbd32d9df6e
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/resource/CSSNotationModel.java
@@ -0,0 +1,26 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.resource;
+
+import org.eclipse.papyrus.infra.core.resource.ModelSet;
+import org.eclipse.papyrus.infra.core.resource.notation.NotationModel;
+import org.eclipse.papyrus.infra.gmfdiag.css.helper.CSSHelper;
+
+public class CSSNotationModel extends NotationModel {
+
+ @Override
+ public void init(ModelSet modelManager) {
+ super.init(modelManager);
+
+ CSSHelper.installCSSSupport(getResourceSet());
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/resource/CSSNotationResource.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/resource/CSSNotationResource.java
new file mode 100644
index 00000000000..a3261b76f8a
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/resource/CSSNotationResource.java
@@ -0,0 +1,72 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.resource;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.impl.AdapterImpl;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.gmf.runtime.emf.core.resources.GMFResource;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ModelCSSEngine;
+
+@SuppressWarnings("restriction")
+public class CSSNotationResource extends GMFResource {
+
+ private ExtendedCSSEngine engine;
+
+ private Adapter disposeListener;
+
+ public CSSNotationResource(URI uri) {
+ super(uri);
+ }
+
+ public ExtendedCSSEngine getEngine() {
+ if(engine == null) {
+ engine = new ModelCSSEngine(this);
+ getResourceSet().eAdapters().add(disposeListener = new ResourceDisposeListener());
+ }
+ return engine;
+ }
+
+ private void disposeEngine(Object notifier) {
+ if(engine != null) {
+ engine.dispose();
+ engine = null;
+ ((ResourceSet)notifier).eAdapters().remove(disposeListener);
+ }
+ }
+
+ private class ResourceDisposeListener extends AdapterImpl {
+
+ @Override
+ public void notifyChanged(Notification notification) {
+ switch(notification.getEventType()) {
+ case Notification.REMOVE_MANY:
+ for(Object oldValue : (Collection<?>)notification.getOldValue()) {
+ if(oldValue == CSSNotationResource.this) {
+ disposeEngine(notification.getNotifier());
+ }
+ }
+ break;
+ case Notification.REMOVE:
+ if(notification.getOldValue() == CSSNotationResource.this) {
+ disposeEngine(notification.getNotifier());
+ }
+ break;
+ }
+ }
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/resource/CSSNotationResourceFactory.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/resource/CSSNotationResourceFactory.java
new file mode 100644
index 00000000000..4d6a38f38a8
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/resource/CSSNotationResourceFactory.java
@@ -0,0 +1,37 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.resource;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.xmi.XMIResource;
+import org.eclipse.gmf.runtime.emf.core.internal.util.EMFCoreConstants;
+import org.eclipse.gmf.runtime.emf.core.resources.GMFResourceFactory;
+
+
+public class CSSNotationResourceFactory extends GMFResourceFactory {
+
+ @Override
+ public Resource createResource(URI uri) {
+
+ XMIResource resource = new CSSNotationResource(uri);
+
+ resource.getDefaultLoadOptions().putAll(GMFResourceFactory.getDefaultLoadOptions());
+ resource.getDefaultSaveOptions().putAll(GMFResourceFactory.getDefaultSaveOptions());
+
+ if(!resource.getEncoding().equals(EMFCoreConstants.XMI_ENCODING)) {
+ resource.setEncoding(EMFCoreConstants.XMI_ENCODING);
+ }
+
+ return resource;
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/theme/Theme.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/theme/Theme.java
new file mode 100644
index 00000000000..39c19f2aee2
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/theme/Theme.java
@@ -0,0 +1,63 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.theme;
+
+import java.net.URL;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.swt.graphics.Image;
+
+
+public class Theme {
+
+ private String label;
+
+ private Image icon;
+
+ private final String id;
+
+ private final List<URL> styleSheets;
+
+ public Theme(String id) {
+ this.id = id;
+ this.styleSheets = new LinkedList<URL>();
+ }
+
+ public String getLabel() {
+ return label == null || "".equals(label) ? id : label;
+ }
+
+ public void setLabel(String label) {
+ this.label = label;
+ }
+
+ public Image getIcon() {
+ return icon;
+ }
+
+ public void setIcon(Image icon) {
+ this.icon = icon;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void addStyleSheet(URL url) {
+ styleSheets.add(url);
+ }
+
+ public List<URL> getStyleSheets() {
+ return styleSheets;
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/theme/ThemeManager.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/theme/ThemeManager.java
new file mode 100644
index 00000000000..bbda16c9b82
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/theme/ThemeManager.java
@@ -0,0 +1,189 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.theme;
+
+import java.io.IOException;
+import java.net.URL;
+import java.text.Collator;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.preference.IPersistentPreferenceStore;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.infra.gmfdiag.css.Activator;
+import org.eclipse.papyrus.infra.gmfdiag.css.preferences.ThemePreferences;
+import org.eclipse.swt.graphics.Image;
+
+
+public class ThemeManager {
+
+ public static String EXTENSION_ID = Activator.PLUGIN_ID + ".theme";
+
+ public static ThemeManager instance = new ThemeManager();
+
+ private Map<String, Theme> allThemes;
+
+ public List<Theme> getThemes() {
+ List<Theme> sortedThemes = new LinkedList<Theme>(getAllThemes().values());
+ Collections.sort(sortedThemes, ThemeComparator.instance);
+ return sortedThemes;
+ }
+
+ public List<URL> getWorkspaceStyleSheets() {
+ Theme current = findCurrentTheme();
+ if(current == null) {
+ return Collections.emptyList();
+ }
+ return current.getStyleSheets();
+ }
+
+ public Theme getTheme(String themeId) {
+ return getAllThemes().get(themeId);
+ }
+
+ private Map<String, Theme> getAllThemes() {
+ if(allThemes == null) {
+ allThemes = new HashMap<String, Theme>();
+ allThemes.put(EmptyTheme.instance.getId(), EmptyTheme.instance);
+ IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor(EXTENSION_ID);
+
+ loadThemeDefinitions(config);
+ loadThemeContributions(config);
+ }
+
+ return allThemes;
+ }
+
+ private void loadThemeDefinitions(IConfigurationElement[] config) {
+ for(IConfigurationElement themeConfig : config) {
+ if(!themeConfig.getName().equals("themeDefinition")) {
+ continue;
+ }
+
+ final String themeId = themeConfig.getAttribute("id");
+ if(themeId == null) {
+ Activator.log.warn("Cannot define a CSS Theme with an empty id (Contributed by " + themeConfig.getContributor() + ")");
+ continue;
+ }
+ Theme theme = new Theme(themeId);
+
+ String themeLabel = themeConfig.getAttribute("label");
+ theme.setLabel(themeLabel);
+
+ String themeIcon = themeConfig.getAttribute("icon");
+ if(themeIcon != null) {
+ //FIXME: Use the Papyrus Image service when it is available
+ Image icon = org.eclipse.papyrus.infra.widgets.Activator.getDefault().getImage(themeConfig.getContributor().getName(), themeIcon);
+ if(icon != null) {
+ theme.setIcon(icon);
+ }
+ }
+
+ allThemes.put(themeId, theme);
+ }
+ }
+
+ private void loadThemeContributions(IConfigurationElement[] config) {
+ for(IConfigurationElement themeConfig : config) {
+ if(!themeConfig.getName().equals("themeContribution")) {
+ continue;
+ }
+
+ final String themeId = themeConfig.getAttribute("id");
+ if(themeId == null || !allThemes.containsKey(themeId)) {
+ Activator.log.warn("Cannot contribute to an undefined theme: " + themeId);
+ continue;
+ }
+
+ Theme theme = allThemes.get(themeId);
+
+ IConfigurationElement[] stylesheets = themeConfig.getChildren("stylesheet");
+ for(IConfigurationElement stylesheetConfig : stylesheets) {
+ String path = stylesheetConfig.getAttribute("stylesheetPath");
+ try {
+ URL url = new URL("platform:/plugin/" + themeConfig.getContributor().getName() + "/" + path);
+ theme.addStyleSheet(url);
+ } catch (IOException ex) {
+ Activator.log.error(ex);
+ }
+ }
+ }
+ }
+
+ private Theme findCurrentTheme() {
+ IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+
+ if(store.contains(ThemePreferences.CURRENT_THEME)) {
+ String themeId = store.getString(ThemePreferences.CURRENT_THEME);
+ Theme theme = getAllThemes().containsKey(themeId) ? getAllThemes().get(themeId) : EmptyTheme.instance;
+ return theme;
+ }
+
+ //The theme has not been defined: return the first one, and store it
+ List<Theme> sortedThemes = getThemes();
+ if(sortedThemes.size() < 2) {
+ return EmptyTheme.instance;
+ }
+
+ //Index 0 is EmptyTheme ; we return the first non-empty theme
+ Theme theme = sortedThemes.get(1);
+ store.setValue(ThemePreferences.CURRENT_THEME, theme.getId());
+ try {
+ ((IPersistentPreferenceStore)store).save();
+ } catch (IOException e) {
+ Activator.log.error(e);
+ }
+ return theme;
+ }
+
+ private static class EmptyTheme extends Theme {
+
+ public static Theme instance = new EmptyTheme();
+
+ private EmptyTheme() {
+ super("none"); //$NON-NLS-1$
+ setLabel("No theme");
+ Image icon = org.eclipse.papyrus.infra.widgets.Activator.getDefault().getImage("icons/Delete_12x12.gif");
+ setIcon(icon);
+ }
+ }
+
+ private static class ThemeComparator implements Comparator<Theme> {
+
+ private ThemeComparator() {
+ }
+
+ public int compare(Theme o1, Theme o2) {
+ if(o1 == EmptyTheme.instance) {
+ return -1;
+ }
+ if(o2 == EmptyTheme.instance) {
+ return 1;
+ }
+
+ return Collator.getInstance().compare(o1.getLabel(), o2.getLabel());
+ }
+
+ public static Comparator<Theme> instance = new ThemeComparator();
+
+ }
+
+ private ThemeManager() {
+
+ }
+}

Back to the top