diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/META-INF/MANIFEST.MF b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/META-INF/MANIFEST.MF index 49a51a15a398d0d92a0ccba659e197a27b6ce26d..3e09fb3423a19baffeeaedecc1cbe3bb2e600f13 100644 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/META-INF/MANIFEST.MF +++ b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/META-INF/MANIFEST.MF @@ -23,7 +23,8 @@ Require-Bundle: org.eclipse.ui, com.google.guava;bundle-version="10.0.1", com.google.inject;bundle-version="3.0.0", javax.inject;bundle-version="1.0.0", - edu.kit.ipd.descartes.mm.applicationlevel + edu.kit.ipd.descartes.mm.applicationlevel, + org.eclipselabs.spray.runtime.graphiti.zest;bundle-version="0.5.0" Import-Package: org.apache.log4j, org.apache.commons.logging, org.eclipse.xtext.xbase.lib, diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/shapepreviews/svg/CompositeShape.svg b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/shapepreviews/svg/CompositeShape.svg index d860338396073504b12850e3cf8786a5060da75e..57f413e7a63dd5f113bb757a67a02a5b01cc8fba 100644 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/shapepreviews/svg/CompositeShape.svg +++ b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/shapepreviews/svg/CompositeShape.svg @@ -1,35 +1,35 @@ -<?xml version="1.0" standalone="no" ?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" - "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> -<svg width="110" height="55" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> - <title>Shape: CompositeShape</title> - <metadata> - <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" - xmlns:dc="http://purl.org/dc/elements/1.1/"> - <rdf:Description rdf:about="http://code.google.com/a/eclipselabs.org/p/spray/"> - <dc:creator>org.eclipselabs.spray.shapes.generator.GeneratorSVGDefinition</dc:creator> - <dc:subject>Spray SVG Shape</dc:subject> - <dc:source>http://code.google.com/a/eclipselabs.org/p/spray/</dc:source> - <dc:format>image/svg+xml</dc:format> - <dc:type>Image</dc:type> - </rdf:Description> - </rdf:RDF> - </metadata> -<defs> - <style type="text/css"> <![CDATA[ - rect {fill: none; stroke:black; stroke-width:1px} - line {fill: none; stroke:black; stroke-width:1px} - polyline {fill: none; stroke:black; stroke-width:1px} - polygon {fill: none; stroke:black; stroke-width:1px} - circle {fill: none; stroke:black; stroke-width:1px} - ellipse {fill: none; stroke:black; stroke-width:1px} - text {fill: black; font-family: verdana,sans-serif; font-size:12px;} - .default {fill: none; stroke:black; stroke-width:1px} - ]]> - </style> - <rect id="anchor" style="fill:#a0c0e8" width="5" height="5"/> -</defs> -<rect x="0" y="0" width="100" height="25"/> -<text x="5" y="25">#classText</text> -</svg> +<?xml version="1.0" standalone="no" ?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" + "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> +<svg width="110" height="55" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> + <title>Shape: CompositeShape</title> + <metadata> + <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> + <rdf:Description rdf:about="http://code.google.com/a/eclipselabs.org/p/spray/"> + <dc:creator>org.eclipselabs.spray.shapes.generator.GeneratorSVGDefinition</dc:creator> + <dc:subject>Spray SVG Shape</dc:subject> + <dc:source>http://code.google.com/a/eclipselabs.org/p/spray/</dc:source> + <dc:format>image/svg+xml</dc:format> + <dc:type>Image</dc:type> + </rdf:Description> + </rdf:RDF> + </metadata> +<defs> + <style type="text/css"> <![CDATA[ + rect {fill: none; stroke:black; stroke-width:1px} + line {fill: none; stroke:black; stroke-width:1px} + polyline {fill: none; stroke:black; stroke-width:1px} + polygon {fill: none; stroke:black; stroke-width:1px} + circle {fill: none; stroke:black; stroke-width:1px} + ellipse {fill: none; stroke:black; stroke-width:1px} + text {fill: black; font-family: verdana,sans-serif; font-size:12px;} + .default {fill: none; stroke:black; stroke-width:1px} + ]]> + </style> + <rect id="anchor" style="fill:#a0c0e8" width="5" height="5"/> +</defs> +<rect x="0" y="0" width="100" height="25"/> +<text x="5" y="25">#classText</text> +</svg> diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/shapepreviews/svg/RectShape.svg b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/shapepreviews/svg/RectShape.svg index da7f6f21b363598876772e76b966d0f9a1512f94..f1b6dacb942c230104ef9869a630da47262cfb3c 100644 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/shapepreviews/svg/RectShape.svg +++ b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/shapepreviews/svg/RectShape.svg @@ -1,35 +1,35 @@ -<?xml version="1.0" standalone="no" ?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" - "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> -<svg width="110" height="55" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> - <title>Shape: RectShape</title> - <metadata> - <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" - xmlns:dc="http://purl.org/dc/elements/1.1/"> - <rdf:Description rdf:about="http://code.google.com/a/eclipselabs.org/p/spray/"> - <dc:creator>org.eclipselabs.spray.shapes.generator.GeneratorSVGDefinition</dc:creator> - <dc:subject>Spray SVG Shape</dc:subject> - <dc:source>http://code.google.com/a/eclipselabs.org/p/spray/</dc:source> - <dc:format>image/svg+xml</dc:format> - <dc:type>Image</dc:type> - </rdf:Description> - </rdf:RDF> - </metadata> -<defs> - <style type="text/css"> <![CDATA[ - rect {fill: none; stroke:black; stroke-width:1px} - line {fill: none; stroke:black; stroke-width:1px} - polyline {fill: none; stroke:black; stroke-width:1px} - polygon {fill: none; stroke:black; stroke-width:1px} - circle {fill: none; stroke:black; stroke-width:1px} - ellipse {fill: none; stroke:black; stroke-width:1px} - text {fill: black; font-family: verdana,sans-serif; font-size:12px;} - .default {fill: none; stroke:black; stroke-width:1px} - ]]> - </style> - <rect id="anchor" style="fill:#a0c0e8" width="5" height="5"/> -</defs> -<rect x="0" y="0" width="100" height="25"/> -<text x="5" y="25">#rectText</text> -</svg> +<?xml version="1.0" standalone="no" ?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" + "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> +<svg width="110" height="55" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> + <title>Shape: RectShape</title> + <metadata> + <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> + <rdf:Description rdf:about="http://code.google.com/a/eclipselabs.org/p/spray/"> + <dc:creator>org.eclipselabs.spray.shapes.generator.GeneratorSVGDefinition</dc:creator> + <dc:subject>Spray SVG Shape</dc:subject> + <dc:source>http://code.google.com/a/eclipselabs.org/p/spray/</dc:source> + <dc:format>image/svg+xml</dc:format> + <dc:type>Image</dc:type> + </rdf:Description> + </rdf:RDF> + </metadata> +<defs> + <style type="text/css"> <![CDATA[ + rect {fill: none; stroke:black; stroke-width:1px} + line {fill: none; stroke:black; stroke-width:1px} + polyline {fill: none; stroke:black; stroke-width:1px} + polygon {fill: none; stroke:black; stroke-width:1px} + circle {fill: none; stroke:black; stroke-width:1px} + ellipse {fill: none; stroke:black; stroke-width:1px} + text {fill: black; font-family: verdana,sans-serif; font-size:12px;} + .default {fill: none; stroke:black; stroke-width:1px} + ]]> + </style> + <rect id="anchor" style="fill:#a0c0e8" width="5" height="5"/> +</defs> +<rect x="0" y="0" width="100" height="25"/> +<text x="5" y="25">#rectText</text> +</svg> diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/Activator.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/Activator.java deleted file mode 100644 index 40149f843a19960d79cbe0291cf2499e579146ff..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/Activator.java +++ /dev/null @@ -1,70 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray PluginActivator.xtend - * - * This file contains generated and should not be changed. - * Use the extension point class (the direct subclass of this class) to add manual code - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.eclipse.xtext.util.Modules2; -import org.eclipselabs.spray.runtime.graphiti.GraphitiRuntimeModule; -import org.osgi.framework.BundleContext; - -import com.google.inject.Guice; -import com.google.inject.Injector; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - private Injector injector; - - // The plug-in ID - public static final String PLUGIN_ID = "spray"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - injector = createInjector(); - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - 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; - } - - protected Injector createInjector() { - return Guice.createInjector(Modules2.mixin(new GraphitiRuntimeModule(), new CompositediagramModule())); - } - - public final Injector getInjector() { - return injector; - } - - public static final <T> T get(Class<T> type) { - return getDefault().getInjector().getInstance(type); - } -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/CompositediagramModule.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/CompositediagramModule.java deleted file mode 100644 index f1af662a7c53d2e88afcd5933db8c9f206a1dc23..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/CompositediagramModule.java +++ /dev/null @@ -1,19 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray GuiceModule.xtend - * - * This file is an extension point: copy to "src" folder to manually add code to this - * extension point. - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram; - -public class CompositediagramModule extends CompositediagramModuleBase { - // Add custom bindings here - // public Class<? extends MyInterface> bindMyInterface () { - // return MyInterfaceImpl.class; - // } - // - // Get instances through the Activator: - // MyInterface instance = Activator.get(MyInterface.class); -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/CompositediagramModuleBase.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/CompositediagramModuleBase.java deleted file mode 100644 index 1aa7685c6f1bb7bc033a7041fd67d62c45bc1186..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/CompositediagramModuleBase.java +++ /dev/null @@ -1,36 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray GuiceModule.xtend - * - * This file contains generated and should not be changed. - * Use the extension point class (the direct subclass of this class) to add manual code - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram; - -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.PlatformUI; -import org.eclipse.xtext.service.AbstractGenericModule; -import org.eclipse.xtext.ui.editor.GlobalURIEditorOpener; -import org.eclipse.xtext.ui.editor.IURIEditorOpener; -import org.eclipse.xtext.ui.resource.IStorage2UriMapper; -import org.eclipse.xtext.ui.resource.Storage2UriMapperImpl; - -import com.google.inject.Binder; -import com.google.inject.name.Names; - -public class CompositediagramModuleBase extends AbstractGenericModule { - public Class<? extends IURIEditorOpener> bindIURIEditorOpener() { - return GlobalURIEditorOpener.class; - } - - @Override - public void configure(Binder binder) { - binder.bind(IStorage2UriMapper.class).to(Storage2UriMapperImpl.class); - binder.bind(IWorkbench.class).toInstance(PlatformUI.getWorkbench()); - binder.bind(IWorkspace.class).toInstance(ResourcesPlugin.getWorkspace()); - binder.bind(String.class).annotatedWith(Names.named("diagramTypeId")).toInstance("compositediagram"); - } -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/diagram/CompositediagramDiagramTypeProvider.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/diagram/CompositediagramDiagramTypeProvider.java deleted file mode 100644 index d47504186257624146bb21124da1339f139de548..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/diagram/CompositediagramDiagramTypeProvider.java +++ /dev/null @@ -1,13 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray DiagramTypeProvider.xtend - * - * This file is an extension point: copy to "src" folder to manually add code to this - * extension point. - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.diagram; - -public class CompositediagramDiagramTypeProvider extends CompositediagramDiagramTypeProviderBase { - -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/diagram/CompositediagramDiagramTypeProviderBase.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/diagram/CompositediagramDiagramTypeProviderBase.java deleted file mode 100644 index 26e37e55e807f21b4c8f12c0fb73fa89c788cd58..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/diagram/CompositediagramDiagramTypeProviderBase.java +++ /dev/null @@ -1,33 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray DiagramTypeProvider.xtend - * - * This file contains generated and should not be changed. - * Use the extension point class (the direct subclass of this class) to add manual code - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.diagram; - -import org.eclipse.graphiti.dt.AbstractDiagramTypeProvider; -import org.eclipse.graphiti.tb.IToolBehaviorProvider; - -public abstract class CompositediagramDiagramTypeProviderBase extends AbstractDiagramTypeProvider { - protected IToolBehaviorProvider[] toolBehaviorProviders; - - public CompositediagramDiagramTypeProviderBase() { - super(); - setFeatureProvider(new CompositediagramFeatureProvider(this)); - } - - /** - * {@inheritDoc} - */ - @Override - public IToolBehaviorProvider[] getAvailableToolBehaviorProviders() { - if (toolBehaviorProviders == null) { - toolBehaviorProviders = new IToolBehaviorProvider[]{new CompositediagramToolBehaviorProvider(this)}; - } - return toolBehaviorProviders; - } - -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/diagram/CompositediagramFeatureProvider.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/diagram/CompositediagramFeatureProvider.java deleted file mode 100644 index f4b1927ec95c3e9f4244ce89e59a42cc50646134..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/diagram/CompositediagramFeatureProvider.java +++ /dev/null @@ -1,19 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray FeatureProvider.xtend - * - * This file is an extension point: copy to "src" folder to manually add code to this - * extension point. - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.diagram; - -import org.eclipse.graphiti.dt.IDiagramTypeProvider; - -public class CompositediagramFeatureProvider extends CompositediagramFeatureProviderBase { - - public CompositediagramFeatureProvider(final IDiagramTypeProvider dtp) { - super(dtp); - } - -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/diagram/CompositediagramFeatureProviderBase.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/diagram/CompositediagramFeatureProviderBase.java deleted file mode 100644 index 010d7741a33fac4d1e07e8dcca169551158555f1..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/diagram/CompositediagramFeatureProviderBase.java +++ /dev/null @@ -1,292 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray FeatureProvider.xtend - * - * This file contains generated and should not be changed. - * Use the extension point class (the direct subclass of this class) to add manual code - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.diagram; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.graphiti.dt.IDiagramTypeProvider; -import org.eclipse.graphiti.features.IAddFeature; -import org.eclipse.graphiti.features.ICreateConnectionFeature; -import org.eclipse.graphiti.features.ICreateFeature; -import org.eclipse.graphiti.features.ICopyFeature; -import org.eclipse.graphiti.features.ILayoutFeature; -import org.eclipse.graphiti.features.IMoveShapeFeature; -import org.eclipse.graphiti.features.IPasteFeature; -import org.eclipse.graphiti.features.IUpdateFeature; -import org.eclipse.graphiti.features.IDeleteFeature; -import org.eclipse.graphiti.features.IDirectEditingFeature; -import org.eclipse.graphiti.features.IRemoveFeature; -import org.eclipse.graphiti.features.IResizeShapeFeature; -import org.eclipse.graphiti.features.context.IAddContext; -import org.eclipse.graphiti.features.context.ICustomContext; -import org.eclipse.graphiti.features.context.ICopyContext; -import org.eclipse.graphiti.features.context.IDeleteContext; -import org.eclipse.graphiti.features.context.IDirectEditingContext; -import org.eclipse.graphiti.features.context.ILayoutContext; -import org.eclipse.graphiti.features.context.IMoveShapeContext; -import org.eclipse.graphiti.features.context.IUpdateContext; -import org.eclipse.graphiti.features.context.IPasteContext; -import org.eclipse.graphiti.features.context.IRemoveContext; -import org.eclipse.graphiti.features.context.IResizeShapeContext; -import org.eclipse.graphiti.features.custom.ICustomFeature; -import org.eclipse.graphiti.mm.pictograms.PictogramElement; -import org.eclipse.graphiti.mm.pictograms.Shape; -import org.eclipse.graphiti.mm.pictograms.ContainerShape; - -import org.eclipselabs.spray.runtime.graphiti.GraphitiProperties; -import org.eclipselabs.spray.runtime.graphiti.features.DefaultDeleteFeature; -import org.eclipselabs.spray.runtime.graphiti.features.DefaultFeatureProvider; -import org.eclipselabs.spray.runtime.graphiti.features.DefaultRemoveFeature; -import org.eclipselabs.spray.runtime.graphiti.layout.SprayLayoutService; -import org.eclipselabs.spray.runtime.graphiti.layout.SprayFixedLayoutManager; -import org.eclipselabs.spray.runtime.graphiti.containers.OwnerPropertyDeleteFeature; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.AssemblyContext; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.CompositeComponent; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.RepositoryPackage; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features.CompositediagramAddAssemblyContextFeature; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features.CompositediagramAddCompositeComponentFeature; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features.CompositediagramCopyFeature; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features.CompositediagramCreateAssemblyContextFeature; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features.CompositediagramCreateCompositeComponentFeature; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features.CompositediagramDirectEditAssemblyContextFeature; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features.CompositediagramDirectEditCompositeComponentFeature; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features.CompositediagramLayoutAssemblyContextFeature; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features.CompositediagramLayoutCompositeComponentFeature; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features.CompositediagramPasteFeature; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features.CompositediagramResizeAssemblyContextFeature; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features.CompositediagramResizeCompositeComponentFeature; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features.CompositediagramUpdateAssemblyContextFeature; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features.CompositediagramUpdateCompositeComponentFeature; - -@SuppressWarnings("unused") -public abstract class CompositediagramFeatureProviderBase extends DefaultFeatureProvider { - public CompositediagramFeatureProviderBase(final IDiagramTypeProvider dtp) { - super(dtp); - } - - /** - * {@inheritDoc} - */ - @Override - public IAddFeature getAddFeature(final IAddContext context) { - // is object for add request a EClass or EReference? - final EObject bo = (EObject) context.getNewObject(); - final String reference = (String) context.getProperty(PROPERTY_REFERENCE); - final String alias = (String) context.getProperty(PROPERTY_ALIAS); - if (bo.eClass() == RepositoryPackage.Literals.COMPOSITE_COMPONENT && alias == null) { - if (reference == null) { - return new CompositediagramAddCompositeComponentFeature(this); - } - } - if (bo.eClass() == RepositoryPackage.Literals.ASSEMBLY_CONTEXT && alias == null) { - if (reference == null) { - return new CompositediagramAddAssemblyContextFeature(this); - } - } - return super.getAddFeature(context); - } - - /** - * {@inheritDoc} - */ - @Override - public ICopyFeature getCopyFeature(ICopyContext context) { - return new CompositediagramCopyFeature(this); - } - - /** - * {@inheritDoc} - */ - @Override - public ICreateFeature[] getCreateFeatures() { - return new ICreateFeature[]{new CompositediagramCreateCompositeComponentFeature(this), new CompositediagramCreateAssemblyContextFeature(this)}; - } - - /** - * {@inheritDoc} - */ - @Override - public ICreateConnectionFeature[] getCreateConnectionFeatures() { - return new ICreateConnectionFeature[]{}; - } - - /** - * {@inheritDoc} - */ - @Override - public IUpdateFeature getUpdateFeature(final IUpdateContext context) { - final PictogramElement pictogramElement = context.getPictogramElement(); - String alias; - if (pictogramElement instanceof Shape) { - Shape dslShape = SprayLayoutService.findDslShape(pictogramElement); - alias = peService.getPropertyValue(dslShape, PROPERTY_ALIAS); - } else { - alias = peService.getPropertyValue(pictogramElement, PROPERTY_ALIAS); - } - // if (pictogramElement instanceof ContainerShape) { - final EObject bo = (EObject) getBusinessObjectForPictogramElement(pictogramElement); - if (bo == null) { - return null; - } - if (bo.eClass() == RepositoryPackage.Literals.COMPOSITE_COMPONENT && alias == null) { // 11 - return new CompositediagramUpdateCompositeComponentFeature(this); - } - if (bo.eClass() == RepositoryPackage.Literals.ASSEMBLY_CONTEXT && alias == null) { // 11 - return new CompositediagramUpdateAssemblyContextFeature(this); - } - // } - return super.getUpdateFeature(context); - } - - /** - * {@inheritDoc} - */ - @Override - public ILayoutFeature getLayoutFeature(final ILayoutContext context) { - final PictogramElement pictogramElement = context.getPictogramElement(); - final EObject bo = (EObject) getBusinessObjectForPictogramElement(pictogramElement); - if (bo == null) { - return null; - } - final String alias = peService.getPropertyValue(pictogramElement, PROPERTY_ALIAS); - if (bo.eClass() == RepositoryPackage.Literals.COMPOSITE_COMPONENT && alias == null) { - return new CompositediagramLayoutCompositeComponentFeature(this); - } - if (bo.eClass() == RepositoryPackage.Literals.ASSEMBLY_CONTEXT && alias == null) { - return new CompositediagramLayoutAssemblyContextFeature(this); - } - return super.getLayoutFeature(context); - } - - /** - * {@inheritDoc} - */ - @Override - public IRemoveFeature getRemoveFeature(final IRemoveContext context) { - // Spray specific DefaultRemoveFeature - final PictogramElement pictogramElement = context.getPictogramElement(); - return new DefaultRemoveFeature(this); - } - - public IDeleteFeature getDeleteFeature(final IDeleteContext context) { - final PictogramElement pictogramElement = context.getPictogramElement(); - final EObject bo = getBusinessObjectForPictogramElement(pictogramElement); - if (bo == null) { - return null; - } - final String reference = peService.getPropertyValue(pictogramElement, PROPERTY_REFERENCE); - final String alias = peService.getPropertyValue(pictogramElement, PROPERTY_ALIAS); - - if (bo.eClass() == RepositoryPackage.Literals.COMPOSITE_COMPONENT && alias == null) { - if (reference == null) { - return new DefaultDeleteFeature(this); - } - } - if (bo.eClass() == RepositoryPackage.Literals.ASSEMBLY_CONTEXT && alias == null) { - if (reference == null) { - return new DefaultDeleteFeature(this); - } - } - - return new DefaultDeleteFeature(this); - } - - /** - * Ensure that any shape with property {@link ISprayConstants#CAN_MOVE} set to false will not have a move feature. - */ - /** - * {@inheritDoc} - */ - @Override - public IMoveShapeFeature getMoveShapeFeature(final IMoveShapeContext context) { - final Shape shape = context.getShape(); - final ContainerShape parent = shape.getContainer(); - EObject eObject = getBusinessObjectForPictogramElement(shape); - ContainerShape targetContainer = context.getTargetContainer(); - EObject target = getBusinessObjectForPictogramElement(targetContainer); - if (eObject instanceof CompositeComponent) { - return new edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features.CompositediagramMoveCompositeComponentFeature(this); - } - - if (eObject instanceof AssemblyContext) { - return new edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features.CompositediagramMoveAssemblyContextFeature(this); - } - - return super.getMoveShapeFeature(context); - } - - /** - * {@inheritDoc} - */ - @Override - public IPasteFeature getPasteFeature(IPasteContext context) { - return new CompositediagramPasteFeature(this); - } - - /** - * {@inheritDoc} - */ - @Override - public IDirectEditingFeature getDirectEditingFeature(IDirectEditingContext context) { - final PictogramElement pictogramElement = context.getPictogramElement(); - final EObject bo = (EObject) getBusinessObjectForPictogramElement(pictogramElement); - if (bo == null) { - return null; - } - if (SprayLayoutService.isCompartment(pictogramElement)) { - return null; - } - String alias = null; - if (pictogramElement instanceof Shape) { - Shape dslShape = SprayLayoutService.findDslShape(pictogramElement); - alias = peService.getPropertyValue(dslShape, PROPERTY_ALIAS); - } else { - alias = peService.getPropertyValue(pictogramElement, PROPERTY_ALIAS); - } - if (bo.eClass() == RepositoryPackage.Literals.COMPOSITE_COMPONENT && alias == null) { - return new CompositediagramDirectEditCompositeComponentFeature(this); - } - if (bo.eClass() == RepositoryPackage.Literals.ASSEMBLY_CONTEXT && alias == null) { - return new CompositediagramDirectEditAssemblyContextFeature(this); - } - return super.getDirectEditingFeature(context); - } - - /** - * {@inheritDoc} - */ - @Override - public ICustomFeature[] getCustomFeatures(final ICustomContext context) { - final EObject bo = (EObject) getBusinessObjectForPictogramElement(context.getPictogramElements()[0]); - if (bo == null) { - return new ICustomFeature[0]; - } - final String alias = GraphitiProperties.get(context.getPictogramElements()[0], PROPERTY_ALIAS); - return new ICustomFeature[0]; - } - - /** - * {@inheritDoc} - */ - @Override - public IResizeShapeFeature getResizeShapeFeature(IResizeShapeContext context) { - final PictogramElement pictogramElement = context.getPictogramElement(); - final EObject bo = (EObject) getBusinessObjectForPictogramElement(pictogramElement); - if (bo == null) { - return null; - } - final String alias = peService.getPropertyValue(pictogramElement, PROPERTY_ALIAS); - if (bo.eClass() == RepositoryPackage.Literals.COMPOSITE_COMPONENT && alias == null) { - return new CompositediagramResizeCompositeComponentFeature(this); - } - if (bo.eClass() == RepositoryPackage.Literals.ASSEMBLY_CONTEXT && alias == null) { - return new CompositediagramResizeAssemblyContextFeature(this); - } - return super.getResizeShapeFeature(context); - } -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/diagram/CompositediagramImageProvider.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/diagram/CompositediagramImageProvider.java deleted file mode 100644 index 0928c4de1b4fdb83e4d9418f84c7f598212b4e8d..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/diagram/CompositediagramImageProvider.java +++ /dev/null @@ -1,26 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray ImageProvider.xtend - * - * This file is an extension point: copy to "src" folder to manually add code to this - * extension point. - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.diagram; - -public class CompositediagramImageProvider extends CompositediagramImageProviderBase { - // /** - // * The image identifier for ... - // */ - // public static final String COMPOSITEDIAGRAM__MYIMAGEID = PREFIX + "MYIMAGEID"; - // - // /** - // * {@inheritDoc} - // */ - // @Override - // protected void addAvailableImages() { - // super.addAvailableImages(); - // // register the path for each image identifier - // addImageFilePath(COMPOSITEDIAGRAM__MYIMAGEID, "icons/..."); - // } -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/diagram/CompositediagramImageProviderBase.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/diagram/CompositediagramImageProviderBase.java deleted file mode 100644 index b598b0c698565f562c28a644151f1756a76a87a1..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/diagram/CompositediagramImageProviderBase.java +++ /dev/null @@ -1,24 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray ImageProvider.xtend - * - * This file contains generated and should not be changed. - * Use the extension point class (the direct subclass of this class) to add manual code - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.diagram; - -import org.eclipse.graphiti.ui.platform.AbstractImageProvider; - -public abstract class CompositediagramImageProviderBase extends AbstractImageProvider { - // The prefix for all identifiers of this image provider - public static final String PREFIX = "edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.diagram."; - - /** - * {@inheritDoc} - */ - @Override - protected void addAvailableImages() { - // register the path for each image identifier - } -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/diagram/CompositediagramModelService.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/diagram/CompositediagramModelService.java deleted file mode 100644 index 2214f293fb41c04a1b54759a4fca6a4c265177c8..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/diagram/CompositediagramModelService.java +++ /dev/null @@ -1,133 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray ModelService.xtend - * - * This file contains generated and should not be changed. - * Use the extension point class (the direct subclass of this class) to add manual code - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.diagram; - -import java.io.IOException; - -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.graphiti.dt.IDiagramTypeProvider; -import org.eclipse.graphiti.mm.pictograms.Diagram; -import org.eclipse.graphiti.mm.pictograms.PictogramElement; -import org.eclipse.graphiti.services.Graphiti; -import org.eclipse.graphiti.services.IPeService; -import org.eclipselabs.spray.runtime.graphiti.ISprayConstants; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.Repository; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.RepositoryFactory; - -/** - * This class gives access to the domain model root element for a diagram. - * On first access, a new resource will be created to which the model - * is added. - */ -public class CompositediagramModelService implements ISprayConstants { - public static final String FILE_EXTENSION = "repository"; - protected IPeService peService; - protected IDiagramTypeProvider dtp; - - static protected CompositediagramModelService modelService = null; - - /** - * return the model service, create one if it does not exist yet. - */ - static public CompositediagramModelService getModelService(IDiagramTypeProvider dtp) { - modelService = new CompositediagramModelService(dtp); - return modelService; - } - - /** - * return the model service. - * returns null if there is no model service. - */ - static public CompositediagramModelService getModelService() { - return modelService; - } - - protected CompositediagramModelService(IDiagramTypeProvider dtp) { - this.dtp = dtp; - this.peService = Graphiti.getPeService(); - } - - public Repository getModel() { - final Diagram diagram = dtp.getDiagram(); - Resource r = diagram.eResource(); - ResourceSet set = r.getResourceSet(); - EObject bo = (EObject) dtp.getFeatureProvider().getBusinessObjectForPictogramElement(diagram); - Repository model = null; - if (bo != null) { - // If its a proxy, resolve it - if (bo.eIsProxy()) { - if (bo instanceof InternalEObject) { - model = (Repository) set.getEObject(((InternalEObject) bo).eProxyURI(), true); - } - } else { - if (bo instanceof Repository) { - model = (Repository) bo; - } - } - } - - if (model == null) { - model = createModel(); - } - return model; - } - - public Object getBusinessObject(PictogramElement pe) { - return dtp.getFeatureProvider().getBusinessObjectForPictogramElement(dtp.getDiagram()); - } - - /** - * Creates the domain model element and store it in the file. Overwrite to set required properties on creation. - */ - protected Repository createModel() { - final Diagram diagram = dtp.getDiagram(); - try { - Repository model = RepositoryFactory.eINSTANCE.createRepository(); - createModelResourceAndAddModel(model); - peService.setPropertyValue(diagram, PROPERTY_URI, EcoreUtil.getURI(model).toString()); - // link the diagram with the model element - dtp.getFeatureProvider().link(diagram, model); - return model; - } catch (CoreException e) { - e.printStackTrace(); - return null; - } catch (IOException e) { - e.printStackTrace(); - return null; - } - } - - protected void createModelResourceAndAddModel(final Repository model) throws CoreException, IOException { - final Diagram diagram = dtp.getDiagram(); - URI uri = diagram.eResource().getURI(); - uri = uri.trimFragment(); - uri = uri.trimFileExtension(); - uri = uri.appendFileExtension(FILE_EXTENSION); - ResourceSet rSet = diagram.eResource().getResourceSet(); - final IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); - IResource file = workspaceRoot.findMember(uri.toPlatformString(true)); - if (file == null || !file.exists()) { - Resource resource = rSet.createResource(uri); - resource.setTrackingModification(true); - resource.getContents().add(model); - } else { - final Resource resource = rSet.getResource(uri, true); - resource.getContents().add(model); - } - } -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/diagram/CompositediagramToolBehaviorProvider.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/diagram/CompositediagramToolBehaviorProvider.java deleted file mode 100644 index 257526877b9f9e21a8d4bb1c74f8b093853af74e..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/diagram/CompositediagramToolBehaviorProvider.java +++ /dev/null @@ -1,17 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray ToolBehaviorProvider.xtend - * - * This file is an extension point: copy to "src" folder to manually add code to this - * extension point. - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.diagram; - -import org.eclipse.graphiti.dt.IDiagramTypeProvider; - -public class CompositediagramToolBehaviorProvider extends CompositediagramToolBehaviorProviderBase { - public CompositediagramToolBehaviorProvider(final IDiagramTypeProvider dtp) { - super(dtp); - } -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/diagram/CompositediagramToolBehaviorProviderBase.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/diagram/CompositediagramToolBehaviorProviderBase.java deleted file mode 100644 index 367da21cacdb0beda228c30418a1bf5db1ff9756..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/diagram/CompositediagramToolBehaviorProviderBase.java +++ /dev/null @@ -1,79 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray ToolBehaviorProvider.xtend - * - * This file contains generated and should not be changed. - * Use the extension point class (the direct subclass of this class) to add manual code - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.diagram; - -import org.eclipse.graphiti.dt.IDiagramTypeProvider; -import org.eclipse.graphiti.features.IFeature; -import org.eclipse.graphiti.palette.IPaletteCompartmentEntry; -import org.eclipselabs.spray.runtime.graphiti.layout.SprayLayoutService; -import org.eclipselabs.spray.runtime.graphiti.tb.AbstractSprayToolBehaviorProvider; -import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm; -import org.eclipse.graphiti.mm.pictograms.PictogramElement; -import org.eclipse.graphiti.mm.pictograms.ContainerShape; -import org.eclipse.emf.common.util.EList; -import org.eclipse.graphiti.services.Graphiti; - -import com.google.common.collect.Lists; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features.CompositediagramCreateAssemblyContextFeature; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features.CompositediagramCreateCompositeComponentFeature; - -public abstract class CompositediagramToolBehaviorProviderBase extends AbstractSprayToolBehaviorProvider { - protected static final String COMPARTMENT_CONTEXT = "Context"; - protected static final String COMPARTMENT_COMPONENTS = "Components"; - - public CompositediagramToolBehaviorProviderBase(final IDiagramTypeProvider dtp) { - super(dtp); - } - - /** - * {@inheritDoc} - */ - @Override - public GraphicsAlgorithm getSelectionBorder(PictogramElement pe) { - boolean isFromDsl = SprayLayoutService.isShapeFromDsl(pe); - if (isFromDsl) { - ContainerShape container = (ContainerShape) pe; - if (!container.getChildren().isEmpty()) { - return container.getChildren().get(0).getGraphicsAlgorithm(); - } - } - return super.getSelectionBorder(pe); - } - - /** - * {@inheritDoc} - */ - @Override - protected void buildCreationTools() { - buildCreationTool(new CompositediagramCreateCompositeComponentFeature(this.getFeatureProvider())); - buildCreationTool(new CompositediagramCreateAssemblyContextFeature(this.getFeatureProvider())); - // Compartments - } - - /** - * {@inheritDoc} - */ - @Override - protected Iterable<IPaletteCompartmentEntry> buildPaletteCompartments() { - return Lists.newArrayList(getPaletteCompartment(COMPARTMENT_CONTEXT), getPaletteCompartment(COMPARTMENT_COMPONENTS), getPaletteCompartment(COMPARTMENT_DEFAULT)); - } - - /** - * {@inheritDoc} - */ - @Override - protected IPaletteCompartmentEntry getPaletteCompartmentForFeature(final IFeature feature) { - if (feature instanceof CompositediagramCreateCompositeComponentFeature) { - return getPaletteCompartment(COMPARTMENT_COMPONENTS); - } else if (feature instanceof CompositediagramCreateAssemblyContextFeature) { - return getPaletteCompartment(COMPARTMENT_CONTEXT); - } - return super.getPaletteCompartmentForFeature(feature); - } -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramAddAssemblyContextFeature.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramAddAssemblyContextFeature.java deleted file mode 100644 index 3994a6b12f89c0c163f5113d6eb9a2fab301d0d5..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramAddAssemblyContextFeature.java +++ /dev/null @@ -1,17 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray AddShapeFromDslFeature.xtend - * - * This file is an extension point: copy to "src" folder to manually add code to this - * extension point. - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features; - -import org.eclipse.graphiti.features.IFeatureProvider; - -public class CompositediagramAddAssemblyContextFeature extends CompositediagramAddAssemblyContextFeatureBase { - public CompositediagramAddAssemblyContextFeature(final IFeatureProvider fp) { - super(fp); - } -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramAddAssemblyContextFeatureBase.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramAddAssemblyContextFeatureBase.java deleted file mode 100644 index 77bb59d96d0c3fcf61f26f654b00aa522d8366bb..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramAddAssemblyContextFeatureBase.java +++ /dev/null @@ -1,104 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray AddShapeFromDslFeature.xtend - * - * This file contains generated and should not be changed. - * Use the extension point class (the direct subclass of this class) to add manual code - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.graphiti.features.IFeatureProvider; -import org.eclipse.graphiti.features.context.IAddContext; -import org.eclipse.graphiti.mm.pictograms.ContainerShape; -import org.eclipse.graphiti.mm.pictograms.Shape; -import org.eclipse.graphiti.mm.pictograms.Diagram; -import org.eclipse.graphiti.mm.pictograms.PictogramElement; -import org.eclipse.graphiti.services.Graphiti; -import org.eclipse.graphiti.services.IGaService; -import org.eclipselabs.spray.runtime.graphiti.features.AbstractAddFeature; -import org.eclipselabs.spray.runtime.graphiti.shape.ISprayShape; -import org.eclipselabs.spray.runtime.graphiti.layout.SprayLayoutService; -import org.eclipselabs.spray.runtime.graphiti.GraphitiProperties; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.shapes.RectShape; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.styles.CompositediagramDefaultStyle; -import org.eclipselabs.spray.runtime.graphiti.styles.ISprayStyle; - -import edu.kit.ipd.descartes.mm.applicationlevel.repository.AssemblyContext; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.AssemblyContext; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.CompositeComponent; - -@SuppressWarnings("unused") -public abstract class CompositediagramAddAssemblyContextFeatureBase extends AbstractAddFeature { - protected final static String typeOrAliasName = "AssemblyContext"; - protected Diagram targetDiagram = null; - - public CompositediagramAddAssemblyContextFeatureBase(final IFeatureProvider fp) { - super(fp); - - } - - /** - * {@inheritDoc} - */ - @Override - public boolean canAdd(final IAddContext context) { - final EObject newObject = (EObject) context.getNewObject(); - if (newObject instanceof AssemblyContext) { - // check if user wants to add to a diagram - if (context.getTargetContainer() instanceof Diagram) { - return false; - } else if (context.getTargetContainer() instanceof ContainerShape) { - // OLD STUFF - final Object target = getBusinessObjectForPictogramElement(context.getTargetContainer()); - // NEW stuff - // cls CompositeComponent refers to this metaClass? - if (target instanceof edu.kit.ipd.descartes.mm.applicationlevel.repository.CompositeComponent) { - if (SprayLayoutService.isCompartment(context.getTargetContainer())) { - String id = GraphitiProperties.get(context.getTargetContainer(), TEXT_ID); - if ((id != null) && (id.equals("context"))) { - return true; - } - } - } - } - } - return false; - } - - /** - * {@inheritDoc} - */ - @Override - public PictogramElement add(final IAddContext context) { - final AssemblyContext addedModelElement = (AssemblyContext) context.getNewObject(); - // NEW stuff - Object target = getBusinessObjectForPictogramElement(context.getTargetContainer()); - final ContainerShape targetContainer = context.getTargetContainer(); - final ISprayStyle style = new CompositediagramDefaultStyle(); - final ISprayShape shape = new RectShape(getFeatureProvider()); - final ContainerShape conShape = shape.getShape(targetContainer, style); - final IGaService gaService = Graphiti.getGaService(); - gaService.setLocation(conShape.getGraphicsAlgorithm(), context.getX(), context.getY()); - link(conShape, addedModelElement); - linkShapes(conShape, addedModelElement); - - setDoneChanges(true); - updatePictogramElement(conShape); - layout(conShape); - - return conShape; - } - - protected void linkShapes(ContainerShape conShape, AssemblyContext addedModelElement) { - link(conShape, addedModelElement); - for (Shape childShape : conShape.getChildren()) { - if (childShape instanceof ContainerShape) { - linkShapes((ContainerShape) childShape, addedModelElement); - } else { - link(childShape, addedModelElement); - } - } - } -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramAddCompositeComponentFeature.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramAddCompositeComponentFeature.java deleted file mode 100644 index 96687183ddc3bfc6f40e52c062692602ebe00505..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramAddCompositeComponentFeature.java +++ /dev/null @@ -1,17 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray AddShapeFromDslFeature.xtend - * - * This file is an extension point: copy to "src" folder to manually add code to this - * extension point. - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features; - -import org.eclipse.graphiti.features.IFeatureProvider; - -public class CompositediagramAddCompositeComponentFeature extends CompositediagramAddCompositeComponentFeatureBase { - public CompositediagramAddCompositeComponentFeature(final IFeatureProvider fp) { - super(fp); - } -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramAddCompositeComponentFeatureBase.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramAddCompositeComponentFeatureBase.java deleted file mode 100644 index 2990f8aff3efd3ffe8059f2a31e5ca8e6d7d45d2..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramAddCompositeComponentFeatureBase.java +++ /dev/null @@ -1,94 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray AddShapeFromDslFeature.xtend - * - * This file contains generated and should not be changed. - * Use the extension point class (the direct subclass of this class) to add manual code - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.graphiti.features.IFeatureProvider; -import org.eclipse.graphiti.features.context.IAddContext; -import org.eclipse.graphiti.mm.pictograms.ContainerShape; -import org.eclipse.graphiti.mm.pictograms.Shape; -import org.eclipse.graphiti.mm.pictograms.Diagram; -import org.eclipse.graphiti.mm.pictograms.PictogramElement; -import org.eclipse.graphiti.services.Graphiti; -import org.eclipse.graphiti.services.IGaService; -import org.eclipselabs.spray.runtime.graphiti.features.AbstractAddFeature; -import org.eclipselabs.spray.runtime.graphiti.shape.ISprayShape; -import org.eclipselabs.spray.runtime.graphiti.layout.SprayLayoutService; -import org.eclipselabs.spray.runtime.graphiti.GraphitiProperties; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.shapes.CompositeShape; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.styles.CompositediagramDefaultStyle; -import org.eclipselabs.spray.runtime.graphiti.styles.ISprayStyle; - -import edu.kit.ipd.descartes.mm.applicationlevel.repository.CompositeComponent; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.CompositeComponent; - -@SuppressWarnings("unused") -public abstract class CompositediagramAddCompositeComponentFeatureBase extends AbstractAddFeature { - protected final static String typeOrAliasName = "CompositeComponent"; - protected Diagram targetDiagram = null; - - public CompositediagramAddCompositeComponentFeatureBase(final IFeatureProvider fp) { - super(fp); - - } - - /** - * {@inheritDoc} - */ - @Override - public boolean canAdd(final IAddContext context) { - final EObject newObject = (EObject) context.getNewObject(); - if (newObject instanceof CompositeComponent) { - // check if user wants to add to a diagram - if (context.getTargetContainer() instanceof Diagram) { - return true; - } else if (context.getTargetContainer() instanceof ContainerShape) { - // OLD STUFF - final Object target = getBusinessObjectForPictogramElement(context.getTargetContainer()); - // NEW stuff - } - } - return false; - } - - /** - * {@inheritDoc} - */ - @Override - public PictogramElement add(final IAddContext context) { - final CompositeComponent addedModelElement = (CompositeComponent) context.getNewObject(); - // NEW stuff - Object target = getBusinessObjectForPictogramElement(context.getTargetContainer()); - final ContainerShape targetContainer = context.getTargetContainer(); - final ISprayStyle style = new CompositediagramDefaultStyle(); - final ISprayShape shape = new CompositeShape(getFeatureProvider()); - final ContainerShape conShape = shape.getShape(targetContainer, style); - final IGaService gaService = Graphiti.getGaService(); - gaService.setLocation(conShape.getGraphicsAlgorithm(), context.getX(), context.getY()); - link(conShape, addedModelElement); - linkShapes(conShape, addedModelElement); - - setDoneChanges(true); - updatePictogramElement(conShape); - layout(conShape); - - return conShape; - } - - protected void linkShapes(ContainerShape conShape, CompositeComponent addedModelElement) { - link(conShape, addedModelElement); - for (Shape childShape : conShape.getChildren()) { - if (childShape instanceof ContainerShape) { - linkShapes((ContainerShape) childShape, addedModelElement); - } else { - link(childShape, addedModelElement); - } - } - } -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramCopyFeature.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramCopyFeature.java deleted file mode 100644 index dd53dc4bc3feb04ef74b56c75d5d4b8ae5d36050..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramCopyFeature.java +++ /dev/null @@ -1,17 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray CopyFeature.xtend - * - * This file is an extension point: copy to "src" folder to manually add code to this - * extension point. - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features; - -import org.eclipse.graphiti.features.IFeatureProvider; - -public class CompositediagramCopyFeature extends CompositediagramCopyFeatureBase { - public CompositediagramCopyFeature(IFeatureProvider fp) { - super(fp); - } -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramCopyFeatureBase.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramCopyFeatureBase.java deleted file mode 100644 index e469fc79a88ceb2122f63f04d90c1c97e83d220d..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramCopyFeatureBase.java +++ /dev/null @@ -1,54 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray CopyFeature.xtend - * - * This file contains generated and should not be changed. - * Use the extension point class (the direct subclass of this class) to add manual code - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features; - -import org.eclipse.graphiti.features.IFeatureProvider; -import org.eclipse.graphiti.features.context.ICopyContext; -import org.eclipse.graphiti.mm.pictograms.PictogramElement; -import org.eclipse.graphiti.services.Graphiti; -import org.eclipse.graphiti.services.IPeService; -import org.eclipse.graphiti.ui.features.AbstractCopyFeature; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.Repository; - -public abstract class CompositediagramCopyFeatureBase extends AbstractCopyFeature { - - public CompositediagramCopyFeatureBase(IFeatureProvider fp) { - super(fp); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean canCopy(ICopyContext context) { - final PictogramElement[] pes = context.getPictogramElements(); - // nothing selected - if (pes == null || pes.length == 0) { - return false; - } - // return true, if all selected elements are a subtypes of Repository - for (PictogramElement pe : pes) { - final Object bo = getBusinessObjectForPictogramElement(pe); - if (!(bo instanceof Repository)) { - return false; - } - } - return true; - } - - /** - * {@inheritDoc} - */ - @Override - public void copy(ICopyContext context) { - // Copy PictogramElements instead of Objects because of the properties on Shapes. - PictogramElement[] pes = context.getPictogramElements(); - putToClipboard(pes); - } -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramCreateAssemblyContextFeature.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramCreateAssemblyContextFeature.java deleted file mode 100644 index 36456b8a52e0eed97489e48c02f33010d871633c..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramCreateAssemblyContextFeature.java +++ /dev/null @@ -1,17 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray CreateShapeFeature.xtend - * - * This file is an extension point: copy to "src" folder to manually add code to this - * extension point. - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features; - -import org.eclipse.graphiti.features.IFeatureProvider; - -public class CompositediagramCreateAssemblyContextFeature extends CompositediagramCreateAssemblyContextFeatureBase { - public CompositediagramCreateAssemblyContextFeature(final IFeatureProvider fp) { - super(fp); - } -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramCreateAssemblyContextFeatureBase.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramCreateAssemblyContextFeatureBase.java deleted file mode 100644 index eb1c925f4132a60c497630faba6c3d1a9d06e773..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramCreateAssemblyContextFeatureBase.java +++ /dev/null @@ -1,106 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray CreateShapeFeature.xtend - * - * This file contains generated and should not be changed. - * Use the extension point class (the direct subclass of this class) to add manual code - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features; - -import org.eclipse.graphiti.features.IFeatureProvider; -import org.eclipse.graphiti.features.context.ICreateContext; -import org.eclipse.graphiti.mm.pictograms.Diagram; -import org.eclipselabs.spray.runtime.graphiti.containers.SampleUtil; -import org.eclipselabs.spray.runtime.graphiti.features.AbstractCreateFeature; -import org.eclipselabs.spray.runtime.graphiti.layout.SprayLayoutService; -import org.eclipselabs.spray.runtime.graphiti.GraphitiProperties; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.AssemblyContext; -import org.eclipse.graphiti.features.context.IAreaContext; -import org.eclipse.graphiti.mm.pictograms.PictogramElement; -import org.eclipse.graphiti.features.context.impl.AddContext; -import org.eclipse.graphiti.mm.pictograms.ContainerShape; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.AssemblyContext; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.Repository; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.RepositoryFactory; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.diagram.CompositediagramModelService; - -public abstract class CompositediagramCreateAssemblyContextFeatureBase extends AbstractCreateFeature { - protected static String TITLE = "Create "; - protected static String USER_QUESTION = "Enter new name"; - protected CompositediagramModelService modelService; - protected AssemblyContext newClass = null; - - public CompositediagramCreateAssemblyContextFeatureBase(final IFeatureProvider fp) { - // set name and description of the creation feature - super(fp, "AssemblyContext", "Create new AssemblyContext"); - modelService = CompositediagramModelService.getModelService(fp.getDiagramTypeProvider()); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean canCreate(final ICreateContext context) { - final Object target = getBusinessObjectForPictogramElement(context.getTargetContainer()); - // TODO: Respect the cardinality of the containment reference - if (context.getTargetContainer() instanceof Diagram) { - return false; - } else if (context.getTargetContainer() instanceof ContainerShape) { - } - // And now the new stuff - // cls CompositeComponent refers to this metaClass - if (target instanceof edu.kit.ipd.descartes.mm.applicationlevel.repository.CompositeComponent) { - if (SprayLayoutService.isCompartment(context.getTargetContainer())) { - String id = GraphitiProperties.get(context.getTargetContainer(), TEXT_ID); - if ((id != null) && (id.equals("context"))) { - return true; - } - } - } - return false; - } - - /** - * {@inheritDoc} - */ - @Override - public Object[] create(final ICreateContext context) { - newClass = createAssemblyContext(context); - - if (newClass == null) { - return EMPTY; - } - - // do the add - addGraphicalRepresentation(context, newClass); - - // activate direct editing after object creation - getFeatureProvider().getDirectEditingInfo().setActive(true); - - // return newly created business object(s) - return new Object[]{newClass}; - } - - // - - /** - * Creates a new {@link AssemblyContext} instance and adds it to the containing type. - */ - protected AssemblyContext createAssemblyContext(final ICreateContext context) { - // create AssemblyContext instance - final AssemblyContext newClass = RepositoryFactory.eINSTANCE.createAssemblyContext(); - boolean isContainment = false; - final Object target = getBusinessObjectForPictogramElement(context.getTargetContainer()); - // And now the NEW stuff - if (target instanceof edu.kit.ipd.descartes.mm.applicationlevel.repository.CompositeComponent) { - edu.kit.ipd.descartes.mm.applicationlevel.repository.CompositeComponent domainObject = (edu.kit.ipd.descartes.mm.applicationlevel.repository.CompositeComponent) target; - // containment - domainObject.getAssemblyContexts().add(newClass); - setDoneChanges(true); - return newClass; - } - setDoneChanges(true); - return newClass; - } -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramCreateCompositeComponentFeature.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramCreateCompositeComponentFeature.java deleted file mode 100644 index d87a48c8370b12b25aa5e884f9af2ca02a94b287..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramCreateCompositeComponentFeature.java +++ /dev/null @@ -1,17 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray CreateShapeFeature.xtend - * - * This file is an extension point: copy to "src" folder to manually add code to this - * extension point. - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features; - -import org.eclipse.graphiti.features.IFeatureProvider; - -public class CompositediagramCreateCompositeComponentFeature extends CompositediagramCreateCompositeComponentFeatureBase { - public CompositediagramCreateCompositeComponentFeature(final IFeatureProvider fp) { - super(fp); - } -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramCreateCompositeComponentFeatureBase.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramCreateCompositeComponentFeatureBase.java deleted file mode 100644 index 94646b19431dffc4d52b2f9f58f615169cfc1abf..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramCreateCompositeComponentFeatureBase.java +++ /dev/null @@ -1,95 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray CreateShapeFeature.xtend - * - * This file contains generated and should not be changed. - * Use the extension point class (the direct subclass of this class) to add manual code - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features; - -import org.eclipse.graphiti.features.IFeatureProvider; -import org.eclipse.graphiti.features.context.ICreateContext; -import org.eclipse.graphiti.mm.pictograms.Diagram; -import org.eclipselabs.spray.runtime.graphiti.containers.SampleUtil; -import org.eclipselabs.spray.runtime.graphiti.features.AbstractCreateFeature; -import org.eclipselabs.spray.runtime.graphiti.layout.SprayLayoutService; -import org.eclipselabs.spray.runtime.graphiti.GraphitiProperties; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.CompositeComponent; -import org.eclipse.graphiti.features.context.IAreaContext; -import org.eclipse.graphiti.mm.pictograms.PictogramElement; -import org.eclipse.graphiti.features.context.impl.AddContext; -import org.eclipse.graphiti.mm.pictograms.ContainerShape; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.CompositeComponent; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.Repository; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.RepositoryFactory; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.diagram.CompositediagramModelService; - -public abstract class CompositediagramCreateCompositeComponentFeatureBase extends AbstractCreateFeature { - protected static String TITLE = "Create "; - protected static String USER_QUESTION = "Enter new name"; - protected CompositediagramModelService modelService; - protected CompositeComponent newClass = null; - - public CompositediagramCreateCompositeComponentFeatureBase(final IFeatureProvider fp) { - // set name and description of the creation feature - super(fp, "CompositeComponent", "Create new CompositeComponent"); - modelService = CompositediagramModelService.getModelService(fp.getDiagramTypeProvider()); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean canCreate(final ICreateContext context) { - final Object target = getBusinessObjectForPictogramElement(context.getTargetContainer()); - // TODO: Respect the cardinality of the containment reference - if (context.getTargetContainer() instanceof Diagram) { - return true; - } else if (context.getTargetContainer() instanceof ContainerShape) { - } - // And now the new stuff - return false; - } - - /** - * {@inheritDoc} - */ - @Override - public Object[] create(final ICreateContext context) { - newClass = createCompositeComponent(context); - - if (newClass == null) { - return EMPTY; - } - - // do the add - addGraphicalRepresentation(context, newClass); - - // activate direct editing after object creation - getFeatureProvider().getDirectEditingInfo().setActive(true); - - // return newly created business object(s) - return new Object[]{newClass}; - } - - // org.eclipse.emf.ecore.impl.EReferenceImpl@568e0556 (name: components) (ordered: false, unique: true, lowerBound: 0, upperBound: -1) (changeable: true, volatile: false, transient: false, defaultValueLiteral: null, unsettable: false, derived: false) (containment: true, resolveProxies: true) - - /** - * Creates a new {@link CompositeComponent} instance and adds it to the containing type. - */ - protected CompositeComponent createCompositeComponent(final ICreateContext context) { - // create CompositeComponent instance - final CompositeComponent newClass = RepositoryFactory.eINSTANCE.createCompositeComponent(); - boolean isContainment = false; - final Object target = getBusinessObjectForPictogramElement(context.getTargetContainer()); - if (!isContainment) { - // add the element to containment reference - Repository model = modelService.getModel(); - model.getComponents().add(newClass); - } - // And now the NEW stuff - setDoneChanges(true); - return newClass; - } -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramDirectEditAssemblyContextFeature.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramDirectEditAssemblyContextFeature.java deleted file mode 100644 index f7dbd8b4dfb76c125a2525e346e38bbb0fd58c85..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramDirectEditAssemblyContextFeature.java +++ /dev/null @@ -1,17 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray DirectEditFeature.xtend - * - * This file is an extension point: copy to "src" folder to manually add code to this - * extension point. - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features; - -import org.eclipse.graphiti.features.IFeatureProvider; - -public class CompositediagramDirectEditAssemblyContextFeature extends CompositediagramDirectEditAssemblyContextFeatureBase { - public CompositediagramDirectEditAssemblyContextFeature(IFeatureProvider fp) { - super(fp); - } -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramDirectEditAssemblyContextFeatureBase.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramDirectEditAssemblyContextFeatureBase.java deleted file mode 100644 index 80b6bdecda103af5c4c20e05284b7e94b822a17a..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramDirectEditAssemblyContextFeatureBase.java +++ /dev/null @@ -1,85 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray DirectEditFeature.xtend - * - * This file contains generated and should not be changed. - * Use the extension point class (the direct subclass of this class) to add manual code - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features; - -import org.eclipse.graphiti.features.IFeatureProvider; -import org.eclipse.graphiti.features.context.IDirectEditingContext; -import org.eclipse.graphiti.mm.pictograms.PictogramElement; -import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm; -import org.eclipse.graphiti.mm.algorithms.Text; -import org.eclipse.graphiti.services.Graphiti; -import org.eclipse.graphiti.services.IPeService; -import org.eclipselabs.spray.runtime.graphiti.features.AbstractDirectEditingFeature; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.AssemblyContext; - -public abstract class CompositediagramDirectEditAssemblyContextFeatureBase extends AbstractDirectEditingFeature { - - protected IPeService peService = Graphiti.getPeService(); - - public CompositediagramDirectEditAssemblyContextFeatureBase(IFeatureProvider fp) { - super(fp); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean canDirectEdit(IDirectEditingContext context) { - PictogramElement pe = context.getPictogramElement(); - Object bo = getBusinessObjectForPictogramElement(pe); - GraphicsAlgorithm ga = context.getGraphicsAlgorithm(); - // support direct editing, if it is a AssemblyContext, and the user clicked - // directly on the text and not somewhere else in the rectangle - if (bo instanceof AssemblyContext && ga instanceof Text) { - return true; - } - // direct editing not supported in all other cases - return false; - } - - /** - * {@inheritDoc} - */ - @Override - public String getInitialValue(IDirectEditingContext context) { - // return the initial value of the clicked text on the AssemblyContext - PictogramElement pe = context.getPictogramElement(); - AssemblyContext eClass = (AssemblyContext) getBusinessObjectForPictogramElement(pe); - Text gAlg = (Text) context.getGraphicsAlgorithm(); - String id = peService.getPropertyValue(gAlg, TEXT_ID); - if (id.equals("rectText")) { - return eClass.getName(); - } - return ""; - } - - /** - * {@inheritDoc} - */ - @Override - public int getEditingType() { - return TYPE_TEXT; - } - - /** - * {@inheritDoc} - */ - @Override - public void setValue(final String value, final IDirectEditingContext context) { - // set the new value on the AssemblyContext - final PictogramElement pe = context.getPictogramElement(); - AssemblyContext eClass = (AssemblyContext) getBusinessObjectForPictogramElement(pe); - Text gAlg = (Text) context.getGraphicsAlgorithm(); - String id = peService.getPropertyValue(gAlg, TEXT_ID); - if (id.equals("rectText")) { - eClass.setName(value); - } - updatePictogramElement(pe); - } -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramDirectEditCompositeComponentFeature.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramDirectEditCompositeComponentFeature.java deleted file mode 100644 index 73084b049ecd9e3cf745741c38253cf1f55cd039..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramDirectEditCompositeComponentFeature.java +++ /dev/null @@ -1,17 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray DirectEditFeature.xtend - * - * This file is an extension point: copy to "src" folder to manually add code to this - * extension point. - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features; - -import org.eclipse.graphiti.features.IFeatureProvider; - -public class CompositediagramDirectEditCompositeComponentFeature extends CompositediagramDirectEditCompositeComponentFeatureBase { - public CompositediagramDirectEditCompositeComponentFeature(IFeatureProvider fp) { - super(fp); - } -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramDirectEditCompositeComponentFeatureBase.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramDirectEditCompositeComponentFeatureBase.java deleted file mode 100644 index 66215c5da206ca0158f28ca6f057889901ede602..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramDirectEditCompositeComponentFeatureBase.java +++ /dev/null @@ -1,85 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray DirectEditFeature.xtend - * - * This file contains generated and should not be changed. - * Use the extension point class (the direct subclass of this class) to add manual code - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features; - -import org.eclipse.graphiti.features.IFeatureProvider; -import org.eclipse.graphiti.features.context.IDirectEditingContext; -import org.eclipse.graphiti.mm.pictograms.PictogramElement; -import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm; -import org.eclipse.graphiti.mm.algorithms.Text; -import org.eclipse.graphiti.services.Graphiti; -import org.eclipse.graphiti.services.IPeService; -import org.eclipselabs.spray.runtime.graphiti.features.AbstractDirectEditingFeature; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.CompositeComponent; - -public abstract class CompositediagramDirectEditCompositeComponentFeatureBase extends AbstractDirectEditingFeature { - - protected IPeService peService = Graphiti.getPeService(); - - public CompositediagramDirectEditCompositeComponentFeatureBase(IFeatureProvider fp) { - super(fp); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean canDirectEdit(IDirectEditingContext context) { - PictogramElement pe = context.getPictogramElement(); - Object bo = getBusinessObjectForPictogramElement(pe); - GraphicsAlgorithm ga = context.getGraphicsAlgorithm(); - // support direct editing, if it is a CompositeComponent, and the user clicked - // directly on the text and not somewhere else in the rectangle - if (bo instanceof CompositeComponent && ga instanceof Text) { - return true; - } - // direct editing not supported in all other cases - return false; - } - - /** - * {@inheritDoc} - */ - @Override - public String getInitialValue(IDirectEditingContext context) { - // return the initial value of the clicked text on the CompositeComponent - PictogramElement pe = context.getPictogramElement(); - CompositeComponent eClass = (CompositeComponent) getBusinessObjectForPictogramElement(pe); - Text gAlg = (Text) context.getGraphicsAlgorithm(); - String id = peService.getPropertyValue(gAlg, TEXT_ID); - if (id.equals("classText")) { - return eClass.getName(); - } - return ""; - } - - /** - * {@inheritDoc} - */ - @Override - public int getEditingType() { - return TYPE_TEXT; - } - - /** - * {@inheritDoc} - */ - @Override - public void setValue(final String value, final IDirectEditingContext context) { - // set the new value on the CompositeComponent - final PictogramElement pe = context.getPictogramElement(); - CompositeComponent eClass = (CompositeComponent) getBusinessObjectForPictogramElement(pe); - Text gAlg = (Text) context.getGraphicsAlgorithm(); - String id = peService.getPropertyValue(gAlg, TEXT_ID); - if (id.equals("classText")) { - eClass.setName(value); - } - updatePictogramElement(pe); - } -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramLayoutAssemblyContextFeature.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramLayoutAssemblyContextFeature.java deleted file mode 100644 index 0931028436483c2d079223795c5c1f836ea28c70..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramLayoutAssemblyContextFeature.java +++ /dev/null @@ -1,18 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray LayoutFromDslFeature.xtend - * - * This file is an extension point: copy to "src" folder to manually add code to this - * extension point. - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features; - -import org.eclipse.graphiti.features.IFeatureProvider; - -public class CompositediagramLayoutAssemblyContextFeature extends CompositediagramLayoutAssemblyContextFeatureBase { - public CompositediagramLayoutAssemblyContextFeature(final IFeatureProvider fp) { - super(fp); - } - -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramLayoutAssemblyContextFeatureBase.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramLayoutAssemblyContextFeatureBase.java deleted file mode 100644 index 4162c78557c823e951f1897af27b04d9f6d54d3a..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramLayoutAssemblyContextFeatureBase.java +++ /dev/null @@ -1,52 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray LayoutFromDslFeature.xtend - * - * This file contains generated and should not be changed. - * Use the extension point class (the direct subclass of this class) to add manual code - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.graphiti.features.IFeatureProvider; -import org.eclipse.graphiti.features.context.ILayoutContext; -import org.eclipse.graphiti.mm.pictograms.ContainerShape; -import org.eclipse.graphiti.mm.pictograms.PictogramElement; -import org.eclipselabs.spray.runtime.graphiti.features.AbstractLayoutFeature; -import org.eclipselabs.spray.runtime.graphiti.shape.SprayLayoutManager; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.shapes.RectShape; - -import edu.kit.ipd.descartes.mm.applicationlevel.repository.AssemblyContext; - -public abstract class CompositediagramLayoutAssemblyContextFeatureBase extends AbstractLayoutFeature { - - SprayLayoutManager layoutManager; - - public CompositediagramLayoutAssemblyContextFeatureBase(final IFeatureProvider fp) { - super(fp); - layoutManager = new RectShape(fp).getShapeLayout(); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean canLayout(final ILayoutContext context) { - final PictogramElement pe = context.getPictogramElement(); - if (!(pe instanceof ContainerShape)) { - return false; - } - final EList<EObject> businessObjects = pe.getLink().getBusinessObjects(); - return (businessObjects.size() == 1) && (businessObjects.get(0) instanceof AssemblyContext); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean layout(final ILayoutContext context) { - return layoutManager.layout(context); - } -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramLayoutCompositeComponentFeature.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramLayoutCompositeComponentFeature.java deleted file mode 100644 index 8ffa7b33646500b9af871f1557f33445791466f4..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramLayoutCompositeComponentFeature.java +++ /dev/null @@ -1,18 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray LayoutFromDslFeature.xtend - * - * This file is an extension point: copy to "src" folder to manually add code to this - * extension point. - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features; - -import org.eclipse.graphiti.features.IFeatureProvider; - -public class CompositediagramLayoutCompositeComponentFeature extends CompositediagramLayoutCompositeComponentFeatureBase { - public CompositediagramLayoutCompositeComponentFeature(final IFeatureProvider fp) { - super(fp); - } - -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramLayoutCompositeComponentFeatureBase.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramLayoutCompositeComponentFeatureBase.java deleted file mode 100644 index 090dadc0986ad27180f810be9b6ecf45dc3a1a01..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramLayoutCompositeComponentFeatureBase.java +++ /dev/null @@ -1,52 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray LayoutFromDslFeature.xtend - * - * This file contains generated and should not be changed. - * Use the extension point class (the direct subclass of this class) to add manual code - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.graphiti.features.IFeatureProvider; -import org.eclipse.graphiti.features.context.ILayoutContext; -import org.eclipse.graphiti.mm.pictograms.ContainerShape; -import org.eclipse.graphiti.mm.pictograms.PictogramElement; -import org.eclipselabs.spray.runtime.graphiti.features.AbstractLayoutFeature; -import org.eclipselabs.spray.runtime.graphiti.shape.SprayLayoutManager; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.shapes.CompositeShape; - -import edu.kit.ipd.descartes.mm.applicationlevel.repository.CompositeComponent; - -public abstract class CompositediagramLayoutCompositeComponentFeatureBase extends AbstractLayoutFeature { - - SprayLayoutManager layoutManager; - - public CompositediagramLayoutCompositeComponentFeatureBase(final IFeatureProvider fp) { - super(fp); - layoutManager = new CompositeShape(fp).getShapeLayout(); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean canLayout(final ILayoutContext context) { - final PictogramElement pe = context.getPictogramElement(); - if (!(pe instanceof ContainerShape)) { - return false; - } - final EList<EObject> businessObjects = pe.getLink().getBusinessObjects(); - return (businessObjects.size() == 1) && (businessObjects.get(0) instanceof CompositeComponent); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean layout(final ILayoutContext context) { - return layoutManager.layout(context); - } -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramMoveAssemblyContextFeature.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramMoveAssemblyContextFeature.java deleted file mode 100644 index 618c8ad5422cdfc0472335d47b2bb7ede7bb1f1c..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramMoveAssemblyContextFeature.java +++ /dev/null @@ -1,17 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray MoveFeature.xtend - * - * This file is an extension point: copy to "src" folder to manually add code to this - * extension point. - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features; - -import org.eclipse.graphiti.features.IFeatureProvider; - -public class CompositediagramMoveAssemblyContextFeature extends CompositediagramMoveAssemblyContextFeatureBase { - public CompositediagramMoveAssemblyContextFeature(final IFeatureProvider fp) { - super(fp); - } -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramMoveAssemblyContextFeatureBase.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramMoveAssemblyContextFeatureBase.java deleted file mode 100644 index e9f8fbe90c0e52a8f5ff19b35c31369e54c775a4..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramMoveAssemblyContextFeatureBase.java +++ /dev/null @@ -1,114 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray MoveFeature.xtend - * - * This file contains generated and should not be changed. - * Use the extension point class (the direct subclass of this class) to add manual code - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features; - -import org.eclipse.graphiti.features.IFeatureProvider; -import org.eclipse.graphiti.features.IRemoveFeature; -import org.eclipse.graphiti.features.context.IMoveShapeContext; -import org.eclipse.graphiti.features.impl.DefaultMoveShapeFeature; -import org.eclipse.graphiti.features.context.impl.AddContext; -import org.eclipse.graphiti.features.context.impl.RemoveContext; -import org.eclipse.graphiti.mm.pictograms.PictogramElement; -import org.eclipse.graphiti.mm.pictograms.ContainerShape; -import org.eclipse.graphiti.mm.pictograms.Shape; - -import org.eclipselabs.spray.runtime.graphiti.GraphitiProperties; -import org.eclipselabs.spray.runtime.graphiti.ISprayConstants; -import org.eclipselabs.spray.runtime.graphiti.layout.SprayLayoutService; -import org.eclipselabs.spray.runtime.graphiti.layout.SprayFixedLayoutManager; -import org.eclipselabs.spray.runtime.graphiti.layout.SprayTopLayoutManager; -import org.eclipselabs.spray.runtime.graphiti.layout.SprayDiagramLayoutManager; -import org.eclipselabs.spray.runtime.graphiti.shape.SprayLayoutManager; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.shapes.RectShape; - -import edu.kit.ipd.descartes.mm.applicationlevel.repository.AssemblyContext; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.CompositeComponent; - -public abstract class CompositediagramMoveAssemblyContextFeatureBase extends DefaultMoveShapeFeature { - - SprayLayoutManager layoutManager; - - public CompositediagramMoveAssemblyContextFeatureBase(final IFeatureProvider fp) { - super(fp); - layoutManager = new RectShape(fp).getShapeLayout(); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean canMoveShape(IMoveShapeContext context) { - Shape sourceShape = (Shape) context.getPictogramElement(); - ContainerShape targetContainer = context.getTargetContainer(); - Object source = getBusinessObjectForPictogramElement(sourceShape); - Object target = getBusinessObjectForPictogramElement(targetContainer); - // check whether it can move in the same container - if (sourceShape.eContainer() == targetContainer) { - if ((SprayLayoutService.getLayoutManager(sourceShape.getContainer()) instanceof SprayFixedLayoutManager)) { - return true; - } - if ((SprayLayoutService.getLayoutManager(sourceShape.getContainer()) instanceof SprayTopLayoutManager)) { - return true; - } - if ((SprayLayoutService.getLayoutManager(sourceShape.getContainer()) instanceof SprayDiagramLayoutManager)) { - return true; - } - return false; - } - // Can move from containment to another containment compartment - if (target instanceof CompositeComponent) { - if (SprayLayoutService.isCompartment(context.getTargetContainer())) { - String id = GraphitiProperties.get(context.getTargetContainer(), ISprayConstants.TEXT_ID); - if ((id != null) && (id.equals("context"))) { - return true; - } - } - } - return super.canMoveShape(context); - } - - /** - * {@inheritDoc} - */ - @Override - public void moveShape(IMoveShapeContext context) { - PictogramElement sourceShape = context.getPictogramElement(); - ContainerShape targetContainer = context.getTargetContainer(); - ContainerShape sourceContainer = context.getSourceContainer(); - Object sourceParent = getBusinessObjectForPictogramElement(sourceContainer); - Object source = getBusinessObjectForPictogramElement(sourceShape); - Object target = getBusinessObjectForPictogramElement(targetContainer); - if (sourceShape.eContainer() == targetContainer) { - super.moveShape(context); - return; - } - if (target instanceof CompositeComponent) { - if (SprayLayoutService.isCompartment(targetContainer)) { - String id = GraphitiProperties.get(targetContainer, ISprayConstants.TEXT_ID); - if ((id != null) && (id.equals("context"))) { - - sourceContainer.getChildren().remove(source); - ContainerShape sourceTop = SprayLayoutService.findTopDslShape(sourceContainer); - if (sourceTop != null) { - SprayLayoutService.getLayoutManager(sourceTop).layout(); - } - // remove from source container and add to target container - - ((CompositeComponent) target).getAssemblyContexts().add((AssemblyContext) source); - targetContainer.getChildren().add((Shape) sourceShape); - ContainerShape targetTop = SprayLayoutService.findTopDslShape(targetContainer); - if (targetTop != null) { - SprayLayoutService.getLayoutManager(targetTop).layout(); - } - return; - } - } - } - } -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramMoveCompositeComponentFeature.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramMoveCompositeComponentFeature.java deleted file mode 100644 index f7241cf64c547158e6c5616c41478ff7596b8338..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramMoveCompositeComponentFeature.java +++ /dev/null @@ -1,17 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray MoveFeature.xtend - * - * This file is an extension point: copy to "src" folder to manually add code to this - * extension point. - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features; - -import org.eclipse.graphiti.features.IFeatureProvider; - -public class CompositediagramMoveCompositeComponentFeature extends CompositediagramMoveCompositeComponentFeatureBase { - public CompositediagramMoveCompositeComponentFeature(final IFeatureProvider fp) { - super(fp); - } -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramMoveCompositeComponentFeatureBase.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramMoveCompositeComponentFeatureBase.java deleted file mode 100644 index 1828f106240201cad3bf254b7fb09719373e27f0..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramMoveCompositeComponentFeatureBase.java +++ /dev/null @@ -1,80 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray MoveFeature.xtend - * - * This file contains generated and should not be changed. - * Use the extension point class (the direct subclass of this class) to add manual code - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features; - -import org.eclipse.graphiti.features.IFeatureProvider; -import org.eclipse.graphiti.features.IRemoveFeature; -import org.eclipse.graphiti.features.context.IMoveShapeContext; -import org.eclipse.graphiti.features.impl.DefaultMoveShapeFeature; -import org.eclipse.graphiti.features.context.impl.AddContext; -import org.eclipse.graphiti.features.context.impl.RemoveContext; -import org.eclipse.graphiti.mm.pictograms.PictogramElement; -import org.eclipse.graphiti.mm.pictograms.ContainerShape; -import org.eclipse.graphiti.mm.pictograms.Shape; - -import org.eclipselabs.spray.runtime.graphiti.GraphitiProperties; -import org.eclipselabs.spray.runtime.graphiti.ISprayConstants; -import org.eclipselabs.spray.runtime.graphiti.layout.SprayLayoutService; -import org.eclipselabs.spray.runtime.graphiti.layout.SprayFixedLayoutManager; -import org.eclipselabs.spray.runtime.graphiti.layout.SprayTopLayoutManager; -import org.eclipselabs.spray.runtime.graphiti.layout.SprayDiagramLayoutManager; -import org.eclipselabs.spray.runtime.graphiti.shape.SprayLayoutManager; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.shapes.CompositeShape; - -public abstract class CompositediagramMoveCompositeComponentFeatureBase extends DefaultMoveShapeFeature { - - SprayLayoutManager layoutManager; - - public CompositediagramMoveCompositeComponentFeatureBase(final IFeatureProvider fp) { - super(fp); - layoutManager = new CompositeShape(fp).getShapeLayout(); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean canMoveShape(IMoveShapeContext context) { - Shape sourceShape = (Shape) context.getPictogramElement(); - ContainerShape targetContainer = context.getTargetContainer(); - Object source = getBusinessObjectForPictogramElement(sourceShape); - Object target = getBusinessObjectForPictogramElement(targetContainer); - // check whether it can move in the same container - if (sourceShape.eContainer() == targetContainer) { - if ((SprayLayoutService.getLayoutManager(sourceShape.getContainer()) instanceof SprayFixedLayoutManager)) { - return true; - } - if ((SprayLayoutService.getLayoutManager(sourceShape.getContainer()) instanceof SprayTopLayoutManager)) { - return true; - } - if ((SprayLayoutService.getLayoutManager(sourceShape.getContainer()) instanceof SprayDiagramLayoutManager)) { - return true; - } - return false; - } - return super.canMoveShape(context); - } - - /** - * {@inheritDoc} - */ - @Override - public void moveShape(IMoveShapeContext context) { - PictogramElement sourceShape = context.getPictogramElement(); - ContainerShape targetContainer = context.getTargetContainer(); - ContainerShape sourceContainer = context.getSourceContainer(); - Object sourceParent = getBusinessObjectForPictogramElement(sourceContainer); - Object source = getBusinessObjectForPictogramElement(sourceShape); - Object target = getBusinessObjectForPictogramElement(targetContainer); - if (sourceShape.eContainer() == targetContainer) { - super.moveShape(context); - return; - } - } -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramPasteFeature.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramPasteFeature.java deleted file mode 100644 index 1041d60992d762fb4ad6f887f2f2ff408a6c12b6..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramPasteFeature.java +++ /dev/null @@ -1,17 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray PasteFeature.xtend - * - * This file is an extension point: copy to "src" folder to manually add code to this - * extension point. - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features; - -import org.eclipse.graphiti.features.IFeatureProvider; - -public class CompositediagramPasteFeature extends CompositediagramPasteFeatureBase { - public CompositediagramPasteFeature(IFeatureProvider fp) { - super(fp); - } -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramPasteFeatureBase.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramPasteFeatureBase.java deleted file mode 100644 index a5724f0aed930a6dce6eda19d759a7a1336bf7a5..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramPasteFeatureBase.java +++ /dev/null @@ -1,98 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray PasteFeature.xtend - * - * This file contains generated and should not be changed. - * Use the extension point class (the direct subclass of this class) to add manual code - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features; - -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.graphiti.features.IFeatureProvider; -import org.eclipse.graphiti.features.context.IPasteContext; -import org.eclipse.graphiti.features.context.impl.AddContext; -import org.eclipse.graphiti.mm.Property; -import org.eclipse.graphiti.mm.pictograms.PictogramElement; -import org.eclipse.graphiti.mm.pictograms.Diagram; -import org.eclipse.graphiti.services.Graphiti; -import org.eclipselabs.spray.runtime.graphiti.features.AbstractPasteFeature; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.CompositeComponent; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.Repository; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.RepositoryPackage; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.diagram.CompositediagramModelService; - -public abstract class CompositediagramPasteFeatureBase extends AbstractPasteFeature { - - protected CompositediagramModelService modelService; - - public CompositediagramPasteFeatureBase(IFeatureProvider fp) { - super(fp); - modelService = CompositediagramModelService.getModelService(fp.getDiagramTypeProvider()); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean canPaste(IPasteContext context) { - // TODO: only support pasting directly in the diagram - PictogramElement[] pes = context.getPictogramElements(); - if (pes.length != 1 || !(pes[0] instanceof Diagram)) { - return false; - } - // can paste, if all objects on the clipboard are PictogramElements with link on subclasses of Repository - Object[] fromClipboard = getFromClipboard(); - if (fromClipboard == null || fromClipboard.length == 0) { - return false; - } - for (Object object : fromClipboard) { - if (!(object instanceof PictogramElement)) { - return false; - } else if (!(getBusinessObjectForPictogramElement((PictogramElement) object) instanceof Repository)) { - return false; - } - } - return true; - } - - /** - * {@inheritDoc} - */ - @Override - public void paste(IPasteContext context) { - // already verified, that pasting is allowed just directly in the diagram - PictogramElement[] pes = context.getPictogramElements(); - Diagram diagram = (Diagram) pes[0]; - - // get the PictogramElements from the clipboard and the linked business object. - Object[] objects = getFromClipboard(); - for (Object object : objects) { - PictogramElement pictogramElement = (PictogramElement) object; - Repository boRef = (Repository) getBusinessObjectForPictogramElement(pictogramElement); - Repository bo = EcoreUtil.copy(boRef); - addBusinessObjectToContainer(bo, pictogramElement); - - // create a new AddContext for the creation of a new shape. - AddContext ac = new AddContext(new AddContext(), bo); - ac.setLocation(0, 0); // for simplicity paste at (0, 0) - ac.setTargetContainer(diagram); // paste on diagram - // copy all properties from the shape (e.g. ALIAS etc.) - for (Property prop : pictogramElement.getProperties()) { - ac.putProperty(prop.getKey(), prop.getValue()); - } - getFeatureProvider().addIfPossible(ac); - } - } - - protected void addBusinessObjectToContainer(Repository bo, PictogramElement pe) { - final Repository model = modelService.getModel(); - final String alias = Graphiti.getPeService().getPropertyValue(pe, PROPERTY_ALIAS); - if (bo.eClass() == RepositoryPackage.Literals.COMPOSITE_COMPONENT && alias == null) { - model.getComponents().add((CompositeComponent) bo); - } - if (bo.eClass() == RepositoryPackage.Literals.ASSEMBLY_CONTEXT && alias == null) { - throw new UnsupportedOperationException("No create behavior defined"); - } - } -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramResizeAssemblyContextFeature.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramResizeAssemblyContextFeature.java deleted file mode 100644 index a7f0ff95cd9e21d6f708339f3de82578b1d9b839..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramResizeAssemblyContextFeature.java +++ /dev/null @@ -1,18 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray ResizeFeature.xtend - * - * This file is an extension point: copy to "src" folder to manually add code to this - * extension point. - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features; - -import org.eclipse.graphiti.features.IFeatureProvider; - -public class CompositediagramResizeAssemblyContextFeature extends CompositediagramResizeAssemblyContextFeatureBase { - public CompositediagramResizeAssemblyContextFeature(final IFeatureProvider fp) { - super(fp); - } - -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramResizeAssemblyContextFeatureBase.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramResizeAssemblyContextFeatureBase.java deleted file mode 100644 index 768bda8ecdfdef8dc0e337815cbd3793c2175328..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramResizeAssemblyContextFeatureBase.java +++ /dev/null @@ -1,47 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray ResizeFeature.xtend - * - * This file contains generated and should not be changed. - * Use the extension point class (the direct subclass of this class) to add manual code - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features; - -import org.eclipse.graphiti.features.IFeatureProvider; -import org.eclipse.graphiti.features.IResizeConfiguration; -import org.eclipse.graphiti.features.context.IResizeShapeContext; -import org.eclipse.graphiti.features.DefaultResizeConfiguration; -import org.eclipselabs.spray.runtime.graphiti.features.DefaultResizeShapeFeature; -import org.eclipselabs.spray.runtime.graphiti.shape.SprayLayoutManager; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.shapes.RectShape; - -public abstract class CompositediagramResizeAssemblyContextFeatureBase extends DefaultResizeShapeFeature { - - SprayLayoutManager layoutManager; - - public CompositediagramResizeAssemblyContextFeatureBase(final IFeatureProvider fp) { - super(fp); - layoutManager = new RectShape(fp).getShapeLayout(); - } - - public class ResizeConfiguration_RectShape extends DefaultResizeConfiguration { - - public boolean isHorizontalResizeAllowed() { - return layoutManager.isStretchHorizontal(); - } - - public boolean isVerticalResizeAllowed() { - return layoutManager.isStretchVertical(); - } - - } - - /** - * {@inheritDoc} - */ - @Override - public IResizeConfiguration getResizeConfiguration(IResizeShapeContext context) { - return new ResizeConfiguration_RectShape(); - } -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramResizeCompositeComponentFeature.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramResizeCompositeComponentFeature.java deleted file mode 100644 index 09fe1384cbb4773d604fb16b90698ce6e515ccaa..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramResizeCompositeComponentFeature.java +++ /dev/null @@ -1,18 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray ResizeFeature.xtend - * - * This file is an extension point: copy to "src" folder to manually add code to this - * extension point. - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features; - -import org.eclipse.graphiti.features.IFeatureProvider; - -public class CompositediagramResizeCompositeComponentFeature extends CompositediagramResizeCompositeComponentFeatureBase { - public CompositediagramResizeCompositeComponentFeature(final IFeatureProvider fp) { - super(fp); - } - -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramResizeCompositeComponentFeatureBase.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramResizeCompositeComponentFeatureBase.java deleted file mode 100644 index 4b1e5e4ddb0c6bf6178c04f00b4fcfe26f87fc73..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramResizeCompositeComponentFeatureBase.java +++ /dev/null @@ -1,47 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray ResizeFeature.xtend - * - * This file contains generated and should not be changed. - * Use the extension point class (the direct subclass of this class) to add manual code - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features; - -import org.eclipse.graphiti.features.IFeatureProvider; -import org.eclipse.graphiti.features.IResizeConfiguration; -import org.eclipse.graphiti.features.context.IResizeShapeContext; -import org.eclipse.graphiti.features.DefaultResizeConfiguration; -import org.eclipselabs.spray.runtime.graphiti.features.DefaultResizeShapeFeature; -import org.eclipselabs.spray.runtime.graphiti.shape.SprayLayoutManager; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.shapes.CompositeShape; - -public abstract class CompositediagramResizeCompositeComponentFeatureBase extends DefaultResizeShapeFeature { - - SprayLayoutManager layoutManager; - - public CompositediagramResizeCompositeComponentFeatureBase(final IFeatureProvider fp) { - super(fp); - layoutManager = new CompositeShape(fp).getShapeLayout(); - } - - public class ResizeConfiguration_CompositeShape extends DefaultResizeConfiguration { - - public boolean isHorizontalResizeAllowed() { - return layoutManager.isStretchHorizontal(); - } - - public boolean isVerticalResizeAllowed() { - return layoutManager.isStretchVertical(); - } - - } - - /** - * {@inheritDoc} - */ - @Override - public IResizeConfiguration getResizeConfiguration(IResizeShapeContext context) { - return new ResizeConfiguration_CompositeShape(); - } -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramUpdateAssemblyContextFeature.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramUpdateAssemblyContextFeature.java deleted file mode 100644 index f7776229a308ef84e286c25cba7ff5d4b39af0b4..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramUpdateAssemblyContextFeature.java +++ /dev/null @@ -1,18 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray UpdateShapeFromDslFeature.xtend - * - * This file is an extension point: copy to "src" folder to manually add code to this - * extension point. - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features; - -import org.eclipse.graphiti.features.IFeatureProvider; - -public class CompositediagramUpdateAssemblyContextFeature extends CompositediagramUpdateAssemblyContextFeatureBase { - public CompositediagramUpdateAssemblyContextFeature(final IFeatureProvider fp) { - super(fp); - } - -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramUpdateAssemblyContextFeatureBase.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramUpdateAssemblyContextFeatureBase.java deleted file mode 100644 index 573952f41876450476c0295e4f519644ccec174e..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramUpdateAssemblyContextFeatureBase.java +++ /dev/null @@ -1,135 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray UpdateShapeFromDslFeature.xtend - * - * This file contains generated and should not be changed. - * Use the extension point class (the direct subclass of this class) to add manual code - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features; - -import org.eclipse.graphiti.features.IFeatureProvider; -import org.eclipse.graphiti.features.IReason; -import org.eclipse.graphiti.features.context.IUpdateContext; -import org.eclipse.graphiti.features.impl.Reason; -import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm; -import org.eclipse.graphiti.mm.algorithms.Text; -import org.eclipse.graphiti.mm.pictograms.ContainerShape; -import org.eclipse.graphiti.mm.pictograms.Shape; -import org.eclipse.graphiti.mm.pictograms.Diagram; -import org.eclipse.graphiti.mm.pictograms.PictogramElement; -import org.eclipse.graphiti.services.IGaService; -import org.eclipselabs.spray.runtime.graphiti.features.AbstractUpdateFeature; -import org.eclipselabs.spray.runtime.graphiti.layout.SprayLayoutService; - -import edu.kit.ipd.descartes.mm.applicationlevel.repository.AssemblyContext; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.AssemblyContext; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.Activator; - -public abstract class CompositediagramUpdateAssemblyContextFeatureBase extends AbstractUpdateFeature { - public CompositediagramUpdateAssemblyContextFeatureBase(final IFeatureProvider fp) { - super(fp); - gaService = Activator.get(IGaService.class); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean canUpdate(final IUpdateContext context) { - // return true, if linked business object is a AssemblyContext - final PictogramElement pictogramElement = context.getPictogramElement(); - final Object bo = getBusinessObjectForPictogramElement(pictogramElement); - return (bo instanceof AssemblyContext) && (!(pictogramElement instanceof Diagram)); - } - - /** - * {@inheritDoc} - */ - @Override - public IReason updateNeeded(final IUpdateContext context) { - final PictogramElement pictogramElement = context.getPictogramElement(); - final Object bo = getBusinessObjectForPictogramElement(pictogramElement); - if (!(bo instanceof AssemblyContext)) { - return Reason.createFalseReason(); - } - if (pictogramElement instanceof Shape) { - Shape shape = (Shape) pictogramElement; - AssemblyContext eClass = (AssemblyContext) bo; - if (checkUpdateNeededRecursively(shape, eClass)) { - return Reason.createTrueReason(); - } - if (shape instanceof ContainerShape) { - for (Shape childShape : ((ContainerShape) shape).getChildren()) { - if (checkUpdateNeededRecursively(childShape, eClass)) { - return Reason.createTrueReason(); - } - } - } - } - return Reason.createFalseReason(); - } - - protected boolean checkUpdateNeededRecursively(Shape shape, final AssemblyContext eClass) { - GraphicsAlgorithm graphicsAlgorithm = shape.getGraphicsAlgorithm(); - if (graphicsAlgorithm instanceof Text) { - Text text = (Text) graphicsAlgorithm; - String id = peService.getPropertyValue(graphicsAlgorithm, TEXT_ID); - if (id != null) { - if (id.equals("rectText")) { - String eClassValue = eClass.getName(); - String gAlgorithmValue = text.getValue(); - if (eClassValue != null) { - if (!eClassValue.equals(gAlgorithmValue)) { - return true; - } - } - } - } - } - if (shape instanceof ContainerShape) { - for (Shape child : ((ContainerShape) shape).getChildren()) { - if (checkUpdateNeededRecursively(child, eClass)) { - return true; - } - } - } - return false; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean update(final IUpdateContext context) { - final PictogramElement pictogramElement = context.getPictogramElement(); - final AssemblyContext eClass = (AssemblyContext) getBusinessObjectForPictogramElement(pictogramElement); - if (pictogramElement instanceof Shape) { - Shape shape = (Shape) pictogramElement; - updateChildsRecursively(shape, eClass); - Shape top = findTopShape(shape); - SprayLayoutService.getLayoutManager(top).layout(); - } - return true; - - } - - protected void updateChildsRecursively(Shape shape, final AssemblyContext eClass) { - GraphicsAlgorithm graphicsAlgorithm = shape.getGraphicsAlgorithm(); - if (graphicsAlgorithm instanceof Text) { - Text text = (Text) graphicsAlgorithm; - String id = peService.getPropertyValue(graphicsAlgorithm, TEXT_ID); - if (id != null) { - if (id.equals("rectText")) { - text.setValue(eClass.getName()); - } - } - } - - if (shape instanceof ContainerShape) { - for (Shape child : ((ContainerShape) shape).getChildren()) { - updateChildsRecursively(child, eClass); - } - } - } -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramUpdateCompositeComponentFeature.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramUpdateCompositeComponentFeature.java deleted file mode 100644 index bc09f90ba1cb8b7847ba1d8a126bdc888715919b..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramUpdateCompositeComponentFeature.java +++ /dev/null @@ -1,18 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray UpdateShapeFromDslFeature.xtend - * - * This file is an extension point: copy to "src" folder to manually add code to this - * extension point. - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features; - -import org.eclipse.graphiti.features.IFeatureProvider; - -public class CompositediagramUpdateCompositeComponentFeature extends CompositediagramUpdateCompositeComponentFeatureBase { - public CompositediagramUpdateCompositeComponentFeature(final IFeatureProvider fp) { - super(fp); - } - -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramUpdateCompositeComponentFeatureBase.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramUpdateCompositeComponentFeatureBase.java deleted file mode 100644 index c25b8e3d7285040e482659cd2d0f28a92f8778b1..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/features/CompositediagramUpdateCompositeComponentFeatureBase.java +++ /dev/null @@ -1,135 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray UpdateShapeFromDslFeature.xtend - * - * This file contains generated and should not be changed. - * Use the extension point class (the direct subclass of this class) to add manual code - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.features; - -import org.eclipse.graphiti.features.IFeatureProvider; -import org.eclipse.graphiti.features.IReason; -import org.eclipse.graphiti.features.context.IUpdateContext; -import org.eclipse.graphiti.features.impl.Reason; -import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm; -import org.eclipse.graphiti.mm.algorithms.Text; -import org.eclipse.graphiti.mm.pictograms.ContainerShape; -import org.eclipse.graphiti.mm.pictograms.Shape; -import org.eclipse.graphiti.mm.pictograms.Diagram; -import org.eclipse.graphiti.mm.pictograms.PictogramElement; -import org.eclipse.graphiti.services.IGaService; -import org.eclipselabs.spray.runtime.graphiti.features.AbstractUpdateFeature; -import org.eclipselabs.spray.runtime.graphiti.layout.SprayLayoutService; - -import edu.kit.ipd.descartes.mm.applicationlevel.repository.CompositeComponent; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.CompositeComponent; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.Activator; - -public abstract class CompositediagramUpdateCompositeComponentFeatureBase extends AbstractUpdateFeature { - public CompositediagramUpdateCompositeComponentFeatureBase(final IFeatureProvider fp) { - super(fp); - gaService = Activator.get(IGaService.class); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean canUpdate(final IUpdateContext context) { - // return true, if linked business object is a CompositeComponent - final PictogramElement pictogramElement = context.getPictogramElement(); - final Object bo = getBusinessObjectForPictogramElement(pictogramElement); - return (bo instanceof CompositeComponent) && (!(pictogramElement instanceof Diagram)); - } - - /** - * {@inheritDoc} - */ - @Override - public IReason updateNeeded(final IUpdateContext context) { - final PictogramElement pictogramElement = context.getPictogramElement(); - final Object bo = getBusinessObjectForPictogramElement(pictogramElement); - if (!(bo instanceof CompositeComponent)) { - return Reason.createFalseReason(); - } - if (pictogramElement instanceof Shape) { - Shape shape = (Shape) pictogramElement; - CompositeComponent eClass = (CompositeComponent) bo; - if (checkUpdateNeededRecursively(shape, eClass)) { - return Reason.createTrueReason(); - } - if (shape instanceof ContainerShape) { - for (Shape childShape : ((ContainerShape) shape).getChildren()) { - if (checkUpdateNeededRecursively(childShape, eClass)) { - return Reason.createTrueReason(); - } - } - } - } - return Reason.createFalseReason(); - } - - protected boolean checkUpdateNeededRecursively(Shape shape, final CompositeComponent eClass) { - GraphicsAlgorithm graphicsAlgorithm = shape.getGraphicsAlgorithm(); - if (graphicsAlgorithm instanceof Text) { - Text text = (Text) graphicsAlgorithm; - String id = peService.getPropertyValue(graphicsAlgorithm, TEXT_ID); - if (id != null) { - if (id.equals("classText")) { - String eClassValue = eClass.getName(); - String gAlgorithmValue = text.getValue(); - if (eClassValue != null) { - if (!eClassValue.equals(gAlgorithmValue)) { - return true; - } - } - } - } - } - if (shape instanceof ContainerShape) { - for (Shape child : ((ContainerShape) shape).getChildren()) { - if (checkUpdateNeededRecursively(child, eClass)) { - return true; - } - } - } - return false; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean update(final IUpdateContext context) { - final PictogramElement pictogramElement = context.getPictogramElement(); - final CompositeComponent eClass = (CompositeComponent) getBusinessObjectForPictogramElement(pictogramElement); - if (pictogramElement instanceof Shape) { - Shape shape = (Shape) pictogramElement; - updateChildsRecursively(shape, eClass); - Shape top = findTopShape(shape); - SprayLayoutService.getLayoutManager(top).layout(); - } - return true; - - } - - protected void updateChildsRecursively(Shape shape, final CompositeComponent eClass) { - GraphicsAlgorithm graphicsAlgorithm = shape.getGraphicsAlgorithm(); - if (graphicsAlgorithm instanceof Text) { - Text text = (Text) graphicsAlgorithm; - String id = peService.getPropertyValue(graphicsAlgorithm, TEXT_ID); - if (id != null) { - if (id.equals("classText")) { - text.setValue(eClass.getName()); - } - } - } - - if (shape instanceof ContainerShape) { - for (Shape child : ((ContainerShape) shape).getChildren()) { - updateChildsRecursively(child, eClass); - } - } - } -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/internal/ExecutableExtensionFactory.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/internal/ExecutableExtensionFactory.java deleted file mode 100644 index 1c1b8abe17e041a8aca9123dda867695d3337675..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/internal/ExecutableExtensionFactory.java +++ /dev/null @@ -1,34 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray ExecutableExtensionFactory.xtend - * - * This file contains generated and should not be changed. - * Use the extension point class (the direct subclass of this class) to add manual code - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.internal; - -import com.google.inject.Injector; -import org.eclipse.xtext.ui.guice.AbstractGuiceAwareExecutableExtensionFactory; -import org.osgi.framework.Bundle; -import edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.Activator; - -public class ExecutableExtensionFactory extends AbstractGuiceAwareExecutableExtensionFactory { - - /** - * {@inheritDoc} - */ - @Override - protected Bundle getBundle() { - return Activator.getDefault().getBundle(); - } - - /** - * {@inheritDoc} - */ - @Override - protected Injector getInjector() { - return Activator.getDefault().getInjector(); - } - -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/property/AssemblyContextFilter.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/property/AssemblyContextFilter.java deleted file mode 100644 index a71ec1053882726cbc1672691f07d4ebfe8228a7..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/property/AssemblyContextFilter.java +++ /dev/null @@ -1,15 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray Filter.xtend - * - * This file is an extension point: copy to "src" folder to manually add code to this - * extension point. - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.property; - -import org.eclipse.graphiti.features.IFeatureProvider; - -public class AssemblyContextFilter extends AssemblyContextFilterBase { - -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/property/AssemblyContextFilterBase.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/property/AssemblyContextFilterBase.java deleted file mode 100644 index de649ea158a5b7186e05ffb20334efddb46cdcaf..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/property/AssemblyContextFilterBase.java +++ /dev/null @@ -1,31 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray Filter.xtend - * - * This file contains generated and should not be changed. - * Use the extension point class (the direct subclass of this class) to add manual code - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.property; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.graphiti.mm.pictograms.PictogramElement; -import org.eclipse.graphiti.services.Graphiti; -import org.eclipse.graphiti.ui.platform.AbstractPropertySectionFilter; - -import edu.kit.ipd.descartes.mm.applicationlevel.repository.AssemblyContext; - -public class AssemblyContextFilterBase extends AbstractPropertySectionFilter { - - /** - * {@inheritDoc} - */ - @Override - protected boolean accept(final PictogramElement pe) { - final EObject eObject = Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(pe); - if (eObject instanceof AssemblyContext) { - return true; - } - return false; - } -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/property/AssemblyContextIdSection.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/property/AssemblyContextIdSection.java deleted file mode 100644 index d74e91383a356893bf9394285e981c2e0c148844..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/property/AssemblyContextIdSection.java +++ /dev/null @@ -1,13 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray PropertySection.xtend - * - * This file is an extension point: copy to "src" folder to manually add code to this - * extension point. - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.property; - -public class AssemblyContextIdSection extends AssemblyContextIdSectionBase { - -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/property/AssemblyContextIdSectionBase.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/property/AssemblyContextIdSectionBase.java deleted file mode 100644 index 314ae9bf33f50e4f78e5f63b364b04722b3bb0a4..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/property/AssemblyContextIdSectionBase.java +++ /dev/null @@ -1,111 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray PropertySection.xtend - * - * This file contains generated and should not be changed. - * Use the extension point class (the direct subclass of this class) to add manual code - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.property; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.RecordingCommand; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.graphiti.mm.pictograms.PictogramElement; -import org.eclipse.graphiti.services.Graphiti; -import org.eclipse.graphiti.ui.platform.GFPropertySection; -import org.eclipse.graphiti.ui.internal.services.GraphitiUiInternal; -import org.eclipse.jface.action.IStatusLineManager; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CLabel; -import org.eclipse.swt.events.FocusEvent; -import org.eclipse.swt.events.FocusListener; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.FormAttachment; -import org.eclipse.swt.layout.FormData; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Text; -import org.eclipse.swt.custom.CCombo; -import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; -import java.util.List; -import edu.kit.ipd.descartes.identifier.Identifier; -import edu.kit.ipd.descartes.identifier.Identifier; - -public abstract class AssemblyContextIdSectionBase extends GFPropertySection implements ITabbedPropertyConstants { - - protected Identifier bc = null; - protected Text idWidget; - - /** - * {@inheritDoc} - */ - @Override - public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) { - super.createControls(parent, tabbedPropertySheetPage); - - final TabbedPropertySheetWidgetFactory factory = getWidgetFactory(); - final Composite composite = factory.createFlatFormComposite(parent); - FormData data; - - idWidget = factory.createText(composite, ""); - data = new FormData(); - data.left = new FormAttachment(0, STANDARD_LABEL_WIDTH); - data.right = new FormAttachment(100, 0); - data.top = new FormAttachment(0, VSPACE); - idWidget.setLayoutData(data); - - CLabel valueLabel = factory.createCLabel(composite, "Id"); - data = new FormData(); - data.left = new FormAttachment(0, 0); - data.right = new FormAttachment(idWidget, -HSPACE); - data.top = new FormAttachment(idWidget, 0, SWT.CENTER); - valueLabel.setLayoutData(data); - } - - /** - * {@inheritDoc} - */ - @Override - public void refresh() { - idWidget.removeModifyListener(nameListener); - - final PictogramElement pe = getSelectedPictogramElement(); - if (pe != null) { - final EObject bo = (EObject) Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(pe); - // the filter assured, that it is a Identifier - if (bo == null) - return; - bc = (Identifier) bo; - String value = ""; - value = bc.getId(); - idWidget.setText(value == null ? "" : value); - idWidget.addModifyListener(nameListener); - } - } - - private ModifyListener nameListener = new ModifyListener() { - public void modifyText(ModifyEvent arg0) { - TransactionalEditingDomain editingDomain = getDiagramEditor().getEditingDomain(); - editingDomain.getCommandStack().execute(new RecordingCommand(editingDomain) { - @Override - protected void doExecute() { - changePropertyValue(); - } - }); - } - }; - - protected void changePropertyValue() { - String newValue = idWidget.getText(); - if (!newValue.equals(bc.getId())) { - bc.setId(newValue); - } - } - -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/property/AssemblyContextNameSection.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/property/AssemblyContextNameSection.java deleted file mode 100644 index 2ecbdfffbec6bd9134d75bbc5deae98f65c7928d..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/property/AssemblyContextNameSection.java +++ /dev/null @@ -1,13 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray PropertySection.xtend - * - * This file is an extension point: copy to "src" folder to manually add code to this - * extension point. - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.property; - -public class AssemblyContextNameSection extends AssemblyContextNameSectionBase { - -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/property/AssemblyContextNameSectionBase.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/property/AssemblyContextNameSectionBase.java deleted file mode 100644 index 47558c6d1c9ba2ffdef2022fff679868c1a536ba..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/property/AssemblyContextNameSectionBase.java +++ /dev/null @@ -1,111 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray PropertySection.xtend - * - * This file contains generated and should not be changed. - * Use the extension point class (the direct subclass of this class) to add manual code - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.property; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.RecordingCommand; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.graphiti.mm.pictograms.PictogramElement; -import org.eclipse.graphiti.services.Graphiti; -import org.eclipse.graphiti.ui.platform.GFPropertySection; -import org.eclipse.graphiti.ui.internal.services.GraphitiUiInternal; -import org.eclipse.jface.action.IStatusLineManager; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CLabel; -import org.eclipse.swt.events.FocusEvent; -import org.eclipse.swt.events.FocusListener; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.FormAttachment; -import org.eclipse.swt.layout.FormData; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Text; -import org.eclipse.swt.custom.CCombo; -import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; -import java.util.List; -import edu.kit.ipd.descartes.core.NamedElement; -import edu.kit.ipd.descartes.core.NamedElement; - -public abstract class AssemblyContextNameSectionBase extends GFPropertySection implements ITabbedPropertyConstants { - - protected NamedElement bc = null; - protected Text nameWidget; - - /** - * {@inheritDoc} - */ - @Override - public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) { - super.createControls(parent, tabbedPropertySheetPage); - - final TabbedPropertySheetWidgetFactory factory = getWidgetFactory(); - final Composite composite = factory.createFlatFormComposite(parent); - FormData data; - - nameWidget = factory.createText(composite, ""); - data = new FormData(); - data.left = new FormAttachment(0, STANDARD_LABEL_WIDTH); - data.right = new FormAttachment(100, 0); - data.top = new FormAttachment(0, VSPACE); - nameWidget.setLayoutData(data); - - CLabel valueLabel = factory.createCLabel(composite, "Name"); - data = new FormData(); - data.left = new FormAttachment(0, 0); - data.right = new FormAttachment(nameWidget, -HSPACE); - data.top = new FormAttachment(nameWidget, 0, SWT.CENTER); - valueLabel.setLayoutData(data); - } - - /** - * {@inheritDoc} - */ - @Override - public void refresh() { - nameWidget.removeModifyListener(nameListener); - - final PictogramElement pe = getSelectedPictogramElement(); - if (pe != null) { - final EObject bo = (EObject) Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(pe); - // the filter assured, that it is a NamedElement - if (bo == null) - return; - bc = (NamedElement) bo; - String value = ""; - value = bc.getName(); - nameWidget.setText(value == null ? "" : value); - nameWidget.addModifyListener(nameListener); - } - } - - private ModifyListener nameListener = new ModifyListener() { - public void modifyText(ModifyEvent arg0) { - TransactionalEditingDomain editingDomain = getDiagramEditor().getEditingDomain(); - editingDomain.getCommandStack().execute(new RecordingCommand(editingDomain) { - @Override - protected void doExecute() { - changePropertyValue(); - } - }); - } - }; - - protected void changePropertyValue() { - String newValue = nameWidget.getText(); - if (!newValue.equals(bc.getName())) { - bc.setName(newValue); - } - } - -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/property/CompositeComponentFilter.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/property/CompositeComponentFilter.java deleted file mode 100644 index 109803a6266b12e10c7ab136310f6fa1aceb7a6a..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/property/CompositeComponentFilter.java +++ /dev/null @@ -1,15 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray Filter.xtend - * - * This file is an extension point: copy to "src" folder to manually add code to this - * extension point. - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.property; - -import org.eclipse.graphiti.features.IFeatureProvider; - -public class CompositeComponentFilter extends CompositeComponentFilterBase { - -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/property/CompositeComponentFilterBase.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/property/CompositeComponentFilterBase.java deleted file mode 100644 index d11557bac595e4d401f098a93eb6555ebb55d858..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/property/CompositeComponentFilterBase.java +++ /dev/null @@ -1,31 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray Filter.xtend - * - * This file contains generated and should not be changed. - * Use the extension point class (the direct subclass of this class) to add manual code - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.property; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.graphiti.mm.pictograms.PictogramElement; -import org.eclipse.graphiti.services.Graphiti; -import org.eclipse.graphiti.ui.platform.AbstractPropertySectionFilter; - -import edu.kit.ipd.descartes.mm.applicationlevel.repository.CompositeComponent; - -public class CompositeComponentFilterBase extends AbstractPropertySectionFilter { - - /** - * {@inheritDoc} - */ - @Override - protected boolean accept(final PictogramElement pe) { - final EObject eObject = Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(pe); - if (eObject instanceof CompositeComponent) { - return true; - } - return false; - } -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/property/CompositeComponentIdSection.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/property/CompositeComponentIdSection.java deleted file mode 100644 index ade9ff3f4eee0f558d2dd5ea0413dd1da0eac862..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/property/CompositeComponentIdSection.java +++ /dev/null @@ -1,13 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray PropertySection.xtend - * - * This file is an extension point: copy to "src" folder to manually add code to this - * extension point. - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.property; - -public class CompositeComponentIdSection extends CompositeComponentIdSectionBase { - -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/property/CompositeComponentIdSectionBase.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/property/CompositeComponentIdSectionBase.java deleted file mode 100644 index 34eb534d8d44b4351d4b7da7950d67cf24ec8594..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/property/CompositeComponentIdSectionBase.java +++ /dev/null @@ -1,111 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray PropertySection.xtend - * - * This file contains generated and should not be changed. - * Use the extension point class (the direct subclass of this class) to add manual code - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.property; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.RecordingCommand; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.graphiti.mm.pictograms.PictogramElement; -import org.eclipse.graphiti.services.Graphiti; -import org.eclipse.graphiti.ui.platform.GFPropertySection; -import org.eclipse.graphiti.ui.internal.services.GraphitiUiInternal; -import org.eclipse.jface.action.IStatusLineManager; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CLabel; -import org.eclipse.swt.events.FocusEvent; -import org.eclipse.swt.events.FocusListener; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.FormAttachment; -import org.eclipse.swt.layout.FormData; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Text; -import org.eclipse.swt.custom.CCombo; -import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; -import java.util.List; -import edu.kit.ipd.descartes.identifier.Identifier; -import edu.kit.ipd.descartes.identifier.Identifier; - -public abstract class CompositeComponentIdSectionBase extends GFPropertySection implements ITabbedPropertyConstants { - - protected Identifier bc = null; - protected Text idWidget; - - /** - * {@inheritDoc} - */ - @Override - public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) { - super.createControls(parent, tabbedPropertySheetPage); - - final TabbedPropertySheetWidgetFactory factory = getWidgetFactory(); - final Composite composite = factory.createFlatFormComposite(parent); - FormData data; - - idWidget = factory.createText(composite, ""); - data = new FormData(); - data.left = new FormAttachment(0, STANDARD_LABEL_WIDTH); - data.right = new FormAttachment(100, 0); - data.top = new FormAttachment(0, VSPACE); - idWidget.setLayoutData(data); - - CLabel valueLabel = factory.createCLabel(composite, "Id"); - data = new FormData(); - data.left = new FormAttachment(0, 0); - data.right = new FormAttachment(idWidget, -HSPACE); - data.top = new FormAttachment(idWidget, 0, SWT.CENTER); - valueLabel.setLayoutData(data); - } - - /** - * {@inheritDoc} - */ - @Override - public void refresh() { - idWidget.removeModifyListener(nameListener); - - final PictogramElement pe = getSelectedPictogramElement(); - if (pe != null) { - final EObject bo = (EObject) Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(pe); - // the filter assured, that it is a Identifier - if (bo == null) - return; - bc = (Identifier) bo; - String value = ""; - value = bc.getId(); - idWidget.setText(value == null ? "" : value); - idWidget.addModifyListener(nameListener); - } - } - - private ModifyListener nameListener = new ModifyListener() { - public void modifyText(ModifyEvent arg0) { - TransactionalEditingDomain editingDomain = getDiagramEditor().getEditingDomain(); - editingDomain.getCommandStack().execute(new RecordingCommand(editingDomain) { - @Override - protected void doExecute() { - changePropertyValue(); - } - }); - } - }; - - protected void changePropertyValue() { - String newValue = idWidget.getText(); - if (!newValue.equals(bc.getId())) { - bc.setId(newValue); - } - } - -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/property/CompositeComponentNameSection.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/property/CompositeComponentNameSection.java deleted file mode 100644 index f52f04dcd1ccce5f868eccd4a517b897d88e0bd5..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/property/CompositeComponentNameSection.java +++ /dev/null @@ -1,13 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray PropertySection.xtend - * - * This file is an extension point: copy to "src" folder to manually add code to this - * extension point. - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.property; - -public class CompositeComponentNameSection extends CompositeComponentNameSectionBase { - -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/property/CompositeComponentNameSectionBase.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/property/CompositeComponentNameSectionBase.java deleted file mode 100644 index a1d23f223826597cec0d4a084fd151fa7c7225ae..0000000000000000000000000000000000000000 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/property/CompositeComponentNameSectionBase.java +++ /dev/null @@ -1,111 +0,0 @@ -/************************************************************************************* - * - * Generated on Thu Jan 10 09:46:29 CET 2013 by Spray PropertySection.xtend - * - * This file contains generated and should not be changed. - * Use the extension point class (the direct subclass of this class) to add manual code - * - *************************************************************************************/ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.property; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.RecordingCommand; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.graphiti.mm.pictograms.PictogramElement; -import org.eclipse.graphiti.services.Graphiti; -import org.eclipse.graphiti.ui.platform.GFPropertySection; -import org.eclipse.graphiti.ui.internal.services.GraphitiUiInternal; -import org.eclipse.jface.action.IStatusLineManager; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CLabel; -import org.eclipse.swt.events.FocusEvent; -import org.eclipse.swt.events.FocusListener; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.FormAttachment; -import org.eclipse.swt.layout.FormData; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Text; -import org.eclipse.swt.custom.CCombo; -import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; -import java.util.List; -import edu.kit.ipd.descartes.core.NamedElement; -import edu.kit.ipd.descartes.core.NamedElement; - -public abstract class CompositeComponentNameSectionBase extends GFPropertySection implements ITabbedPropertyConstants { - - protected NamedElement bc = null; - protected Text nameWidget; - - /** - * {@inheritDoc} - */ - @Override - public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) { - super.createControls(parent, tabbedPropertySheetPage); - - final TabbedPropertySheetWidgetFactory factory = getWidgetFactory(); - final Composite composite = factory.createFlatFormComposite(parent); - FormData data; - - nameWidget = factory.createText(composite, ""); - data = new FormData(); - data.left = new FormAttachment(0, STANDARD_LABEL_WIDTH); - data.right = new FormAttachment(100, 0); - data.top = new FormAttachment(0, VSPACE); - nameWidget.setLayoutData(data); - - CLabel valueLabel = factory.createCLabel(composite, "Name"); - data = new FormData(); - data.left = new FormAttachment(0, 0); - data.right = new FormAttachment(nameWidget, -HSPACE); - data.top = new FormAttachment(nameWidget, 0, SWT.CENTER); - valueLabel.setLayoutData(data); - } - - /** - * {@inheritDoc} - */ - @Override - public void refresh() { - nameWidget.removeModifyListener(nameListener); - - final PictogramElement pe = getSelectedPictogramElement(); - if (pe != null) { - final EObject bo = (EObject) Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(pe); - // the filter assured, that it is a NamedElement - if (bo == null) - return; - bc = (NamedElement) bo; - String value = ""; - value = bc.getName(); - nameWidget.setText(value == null ? "" : value); - nameWidget.addModifyListener(nameListener); - } - } - - private ModifyListener nameListener = new ModifyListener() { - public void modifyText(ModifyEvent arg0) { - TransactionalEditingDomain editingDomain = getDiagramEditor().getEditingDomain(); - editingDomain.getCommandStack().execute(new RecordingCommand(editingDomain) { - @Override - protected void doExecute() { - changePropertyValue(); - } - }); - } - }; - - protected void changePropertyValue() { - String newValue = nameWidget.getText(); - if (!newValue.equals(bc.getName())) { - bc.setName(newValue); - } - } - -} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/shapes/CompositeShape.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/shapes/CompositeShape.java index 1952a57dc292bbe463599f5c9e366fe6811a7f61..08432e2672575e6a7134f61edd5132b180ed2e8b 100644 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/shapes/CompositeShape.java +++ b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/shapes/CompositeShape.java @@ -1,128 +1,128 @@ -/** - * This is a generated Shape for Spray - */ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.shapes; - -import java.util.List; -import java.util.ArrayList; -import org.eclipse.graphiti.mm.algorithms.styles.Point; -import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm; - -import org.eclipse.graphiti.datatypes.IDimension; -import org.eclipse.graphiti.features.*; -import org.eclipse.graphiti.features.context.IAddContext; -import org.eclipse.graphiti.features.impl.AbstractAddShapeFeature; -import org.eclipse.graphiti.services.Graphiti; -import org.eclipse.graphiti.services.IGaService; -import org.eclipse.graphiti.services.IPeService; -import org.eclipse.graphiti.services.IPeCreateService; -import org.eclipse.graphiti.util.ColorConstant; -import org.eclipse.graphiti.util.IColorConstant; - -import org.eclipse.graphiti.mm.pictograms.*; -import org.eclipse.graphiti.mm.algorithms.*; -import org.eclipse.graphiti.mm.algorithms.styles.*; - -import org.eclipselabs.spray.runtime.graphiti.ISprayConstants; -import org.eclipselabs.spray.runtime.graphiti.layout.SprayAbstractLayoutManager; -import org.eclipselabs.spray.runtime.graphiti.layout.SprayLayoutService; -import org.eclipselabs.spray.runtime.graphiti.layout.SprayLayoutType; - -import org.eclipselabs.spray.runtime.graphiti.GraphitiProperties; -import org.eclipselabs.spray.runtime.graphiti.shape.DefaultSprayShape; -import org.eclipselabs.spray.runtime.graphiti.shape.SprayLayoutManager; -import org.eclipselabs.spray.runtime.graphiti.styles.ISprayStyle; - -@SuppressWarnings("all") -public class CompositeShape extends DefaultSprayShape { - - public static enum TextIds { - context, - classText - } - - public CompositeShape(IFeatureProvider fp) { - super(fp); - } - - @Override - public ContainerShape getShape(ContainerShape targetContainer, ISprayStyle sprayStyle) { - // Create a ContainerShape for this Shape - Diagram diagram = peService.getDiagramForShape(targetContainer); - ContainerShape containerShape = peCreateService.createContainerShape(targetContainer, true); - SprayLayoutService.setId(containerShape, "CompositeShape.containerShape"); - - // define general layout for ContainerShape - sprayStyle.getStyle(diagram).setProportional(false); - sprayStyle.getStyle(diagram).setStretchH(false); - sprayStyle.getStyle(diagram).setStretchV(false); - - // layout data - SprayLayoutType containerLayout = SprayLayoutType.TOP; - SprayLayoutService.setLayoutManager(containerShape, containerLayout, 0, 0, true); - SprayLayoutService.getLayoutData(containerShape).setVisible(true); - - // creates the cascaded elements (figures) - IDirectEditingInfo directEditingInfo = getFeatureProvider().getDirectEditingInfo(); - directEditingInfo.setMainPictogramElement(containerShape); - directEditingInfo.setPictogramElement(containerShape); - - GraphicsAlgorithm element_0 = gaService.createInvisibleRectangle(containerShape); - element_0.setStyle(sprayStyle.getStyle(diagram)); - SprayLayoutService.setShapeFromDsl(containerShape, true); - gaService.setLocationAndSize(element_0, 0, 0, 100, 25); - - ContainerShape shape_1 = peCreateService.createContainerShape(containerShape, true); - SprayLayoutService.setId(shape_1, "CompositeShape.shape_1"); - SprayLayoutService.setCompartment(shape_1, true); - GraphitiProperties.set(shape_1, ISprayConstants.TEXT_ID, "context"); - SprayLayoutType layout_1 = SprayLayoutType.VERTICAL; - SprayLayoutService.setLayoutManager(shape_1, layout_1, 5, 5, true); - SprayLayoutService.setLayoutData(shape_1, 100, 25); - Rectangle element_1 = gaService.createPlainRectangle(shape_1); - ISprayStyle style_1 = sprayStyle; - element_1.setStyle(style_1.getStyle(diagram)); - gaService.setLocationAndSize(element_1, 0, 0, 100, 25); - SprayLayoutService.setLayoutData(shape_1, 100, 25, true); - // start RECURSIVEcREATION shape_1 - - Shape shape_2 = peCreateService.createShape(shape_1, false); - SprayLayoutService.setId(shape_2, "CompositeShape.shape_2"); - Text element_2 = gaService.createPlainText(shape_2); - ISprayStyle style_2 = style_1; - element_2.setStyle(style_2.getStyle(diagram)); - gaService.setLocationAndSize(element_2, 5, 0, 95, 25); - SprayLayoutService.setLayoutData(shape_2, 95, 25, true); - element_2.setHorizontalAlignment(Orientation.ALIGNMENT_LEFT); - element_2.setVerticalAlignment(Orientation.ALIGNMENT_TOP); - peService.setPropertyValue(element_2, ISprayConstants.TEXT_ID, TextIds.classText.name()); - peService.setPropertyValue(shape_2, ISprayConstants.TEXT_ID, TextIds.classText.name()); - element_2.setValue(""); - getFeatureProvider().getDirectEditingInfo().setGraphicsAlgorithm(element_2); - // END createElement Text parent shape_1 - // end RECURSIVEcREATION shape_1 - - - // Set start values for height and width as properties on the element for Layout Feature - SprayLayoutManager.setSizePictogramProperties(containerShape); - - // creates the anchors - peCreateService.createChopboxAnchor(containerShape); - - // Fix the broken coordinate syaten for not active container shapes - SprayAbstractLayoutManager.fixOffset(containerShape); - return containerShape; - } - - public SprayLayoutManager getShapeLayout() { - SprayLayoutManager layoutManager = new SprayLayoutManager( ); - layoutManager.setMinSizeWidth(-1); - layoutManager.setMaxSizeWidth(-1); - layoutManager.setMinSizeHeight(-1); - layoutManager.setMaxSizeHeight(-1); - layoutManager.setStretchHorizontal(true); - layoutManager.setStretchVertical(true); - return layoutManager; - } - -} +/** + * This is a generated Shape for Spray + */ +package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.shapes; + +import java.util.List; +import java.util.ArrayList; +import org.eclipse.graphiti.mm.algorithms.styles.Point; +import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm; + +import org.eclipse.graphiti.datatypes.IDimension; +import org.eclipse.graphiti.features.*; +import org.eclipse.graphiti.features.context.IAddContext; +import org.eclipse.graphiti.features.impl.AbstractAddShapeFeature; +import org.eclipse.graphiti.services.Graphiti; +import org.eclipse.graphiti.services.IGaService; +import org.eclipse.graphiti.services.IPeService; +import org.eclipse.graphiti.services.IPeCreateService; +import org.eclipse.graphiti.util.ColorConstant; +import org.eclipse.graphiti.util.IColorConstant; + +import org.eclipse.graphiti.mm.pictograms.*; +import org.eclipse.graphiti.mm.algorithms.*; +import org.eclipse.graphiti.mm.algorithms.styles.*; + +import org.eclipselabs.spray.runtime.graphiti.ISprayConstants; +import org.eclipselabs.spray.runtime.graphiti.layout.SprayAbstractLayoutManager; +import org.eclipselabs.spray.runtime.graphiti.layout.SprayLayoutService; +import org.eclipselabs.spray.runtime.graphiti.layout.SprayLayoutType; + +import org.eclipselabs.spray.runtime.graphiti.GraphitiProperties; +import org.eclipselabs.spray.runtime.graphiti.shape.DefaultSprayShape; +import org.eclipselabs.spray.runtime.graphiti.shape.SprayLayoutManager; +import org.eclipselabs.spray.runtime.graphiti.styles.ISprayStyle; + +@SuppressWarnings("all") +public class CompositeShape extends DefaultSprayShape { + + public static enum TextIds { + context, + classText + } + + public CompositeShape(IFeatureProvider fp) { + super(fp); + } + + @Override + public ContainerShape getShape(ContainerShape targetContainer, ISprayStyle sprayStyle) { + // Create a ContainerShape for this Shape + Diagram diagram = peService.getDiagramForShape(targetContainer); + ContainerShape containerShape = peCreateService.createContainerShape(targetContainer, true); + SprayLayoutService.setId(containerShape, "CompositeShape.containerShape"); + + // define general layout for ContainerShape + sprayStyle.getStyle(diagram).setProportional(false); + sprayStyle.getStyle(diagram).setStretchH(false); + sprayStyle.getStyle(diagram).setStretchV(false); + + // layout data + SprayLayoutType containerLayout = SprayLayoutType.TOP; + SprayLayoutService.setLayoutManager(containerShape, containerLayout, 0, 0, true); + SprayLayoutService.getLayoutData(containerShape).setVisible(true); + + // creates the cascaded elements (figures) + IDirectEditingInfo directEditingInfo = getFeatureProvider().getDirectEditingInfo(); + directEditingInfo.setMainPictogramElement(containerShape); + directEditingInfo.setPictogramElement(containerShape); + + GraphicsAlgorithm element_0 = gaService.createInvisibleRectangle(containerShape); + element_0.setStyle(sprayStyle.getStyle(diagram)); + SprayLayoutService.setShapeFromDsl(containerShape, true); + gaService.setLocationAndSize(element_0, 0, 0, 100, 25); + + ContainerShape shape_1 = peCreateService.createContainerShape(containerShape, true); + SprayLayoutService.setId(shape_1, "CompositeShape.shape_1"); + SprayLayoutService.setCompartment(shape_1, true); + GraphitiProperties.set(shape_1, ISprayConstants.TEXT_ID, "context"); + SprayLayoutType layout_1 = SprayLayoutType.VERTICAL; + SprayLayoutService.setLayoutManager(shape_1, layout_1, 5, 5, true); + SprayLayoutService.setLayoutData(shape_1, 100, 25); + Rectangle element_1 = gaService.createPlainRectangle(shape_1); + ISprayStyle style_1 = sprayStyle; + element_1.setStyle(style_1.getStyle(diagram)); + gaService.setLocationAndSize(element_1, 0, 0, 100, 25); + SprayLayoutService.setLayoutData(shape_1, 100, 25, true); + // start RECURSIVEcREATION shape_1 + + Shape shape_2 = peCreateService.createShape(shape_1, false); + SprayLayoutService.setId(shape_2, "CompositeShape.shape_2"); + Text element_2 = gaService.createPlainText(shape_2); + ISprayStyle style_2 = style_1; + element_2.setStyle(style_2.getStyle(diagram)); + gaService.setLocationAndSize(element_2, 5, 0, 95, 25); + SprayLayoutService.setLayoutData(shape_2, 95, 25, true); + element_2.setHorizontalAlignment(Orientation.ALIGNMENT_LEFT); + element_2.setVerticalAlignment(Orientation.ALIGNMENT_TOP); + peService.setPropertyValue(element_2, ISprayConstants.TEXT_ID, TextIds.classText.name()); + peService.setPropertyValue(shape_2, ISprayConstants.TEXT_ID, TextIds.classText.name()); + element_2.setValue(""); + getFeatureProvider().getDirectEditingInfo().setGraphicsAlgorithm(element_2); + // END createElement Text parent shape_1 + // end RECURSIVEcREATION shape_1 + + + // Set start values for height and width as properties on the element for Layout Feature + SprayLayoutManager.setSizePictogramProperties(containerShape); + + // creates the anchors + peCreateService.createChopboxAnchor(containerShape); + + // Fix the broken coordinate syaten for not active container shapes + SprayAbstractLayoutManager.fixOffset(containerShape); + return containerShape; + } + + public SprayLayoutManager getShapeLayout() { + SprayLayoutManager layoutManager = new SprayLayoutManager( ); + layoutManager.setMinSizeWidth(-1); + layoutManager.setMaxSizeWidth(-1); + layoutManager.setMinSizeHeight(-1); + layoutManager.setMaxSizeHeight(-1); + layoutManager.setStretchHorizontal(true); + layoutManager.setStretchVertical(true); + return layoutManager; + } + +} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/shapes/RectShape.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/shapes/RectShape.java index b1151fc3825cd9a867df8a977d4eae7a12da0900..f7680ec50ca9fa22727fc27c84715f65f8b44801 100644 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/shapes/RectShape.java +++ b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/shapes/RectShape.java @@ -1,123 +1,123 @@ -/** - * This is a generated Shape for Spray - */ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.shapes; - -import java.util.List; -import java.util.ArrayList; -import org.eclipse.graphiti.mm.algorithms.styles.Point; -import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm; - -import org.eclipse.graphiti.datatypes.IDimension; -import org.eclipse.graphiti.features.*; -import org.eclipse.graphiti.features.context.IAddContext; -import org.eclipse.graphiti.features.impl.AbstractAddShapeFeature; -import org.eclipse.graphiti.services.Graphiti; -import org.eclipse.graphiti.services.IGaService; -import org.eclipse.graphiti.services.IPeService; -import org.eclipse.graphiti.services.IPeCreateService; -import org.eclipse.graphiti.util.ColorConstant; -import org.eclipse.graphiti.util.IColorConstant; - -import org.eclipse.graphiti.mm.pictograms.*; -import org.eclipse.graphiti.mm.algorithms.*; -import org.eclipse.graphiti.mm.algorithms.styles.*; - -import org.eclipselabs.spray.runtime.graphiti.ISprayConstants; -import org.eclipselabs.spray.runtime.graphiti.layout.SprayAbstractLayoutManager; -import org.eclipselabs.spray.runtime.graphiti.layout.SprayLayoutService; -import org.eclipselabs.spray.runtime.graphiti.layout.SprayLayoutType; - -import org.eclipselabs.spray.runtime.graphiti.GraphitiProperties; -import org.eclipselabs.spray.runtime.graphiti.shape.DefaultSprayShape; -import org.eclipselabs.spray.runtime.graphiti.shape.SprayLayoutManager; -import org.eclipselabs.spray.runtime.graphiti.styles.ISprayStyle; - -@SuppressWarnings("all") -public class RectShape extends DefaultSprayShape { - - public static enum TextIds { - rectText - } - - public RectShape(IFeatureProvider fp) { - super(fp); - } - - @Override - public ContainerShape getShape(ContainerShape targetContainer, ISprayStyle sprayStyle) { - // Create a ContainerShape for this Shape - Diagram diagram = peService.getDiagramForShape(targetContainer); - ContainerShape containerShape = peCreateService.createContainerShape(targetContainer, true); - SprayLayoutService.setId(containerShape, "RectShape.containerShape"); - - // define general layout for ContainerShape - sprayStyle.getStyle(diagram).setProportional(false); - sprayStyle.getStyle(diagram).setStretchH(false); - sprayStyle.getStyle(diagram).setStretchV(false); - - // layout data - SprayLayoutType containerLayout = SprayLayoutType.TOP; - SprayLayoutService.setLayoutManager(containerShape, containerLayout, 0, 0, true); - SprayLayoutService.getLayoutData(containerShape).setVisible(true); - - // creates the cascaded elements (figures) - IDirectEditingInfo directEditingInfo = getFeatureProvider().getDirectEditingInfo(); - directEditingInfo.setMainPictogramElement(containerShape); - directEditingInfo.setPictogramElement(containerShape); - - GraphicsAlgorithm element_0 = gaService.createInvisibleRectangle(containerShape); - element_0.setStyle(sprayStyle.getStyle(diagram)); - SprayLayoutService.setShapeFromDsl(containerShape, true); - gaService.setLocationAndSize(element_0, 0, 0, 100, 25); - - ContainerShape shape_1 = peCreateService.createContainerShape(containerShape, false); - SprayLayoutService.setId(shape_1, "RectShape.shape_1"); - SprayLayoutService.setCompartment(shape_1, false); - Rectangle element_1 = gaService.createPlainRectangle(shape_1); - ISprayStyle style_1 = sprayStyle; - element_1.setStyle(style_1.getStyle(diagram)); - gaService.setLocationAndSize(element_1, 0, 0, 100, 25); - SprayLayoutService.setLayoutData(shape_1, 100, 25, true); - // start RECURSIVEcREATION shape_1 - - Shape shape_2 = peCreateService.createShape(shape_1, false); - SprayLayoutService.setId(shape_2, "RectShape.shape_2"); - Text element_2 = gaService.createPlainText(shape_2); - ISprayStyle style_2 = style_1; - element_2.setStyle(style_2.getStyle(diagram)); - gaService.setLocationAndSize(element_2, 5, 0, 95, 25); - SprayLayoutService.setLayoutData(shape_2, 95, 25, true); - element_2.setHorizontalAlignment(Orientation.ALIGNMENT_LEFT); - element_2.setVerticalAlignment(Orientation.ALIGNMENT_TOP); - peService.setPropertyValue(element_2, ISprayConstants.TEXT_ID, TextIds.rectText.name()); - peService.setPropertyValue(shape_2, ISprayConstants.TEXT_ID, TextIds.rectText.name()); - element_2.setValue(""); - getFeatureProvider().getDirectEditingInfo().setGraphicsAlgorithm(element_2); - // END createElement Text parent shape_1 - // end RECURSIVEcREATION shape_1 - - - // Set start values for height and width as properties on the element for Layout Feature - SprayLayoutManager.setSizePictogramProperties(containerShape); - - // creates the anchors - peCreateService.createChopboxAnchor(containerShape); - - // Fix the broken coordinate syaten for not active container shapes - SprayAbstractLayoutManager.fixOffset(containerShape); - return containerShape; - } - - public SprayLayoutManager getShapeLayout() { - SprayLayoutManager layoutManager = new SprayLayoutManager( ); - layoutManager.setMinSizeWidth(-1); - layoutManager.setMaxSizeWidth(-1); - layoutManager.setMinSizeHeight(-1); - layoutManager.setMaxSizeHeight(-1); - layoutManager.setStretchHorizontal(true); - layoutManager.setStretchVertical(true); - return layoutManager; - } - -} +/** + * This is a generated Shape for Spray + */ +package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.shapes; + +import java.util.List; +import java.util.ArrayList; +import org.eclipse.graphiti.mm.algorithms.styles.Point; +import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm; + +import org.eclipse.graphiti.datatypes.IDimension; +import org.eclipse.graphiti.features.*; +import org.eclipse.graphiti.features.context.IAddContext; +import org.eclipse.graphiti.features.impl.AbstractAddShapeFeature; +import org.eclipse.graphiti.services.Graphiti; +import org.eclipse.graphiti.services.IGaService; +import org.eclipse.graphiti.services.IPeService; +import org.eclipse.graphiti.services.IPeCreateService; +import org.eclipse.graphiti.util.ColorConstant; +import org.eclipse.graphiti.util.IColorConstant; + +import org.eclipse.graphiti.mm.pictograms.*; +import org.eclipse.graphiti.mm.algorithms.*; +import org.eclipse.graphiti.mm.algorithms.styles.*; + +import org.eclipselabs.spray.runtime.graphiti.ISprayConstants; +import org.eclipselabs.spray.runtime.graphiti.layout.SprayAbstractLayoutManager; +import org.eclipselabs.spray.runtime.graphiti.layout.SprayLayoutService; +import org.eclipselabs.spray.runtime.graphiti.layout.SprayLayoutType; + +import org.eclipselabs.spray.runtime.graphiti.GraphitiProperties; +import org.eclipselabs.spray.runtime.graphiti.shape.DefaultSprayShape; +import org.eclipselabs.spray.runtime.graphiti.shape.SprayLayoutManager; +import org.eclipselabs.spray.runtime.graphiti.styles.ISprayStyle; + +@SuppressWarnings("all") +public class RectShape extends DefaultSprayShape { + + public static enum TextIds { + rectText + } + + public RectShape(IFeatureProvider fp) { + super(fp); + } + + @Override + public ContainerShape getShape(ContainerShape targetContainer, ISprayStyle sprayStyle) { + // Create a ContainerShape for this Shape + Diagram diagram = peService.getDiagramForShape(targetContainer); + ContainerShape containerShape = peCreateService.createContainerShape(targetContainer, true); + SprayLayoutService.setId(containerShape, "RectShape.containerShape"); + + // define general layout for ContainerShape + sprayStyle.getStyle(diagram).setProportional(false); + sprayStyle.getStyle(diagram).setStretchH(false); + sprayStyle.getStyle(diagram).setStretchV(false); + + // layout data + SprayLayoutType containerLayout = SprayLayoutType.TOP; + SprayLayoutService.setLayoutManager(containerShape, containerLayout, 0, 0, true); + SprayLayoutService.getLayoutData(containerShape).setVisible(true); + + // creates the cascaded elements (figures) + IDirectEditingInfo directEditingInfo = getFeatureProvider().getDirectEditingInfo(); + directEditingInfo.setMainPictogramElement(containerShape); + directEditingInfo.setPictogramElement(containerShape); + + GraphicsAlgorithm element_0 = gaService.createInvisibleRectangle(containerShape); + element_0.setStyle(sprayStyle.getStyle(diagram)); + SprayLayoutService.setShapeFromDsl(containerShape, true); + gaService.setLocationAndSize(element_0, 0, 0, 100, 25); + + ContainerShape shape_1 = peCreateService.createContainerShape(containerShape, false); + SprayLayoutService.setId(shape_1, "RectShape.shape_1"); + SprayLayoutService.setCompartment(shape_1, false); + Rectangle element_1 = gaService.createPlainRectangle(shape_1); + ISprayStyle style_1 = sprayStyle; + element_1.setStyle(style_1.getStyle(diagram)); + gaService.setLocationAndSize(element_1, 0, 0, 100, 25); + SprayLayoutService.setLayoutData(shape_1, 100, 25, true); + // start RECURSIVEcREATION shape_1 + + Shape shape_2 = peCreateService.createShape(shape_1, false); + SprayLayoutService.setId(shape_2, "RectShape.shape_2"); + Text element_2 = gaService.createPlainText(shape_2); + ISprayStyle style_2 = style_1; + element_2.setStyle(style_2.getStyle(diagram)); + gaService.setLocationAndSize(element_2, 5, 0, 95, 25); + SprayLayoutService.setLayoutData(shape_2, 95, 25, true); + element_2.setHorizontalAlignment(Orientation.ALIGNMENT_LEFT); + element_2.setVerticalAlignment(Orientation.ALIGNMENT_TOP); + peService.setPropertyValue(element_2, ISprayConstants.TEXT_ID, TextIds.rectText.name()); + peService.setPropertyValue(shape_2, ISprayConstants.TEXT_ID, TextIds.rectText.name()); + element_2.setValue(""); + getFeatureProvider().getDirectEditingInfo().setGraphicsAlgorithm(element_2); + // END createElement Text parent shape_1 + // end RECURSIVEcREATION shape_1 + + + // Set start values for height and width as properties on the element for Layout Feature + SprayLayoutManager.setSizePictogramProperties(containerShape); + + // creates the anchors + peCreateService.createChopboxAnchor(containerShape); + + // Fix the broken coordinate syaten for not active container shapes + SprayAbstractLayoutManager.fixOffset(containerShape); + return containerShape; + } + + public SprayLayoutManager getShapeLayout() { + SprayLayoutManager layoutManager = new SprayLayoutManager( ); + layoutManager.setMinSizeWidth(-1); + layoutManager.setMaxSizeWidth(-1); + layoutManager.setMinSizeHeight(-1); + layoutManager.setMaxSizeHeight(-1); + layoutManager.setStretchHorizontal(true); + layoutManager.setStretchVertical(true); + return layoutManager; + } + +} diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/styles/CompositediagramDefaultStyle.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/styles/CompositediagramDefaultStyle.java index 5e534eb8eb2e14afdeafbcb68766f9e7fb7df762..fe86784287651283392c74d7ad4ff85d427da5f6 100644 --- a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/styles/CompositediagramDefaultStyle.java +++ b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src-gen/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/styles/CompositediagramDefaultStyle.java @@ -1,76 +1,76 @@ -/** - * This is a generated Style class for Spray. - */ -package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.styles; - -import org.eclipse.graphiti.mm.pictograms.Diagram; -import org.eclipse.graphiti.mm.algorithms.styles.Style; -import org.eclipse.graphiti.mm.algorithms.styles.Color; -import org.eclipse.graphiti.mm.algorithms.styles.LineStyle; -import org.eclipse.graphiti.services.Graphiti; -import org.eclipse.graphiti.services.IGaService; -import org.eclipse.graphiti.util.ColorConstant; -import org.eclipse.graphiti.util.IColorConstant; -import org.eclipse.graphiti.mm.algorithms.styles.AdaptedGradientColoredAreas; -import org.eclipse.graphiti.util.IGradientType; -import org.eclipse.graphiti.mm.algorithms.styles.StylesFactory; -import org.eclipse.graphiti.util.IPredefinedRenderingStyle; -import org.eclipselabs.spray.styles.generator.util.GradientUtilClass; - - - /** - * This is a generated Style class for Spray. - * Description: The default style of the compositediagram diagram type. - */ - @SuppressWarnings("all") - public class CompositediagramDefaultStyle extends org.eclipselabs.spray.runtime.graphiti.styles.DefaultSprayStyle { - - /** - * This method creates a Style and returns the defined style. - * Description: The default style of the compositediagram diagram type. - */ - @Override - public Style newStyle(Diagram diagram) { - IGaService gaService = Graphiti.getGaService(); - - // Creating Style with given id and description - Style style = super.newStyle(diagram); - style.setId("CompositediagramDefaultStyle"); - style.setDescription("The default style of the compositediagram diagram type."); - - // transparency value - - // background attributes - - // line attributes - - // font attributes - String fontName = style.getFont().getName(); - int fontSize = 12; - boolean fontItalic = style.getFont().isItalic(); - boolean fontBold = style.getFont().isBold(); - style.setFont(gaService.manageFont(diagram, fontName, fontSize, fontItalic, fontBold)); - - - return style; - } - - /** - * This method returns the font color for the style. - * The font color will be returned separated, because Graphiti allows just the foreground color. - * The foreground color will be used for lines and fonts at the same time. - */ - @Override - public Color getFontColor(Diagram diagram) { - return super.getFontColor(diagram); - } - - /** - * This method returns Color Schema of the Style - */ - public AdaptedGradientColoredAreas getColorSchema() { - return null; - } - - - } +/** + * This is a generated Style class for Spray. + */ +package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.styles; + +import org.eclipse.graphiti.mm.pictograms.Diagram; +import org.eclipse.graphiti.mm.algorithms.styles.Style; +import org.eclipse.graphiti.mm.algorithms.styles.Color; +import org.eclipse.graphiti.mm.algorithms.styles.LineStyle; +import org.eclipse.graphiti.services.Graphiti; +import org.eclipse.graphiti.services.IGaService; +import org.eclipse.graphiti.util.ColorConstant; +import org.eclipse.graphiti.util.IColorConstant; +import org.eclipse.graphiti.mm.algorithms.styles.AdaptedGradientColoredAreas; +import org.eclipse.graphiti.util.IGradientType; +import org.eclipse.graphiti.mm.algorithms.styles.StylesFactory; +import org.eclipse.graphiti.util.IPredefinedRenderingStyle; +import org.eclipselabs.spray.styles.generator.util.GradientUtilClass; + + + /** + * This is a generated Style class for Spray. + * Description: The default style of the compositediagram diagram type. + */ + @SuppressWarnings("all") + public class CompositediagramDefaultStyle extends org.eclipselabs.spray.runtime.graphiti.styles.DefaultSprayStyle { + + /** + * This method creates a Style and returns the defined style. + * Description: The default style of the compositediagram diagram type. + */ + @Override + public Style newStyle(Diagram diagram) { + IGaService gaService = Graphiti.getGaService(); + + // Creating Style with given id and description + Style style = super.newStyle(diagram); + style.setId("CompositediagramDefaultStyle"); + style.setDescription("The default style of the compositediagram diagram type."); + + // transparency value + + // background attributes + + // line attributes + + // font attributes + String fontName = style.getFont().getName(); + int fontSize = 12; + boolean fontItalic = style.getFont().isItalic(); + boolean fontBold = style.getFont().isBold(); + style.setFont(gaService.manageFont(diagram, fontName, fontSize, fontItalic, fontBold)); + + + return style; + } + + /** + * This method returns the font color for the style. + * The font color will be returned separated, because Graphiti allows just the foreground color. + * The foreground color will be used for lines and fonts at the same time. + */ + @Override + public Color getFontColor(Diagram diagram) { + return super.getFontColor(diagram); + } + + /** + * This method returns Color Schema of the Style + */ + public AdaptedGradientColoredAreas getColorSchema() { + return null; + } + + + } diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/diagram/CompositediagramFeatureProvider.java b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/diagram/CompositediagramFeatureProvider.java new file mode 100644 index 0000000000000000000000000000000000000000..bf6f964dc9f9bcbc1a2bd30b7238d87c2c415cf5 --- /dev/null +++ b/edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram/src/edu/kit/ipd/descartes/mm/applicationlevel/repository/compositediagram/diagram/CompositediagramFeatureProvider.java @@ -0,0 +1,39 @@ +/************************************************************************************* + * + * Generated on Fri Feb 01 12:29:56 CET 2013 by Spray FeatureProvider.xtend + * + * This file is an extension point: copy to "src" folder to manually add code to this + * extension point. + * + *************************************************************************************/ +package edu.kit.ipd.descartes.mm.applicationlevel.repository.compositediagram.diagram; + +import java.util.ArrayList; +import java.util.Arrays; + +import org.eclipse.graphiti.dt.IDiagramTypeProvider; +import org.eclipse.graphiti.features.context.ICustomContext; +import org.eclipse.graphiti.features.custom.ICustomFeature; +import org.eclipselabs.spray.runtime.graphiti.zest.features.ZestLayoutDiagramFeature; + +import com.google.common.collect.Iterables; + +public class CompositediagramFeatureProvider extends CompositediagramFeatureProviderBase { + + public CompositediagramFeatureProvider(final IDiagramTypeProvider dtp) { + super(dtp); + } + + @Override + public ICustomFeature[] getCustomFeatures(ICustomContext context) { + ArrayList<ICustomFeature> features = new ArrayList<ICustomFeature>(Arrays.asList(super.getCustomFeatures(context))); + + ZestLayoutDiagramFeature zestLayoutFeature = new ZestLayoutDiagramFeature(this); + if (zestLayoutFeature.canExecute(context)) { + features.add(zestLayoutFeature); + } + return Iterables.toArray(features, ICustomFeature.class); + } + + +}