I am trying to work out how to setup link mapping so that I can draw a link on the diagram to setup a reference between two nodes. (i.e. drag the little square handle on the source to the destination) .
This works fine when I specifically define the reference to be exactly the destination class, but I want the reference definition to be the superclass of the destination, if I do this dragging the link no longer works.
In order to test this out I have defined 4 very simple classes using the annotated Interfaces below. I want to drag a link from a MSubNodeS instance to a MSubNodeD instance and for this to put a reference to the MSubNodeD into MSubNodeS.link.
This won't work as I have it defined below, but it will work if I change:
MSubNode getLink();
to
MSubNodeD getLink();
What I would like is if I drag a link from a MSubNodeS instance to a MSubNodeD instance then it will set link to be a MSubNodeD reference and if I drag a link from a MSubNodeS instance to another MSubNodeS instance then it will set link to be a MSubNodeS reference.
Base class:
/** @model */
public interface MNode extends EObject {
/** @model */
String getName();
/** @model containment="true" */
EList<MSubNodeS> getSubNodeS();
/** @model containment="true" */
EList<MSubNodeD> getSubNodeD();
} |
Super Class:
/** @model */
public interface MSubNode extends EObject { /** @model */
String getName();
} |
Destination Class:
/** @model */
public interface MSubNodeD extends MSubNode {
} |
Source Class:
/** @model */
public interface MSubNodeS extends MSubNode {
/** @model */
MSubNode getLink();
} |
If you would like to try this I have put these interfaces into a zip file here.
Can I do this? If so can you see what I am doing wrong?
In orger to get this example to work I needed to patch the code generated by gmf, I modified the following class:
package: mathModel.diagram.providers
class: MathModelModelingAssistantProvider
from: these are the 4 methods generated by gmf from the interfaces above, with this code link drag does not work:
public List getRelTypesOnTarget(IAdaptable target) {
IGraphicalEditPart targetEditPart = (IGraphicalEditPart) target
.getAdapter(IGraphicalEditPart.class);
return Collections.EMPTY_LIST;
}
public List getRelTypesOnSourceAndTarget(IAdaptable source,
IAdaptable target) {
IGraphicalEditPart sourceEditPart = (IGraphicalEditPart) source
.getAdapter(IGraphicalEditPart.class);
IGraphicalEditPart targetEditPart = (IGraphicalEditPart) target
.getAdapter(IGraphicalEditPart.class);
if (sourceEditPart instanceof mathModel.diagram.edit.parts.MSubNodeSEditPart) {
List types = new ArrayList();
return types;
}
return Collections.EMPTY_LIST;
}
public List getTypesForSource(IAdaptable target,
IElementType relationshipType) {
IGraphicalEditPart targetEditPart = (IGraphicalEditPart) target
.getAdapter(IGraphicalEditPart.class);
return Collections.EMPTY_LIST;
}
public List getTypesForTarget(IAdaptable source,
IElementType relationshipType) {
IGraphicalEditPart sourceEditPart = (IGraphicalEditPart) source
.getAdapter(IGraphicalEditPart.class);
if (sourceEditPart instanceof mathModel.diagram.edit.parts.MSubNodeSEditPart) {
List types = new ArrayList();
return types;
}
return Collections.EMPTY_LIST;
} |
to: this is how I have to edit the 4 methods to get link drag to work:
public List getRelTypesOnTarget(IAdaptable target) {
IGraphicalEditPart targetEditPart = (IGraphicalEditPart) target
.getAdapter(IGraphicalEditPart.class);
if (targetEditPart instanceof mathModel.diagram.edit.parts.MSubNodeDEditPart) {
List types = new ArrayList();
types.add(mathModel.diagram.providers.MathModelElementTypes.MSubNodeSLink_3001);
return types;
}
return Collections.EMPTY_LIST;
}
/**
* @generated
*/
public List getRelTypesOnSourceAndTarget(IAdaptable source,
IAdaptable target) {
IGraphicalEditPart sourceEditPart = (IGraphicalEditPart) source
.getAdapter(IGraphicalEditPart.class);
IGraphicalEditPart targetEditPart = (IGraphicalEditPart) target
.getAdapter(IGraphicalEditPart.class);
if (sourceEditPart instanceof mathModel.diagram.edit.parts.MSubNodeSEditPart) {
List types = new ArrayList();
if (targetEditPart instanceof mathModel.diagram.edit.parts.MSubNodeDEditPart) {
types.add(mathModel.diagram.providers.MathModelElementTypes.MSubNodeSLink_3001);
}
return types;
}
return Collections.EMPTY_LIST;
}
/**
* @generated
*/
public List getTypesForSource(IAdaptable target,
IElementType relationshipType) {
IGraphicalEditPart targetEditPart = (IGraphicalEditPart) target
.getAdapter(IGraphicalEditPart.class);
if (targetEditPart instanceof mathModel.diagram.edit.parts.MSubNodeDEditPart) {
List types = new ArrayList();
if (relationshipType == mathModel.diagram.providers.MathModelElementTypes.MSubNodeSLink_3001) {
types.add(mathModel.diagram.providers.MathModelElementTypes.MSubNodeS_1002);
}
return types;
}
return Collections.EMPTY_LIST;
}
/**
* @generated
*/
public List getTypesForTarget(IAdaptable source,
IElementType relationshipType) {
IGraphicalEditPart sourceEditPart = (IGraphicalEditPart) source
.getAdapter(IGraphicalEditPart.class);
if (sourceEditPart instanceof mathModel.diagram.edit.parts.MSubNodeSEditPart) {
List types = new ArrayList();
if (relationshipType == mathModel.diagram.providers.MathModelElementTypes.MSubNodeSLink_3001) {
types.add(mathModel.diagram.providers.MathModelElementTypes.MSubNodeD_1001);
}
return types;
}
return Collections.EMPTY_LIST;
} |
More info about configuration:
mathModel.ecore
ecore defines the metamodel, elements, attributes, references and so on.
<?xml version="1.0" encoding="UTF-8"?> <ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="mathModel" nsURI="http:///mathModel.ecore" nsPrefix="mathModel"> <eClassifiers xsi:type="ecore:EClass" name="MNode"> <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> <eStructuralFeatures xsi:type="ecore:EReference" name="subNodeS" upperBound="-1" eType="#//MSubNodeS" containment="true" resolveProxies="false"/> <eStructuralFeatures xsi:type="ecore:EReference" name="subNodeD" upperBound="-1" eType="#//MSubNodeD" containment="true" resolveProxies="false"/> </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="MSubNode"> <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="MSubNodeD" eSuperTypes="#//MSubNode"/> <eClassifiers xsi:type="ecore:EClass" name="MSubNodeS" eSuperTypes="#//MSubNode"> <eStructuralFeatures xsi:type="ecore:EReference" name="link" eType="#//MSubNode"/> </eClassifiers> </ecore:EPackage> |
mathModel.genmodel
genmodel is more like java code with packages, classes and 'features'
<?xml version="1.0" encoding="UTF-8"?> <genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/com.mjb.es3/src" modelPluginID="com.mjb.es3" modelName="MathModel" importerID="org.eclipse.emf.importer.java" complianceLevel="6.0" copyrightFields="false"> <foreignModel>@model</foreignModel> <genPackages prefix="MathModel" disposableProviderFactory="true" ecorePackage="mathModel.ecore#/"> <genClasses ecoreClass="mathModel.ecore#//MNode"> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute mathModel.ecore#//MNode/name"/> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference mathModel.ecore#//MNode/subNodeS"/> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference mathModel.ecore#//MNode/subNodeD"/> </genClasses> <genClasses ecoreClass="mathModel.ecore#//MSubNode"> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute mathModel.ecore#//MSubNode/name"/> </genClasses> <genClasses ecoreClass="mathModel.ecore#//MSubNodeD"/> <genClasses ecoreClass="mathModel.ecore#//MSubNodeS"> <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference mathModel.ecore#//MSubNodeS/link"/> </genClasses> </genPackages> </genmodel:GenModel> |
mathModel.gmfgraph
The .gmfgraph file defines a graphical view of the model.
gmfgraph has:
- figures - containing figures (ex: PolylineDecoration,Rectangle) and descriptors
- nodes
- connections
- compartments
- labels
<?xml version="1.0" encoding="UTF-8"?> <gmfgraph:Canvas xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="mathModel"> <figures name="Default"> <figures xsi:type="gmfgraph:PolylineDecoration" name="MSubNodeSLinkTargetDecoration"/> <descriptors name="MSubNodeDFigure"> <actualFigure xsi:type="gmfgraph:Rectangle" name="MSubNodeDFigure"> <layout xsi:type="gmfgraph:FlowLayout"/> <children xsi:type="gmfgraph:Label" name="MSubNodeDNameFigure" text="<...>"/> </actualFigure> <accessors figure="//@figures.0/@descriptors.0/@actualFigure/@children.0"/> </descriptors> <descriptors name="MSubNodeSFigure"> <actualFigure xsi:type="gmfgraph:Rectangle" name="MSubNodeSFigure"> <layout xsi:type="gmfgraph:FlowLayout"/> <children xsi:type="gmfgraph:Label" name="MSubNodeSNameFigure" text="<...>"/> </actualFigure> <accessors figure="//@figures.0/@descriptors.1/@actualFigure/@children.0"/> </descriptors> <descriptors name="MSubNodeSLinkFigure"> <actualFigure xsi:type="gmfgraph:PolylineConnection" name="MSubNodeSLinkFigure" targetDecoration="//@figures.0/@figures.0"/> </descriptors> </figures> <nodes name="MSubNodeD" figure="MSubNodeDFigure"/> <nodes name="MSubNodeS" figure="MSubNodeSFigure"/> <connections name="MSubNodeSLink" figure="MSubNodeSLinkFigure"/> <labels name="MSubNodeDName" figure="MSubNodeDFigure" accessor="//@figures.0/@descriptors.0/@accessors.0"/> <labels name="MSubNodeSName" figure="MSubNodeSFigure" accessor="//@figures.0/@descriptors.1/@accessors.0"/> </gmfgraph:Canvas> |
mathModel.gmftool
Defines tools such as the pallette for creating new nodes and links
<?xml version="1.0" encoding="UTF-8"?> <gmftool:ToolRegistry xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gmftool="http://www.eclipse.org/gmf/2005/ToolDefinition"> <palette title="mathModelPalette"> <tools xsi:type="gmftool:ToolGroup" title="mathModel"> <tools xsi:type="gmftool:CreationTool" title="MSubNodeD" description="Create new MSubNodeD"> <smallIcon xsi:type="gmftool:DefaultImage"/> <largeIcon xsi:type="gmftool:DefaultImage"/> </tools> <tools xsi:type="gmftool:CreationTool" title="MSubNodeS" description="Create new MSubNodeS"> <smallIcon xsi:type="gmftool:DefaultImage"/> <largeIcon xsi:type="gmftool:DefaultImage"/> </tools> </tools> </palette> </gmftool:ToolRegistry> |
mathModel.gmfmap
gmfmap maps the pallete and the graphical objects to the ecore metamodel.
nodes, links and diagram
<?xml version="1.0" encoding="UTF-8"?> <gmfmap:Mapping xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:gmfmap="http://www.eclipse.org/gmf/2008/mappings" xmlns:gmftool="http://www.eclipse.org/gmf/2005/ToolDefinition"> <nodes> <containmentFeature href="mathModel.ecore#//MNode/subNodeD"/> <ownedChild> <domainMetaElement href="mathModel.ecore#//MSubNodeD"/> <labelMappings xsi:type="gmfmap:FeatureLabelMapping"> <diagramLabel href="mathModel.gmfgraph#MSubNodeDName"/> <features href="mathModel.ecore#//MSubNode/name"/> </labelMappings> <tool xsi:type="gmftool:CreationTool" href="mathModel.gmftool#//@palette/@tools.0/@tools.0"/> <diagramNode href="mathModel.gmfgraph#MSubNodeD"/> </ownedChild> </nodes> <nodes> <containmentFeature href="mathModel.ecore#//MNode/subNodeS"/> <ownedChild> <domainMetaElement href="mathModel.ecore#//MSubNodeS"/> <labelMappings xsi:type="gmfmap:FeatureLabelMapping"> <diagramLabel href="mathModel.gmfgraph#MSubNodeSName"/> <features href="mathModel.ecore#//MSubNode/name"/> </labelMappings> <tool xsi:type="gmftool:CreationTool" href="mathModel.gmftool#//@palette/@tools.0/@tools.1"/> <diagramNode href="mathModel.gmfgraph#MSubNodeS"/> </ownedChild> </nodes> <links> <tool xsi:type="gmftool:CreationTool" href="mathModel.gmftool#//@palette/@tools.0/@tools.0"/> <diagramLink href="mathModel.gmfgraph#MSubNodeSLink"/> <linkMetaFeature xsi:type="ecore:EReference" href="mathModel.ecore#//MSubNodeS/link"/> </links> <diagram> <diagramCanvas href="mathModel.gmfgraph#mathModel"/> <domainModel href="mathModel.ecore#/"/> <domainMetaElement href="mathModel.ecore#//MNode"/> <palette href="mathModel.gmftool#//@palette"/> </diagram> </gmfmap:Mapping> |
mathModel.gmfgen
<?xml version="1.0" encoding="UTF-8"?> <gmfgen:GenEditorGenerator xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gmfgen="http://www.eclipse.org/gmf/2008/GenModel"> <diagram visualID="79" editPartClassName="MNodeEditPart" itemSemanticEditPolicyClassName="MNodeItemSemanticEditPolicy" notationViewFactoryClassName="MNodeViewFactory" canonicalEditPolicyClassName="MNodeCanonicalEditPolicy" iconProviderPriority="Low" validationProviderPriority="Low"> <diagramRunTimeClass href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Diagram"/> <elementType xsi:type="gmfgen:MetamodelType" editHelperClassName="MNodeEditHelper"/> <viewmap xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.draw2d.FreeformLayer"/> <domainDiagramElement href="mathModel.genmodel#//mathModel/MNode"/> <topLevelNodes visualID="1001" editPartClassName="MSubNodeDEditPart" itemSemanticEditPolicyClassName="MSubNodeDItemSemanticEditPolicy" notationViewFactoryClassName="MSubNodeDViewFactory" canonicalEditPolicyClassName="MSubNodeDCanonicalEditPolicy" graphicalNodeEditPolicyClassName="MSubNodeDGraphicalNodeEditPolicy" createCommandClassName="MSubNodeDCreateCommand"> <diagramRunTimeClass href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> <elementType xsi:type="gmfgen:MetamodelType" editHelperClassName="MSubNodeDEditHelper"/> <viewmap xsi:type="gmfgen:InnerClassViewmap" layoutType="FLOW_LAYOUT" className="MSubNodeDFigure" classBody="
/**
 * @generated
 */
public class MSubNodeDFigure extends org.eclipse.draw2d.RectangleFigure {


	/**
	 * @generated
	 */
	private org.eclipse.draw2d.Label fFigureMSubNodeDNameFigure; 


	/**
	 * @generated
	 */
	public MSubNodeDFigure() {
		
	org.eclipse.draw2d.FlowLayout layoutThis = new org.eclipse.draw2d.FlowLayout();
	layoutThis.setStretchMinorAxis(false);
	layoutThis.setMinorAlignment(org.eclipse.draw2d.FlowLayout.ALIGN_LEFTTOP
);

	layoutThis.setMajorAlignment(org.eclipse.draw2d.FlowLayout.ALIGN_LEFTTOP
);
	layoutThis.setMajorSpacing(5);
	layoutThis.setMinorSpacing(5);
	layoutThis.setHorizontal(true);

	this.setLayoutManager(layoutThis);

				createContents();
	}
	/**
	 * @generated
	 */
	private void createContents(){


fFigureMSubNodeDNameFigure = new org.eclipse.draw2d.Label();
fFigureMSubNodeDNameFigure.setText("<...>");

this.add(fFigureMSubNodeDNameFigure);


	}




	/**
	 * @generated
	 */
	private boolean myUseLocalCoordinates = false;

	/**
	 * @generated
	 */
	protected boolean useLocalCoordinates() {
		return myUseLocalCoordinates;
	}

	/**
	 * @generated
	 */
	protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
		myUseLocalCoordinates = useLocalCoordinates;
	}



	/**
	 * @generated
	 */
	public org.eclipse.draw2d.Label getFigureMSubNodeDNameFigure() {
		return fFigureMSubNodeDNameFigure;
	}


}

"> <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs> </viewmap> <modelFacet> <metaClass href="mathModel.genmodel#//mathModel/MSubNodeD"/> <containmentMetaFeature href="mathModel.genmodel#//mathModel/MNode/subNodeD"/> <childMetaFeature href="mathModel.genmodel#//mathModel/MNode/subNodeD"/> </modelFacet> <labels visualID="4001" editPartClassName="MSubNodeDNameEditPart" itemSemanticEditPolicyClassName="MSubNodeDNameItemSemanticEditPolicy" notationViewFactoryClassName="MSubNodeDNameViewFactory" elementIcon="true"> <diagramRunTimeClass href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> <viewmap xsi:type="gmfgen:ParentAssignedViewmap" getterName="getFigureMSubNodeDNameFigure" figureQualifiedClassName="org.eclipse.draw2d.Label"/> <modelFacet xsi:type="gmfgen:FeatureLabelModelFacet"> <metaFeatures href="mathModel.genmodel#//mathModel/MSubNode/name"/> </modelFacet> </labels> </topLevelNodes> <topLevelNodes visualID="1002" editPartClassName="MSubNodeSEditPart" itemSemanticEditPolicyClassName="MSubNodeSItemSemanticEditPolicy" notationViewFactoryClassName="MSubNodeSViewFactory" canonicalEditPolicyClassName="MSubNodeSCanonicalEditPolicy" graphicalNodeEditPolicyClassName="MSubNodeSGraphicalNodeEditPolicy" createCommandClassName="MSubNodeSCreateCommand"> <diagramRunTimeClass href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> <elementType xsi:type="gmfgen:MetamodelType" editHelperClassName="MSubNodeSEditHelper"/> <viewmap xsi:type="gmfgen:InnerClassViewmap" layoutType="FLOW_LAYOUT" className="MSubNodeSFigure" classBody="
/**
 * @generated
 */
public class MSubNodeSFigure extends org.eclipse.draw2d.RectangleFigure {


	/**
	 * @generated
	 */
	private org.eclipse.draw2d.Label fFigureMSubNodeSNameFigure; 


	/**
	 * @generated
	 */
	public MSubNodeSFigure() {
		
	org.eclipse.draw2d.FlowLayout layoutThis = new org.eclipse.draw2d.FlowLayout();
	layoutThis.setStretchMinorAxis(false);
	layoutThis.setMinorAlignment(org.eclipse.draw2d.FlowLayout.ALIGN_LEFTTOP
);

	layoutThis.setMajorAlignment(org.eclipse.draw2d.FlowLayout.ALIGN_LEFTTOP
);
	layoutThis.setMajorSpacing(5);
	layoutThis.setMinorSpacing(5);
	layoutThis.setHorizontal(true);

	this.setLayoutManager(layoutThis);

				createContents();
	}
	/**
	 * @generated
	 */
	private void createContents(){


fFigureMSubNodeSNameFigure = new org.eclipse.draw2d.Label();
fFigureMSubNodeSNameFigure.setText("<...>");

this.add(fFigureMSubNodeSNameFigure);


	}




	/**
	 * @generated
	 */
	private boolean myUseLocalCoordinates = false;

	/**
	 * @generated
	 */
	protected boolean useLocalCoordinates() {
		return myUseLocalCoordinates;
	}

	/**
	 * @generated
	 */
	protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
		myUseLocalCoordinates = useLocalCoordinates;
	}



	/**
	 * @generated
	 */
	public org.eclipse.draw2d.Label getFigureMSubNodeSNameFigure() {
		return fFigureMSubNodeSNameFigure;
	}


}

"> <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs> </viewmap> <modelFacet> <metaClass href="mathModel.genmodel#//mathModel/MSubNodeS"/> <containmentMetaFeature href="mathModel.genmodel#//mathModel/MNode/subNodeS"/> <childMetaFeature href="mathModel.genmodel#//mathModel/MNode/subNodeS"/> </modelFacet> <labels visualID="4002" editPartClassName="MSubNodeSNameEditPart" itemSemanticEditPolicyClassName="MSubNodeSNameItemSemanticEditPolicy" notationViewFactoryClassName="MSubNodeSNameViewFactory" elementIcon="true"> <diagramRunTimeClass href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> <viewmap xsi:type="gmfgen:ParentAssignedViewmap" getterName="getFigureMSubNodeSNameFigure" figureQualifiedClassName="org.eclipse.draw2d.Label"/> <modelFacet xsi:type="gmfgen:FeatureLabelModelFacet"> <metaFeatures href="mathModel.genmodel#//mathModel/MSubNode/name"/> </modelFacet> </labels> </topLevelNodes> <links visualID="3001" editPartClassName="MSubNodeSLinkEditPart" itemSemanticEditPolicyClassName="MSubNodeSLinkItemSemanticEditPolicy" notationViewFactoryClassName="MSubNodeSLinkViewFactory" createCommandClassName="MSubNodeSLinkCreateCommand" reorientCommandClassName="MSubNodeSLinkReorientCommand"> <diagramRunTimeClass href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/> <elementType xsi:type="gmfgen:SpecializationType"/> <viewmap xsi:type="gmfgen:InnerClassViewmap" className="MSubNodeSLinkFigure" classBody="
/**
 * @generated
 */
public class MSubNodeSLinkFigure extends org.eclipse.draw2d.PolylineConnection {




	/**
	 * @generated
	 */
	public MSubNodeSLinkFigure() {
		
		setTargetDecoration(createTargetDecoration());
	}

	/**
	 * @generated
	 */
	private org.eclipse.draw2d.RotatableDecoration createTargetDecoration() {
		org.eclipse.draw2d.PolylineDecoration df = new org.eclipse.draw2d.PolylineDecoration();
		return df;
	}




}

"> <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs> </viewmap> <modelFacet xsi:type="gmfgen:FeatureLinkModelFacet"> <metaFeature href="mathModel.genmodel#//mathModel/MSubNodeS/link"/> </modelFacet> </links> <palette> <groups title="mathModel"> <entries xsi:type="gmfgen:ToolEntry" title="MSubNodeD" description="Create new MSubNodeD" genNodes="//@diagram/@topLevelNodes.0" genLinks="//@diagram/@links.0"/> <entries xsi:type="gmfgen:ToolEntry" title="MSubNodeS" description="Create new MSubNodeS" genNodes="//@diagram/@topLevelNodes.1"/> </groups> </palette> <preferencePages xsi:type="gmfgen:GenStandardPreferencePage" iD="com.mjb.es3.diagram.general" name="MathModel Diagram"> <children xsi:type="gmfgen:GenStandardPreferencePage" iD="com.mjb.es3.diagram.appearance" name="Appearance" kind="Appearance"/> <children xsi:type="gmfgen:GenStandardPreferencePage" iD="com.mjb.es3.diagram.connections" name="Connections" kind="Connections"/> <children xsi:type="gmfgen:GenStandardPreferencePage" iD="com.mjb.es3.diagram.printing" name="Printing" kind="Printing"/> <children xsi:type="gmfgen:GenStandardPreferencePage" iD="com.mjb.es3.diagram.rulersAndGrid" name="Rulers And Grid" kind="RulersAndGrid"/> <children xsi:type="gmfgen:GenStandardPreferencePage" iD="com.mjb.es3.diagram.pathmaps" name="Pathmaps" kind="Pathmaps"/> </preferencePages> </diagram> <plugin/> <editor/> <diagramUpdater/> <propertySheet> <tabs xsi:type="gmfgen:GenStandardPropertyTab" iD="appearance"/> <tabs xsi:type="gmfgen:GenStandardPropertyTab" iD="diagram"/> <tabs xsi:type="gmfgen:GenCustomPropertyTab" iD="domain" label="Core"> <filter xsi:type="gmfgen:TypeTabFilter"> <types>org.eclipse.gmf.runtime.notation.View</types> <types>org.eclipse.gef.EditPart</types> </filter> </tabs> </propertySheet> <application> <sharedContributionItems xsi:type="gmfgen:GenActionFactoryContributionItem" name="CLOSE"/> <sharedContributionItems xsi:type="gmfgen:GenActionFactoryContributionItem" name="CLOSE_ALL"/> <sharedContributionItems xsi:type="gmfgen:GenActionFactoryContributionItem" name="SAVE"/> <sharedContributionItems xsi:type="gmfgen:GenActionFactoryContributionItem" name="SAVE_AS"/> <sharedContributionItems xsi:type="gmfgen:GenActionFactoryContributionItem" name="SAVE_ALL"/> <sharedContributionItems xsi:type="gmfgen:GenActionFactoryContributionItem" name="QUIT"/> <sharedContributionItems xsi:type="gmfgen:GenActionFactoryContributionItem" name="UNDO"/> <sharedContributionItems xsi:type="gmfgen:GenActionFactoryContributionItem" name="REDO"/> <sharedContributionItems xsi:type="gmfgen:GenActionFactoryContributionItem" name="CUT"/> <sharedContributionItems xsi:type="gmfgen:GenActionFactoryContributionItem" name="COPY"/> <sharedContributionItems xsi:type="gmfgen:GenActionFactoryContributionItem" name="PASTE"/> <sharedContributionItems xsi:type="gmfgen:GenActionFactoryContributionItem" name="DELETE"/> <sharedContributionItems xsi:type="gmfgen:GenActionFactoryContributionItem" name="SELECT_ALL"/> <sharedContributionItems xsi:type="gmfgen:GenActionFactoryContributionItem" name="OPEN_NEW_WINDOW"/> <sharedContributionItems xsi:type="gmfgen:GenActionFactoryContributionItem" name="PRINT"/> <mainMenu> <items xsi:type="gmfgen:GenMenuManager" iD="org.eclipse.ui.IWorkbenchActionConstants.M_FILE" name="&File"> <items xsi:type="gmfgen:GenGroupMarker" groupName="org.eclipse.ui.IWorkbenchActionConstants.FILE_START"/> <items xsi:type="gmfgen:GenMenuManager" iD=""new"" name="&New"> <items xsi:type="gmfgen:GenGroupMarker" groupName="org.eclipse.ui.IWorkbenchActionConstants.MB_ADDITIONS"/> </items> <items xsi:type="gmfgen:GenSeparator"/> <items xsi:type="gmfgen:GenGroupMarker" groupName="org.eclipse.ui.IWorkbenchActionConstants.MB_ADDITIONS"/> <items xsi:type="gmfgen:GenSeparator"/> <items xsi:type="gmfgen:GenSharedContributionItem" actualItem="//@application/@sharedContributionItems.0"/> <items xsi:type="gmfgen:GenSharedContributionItem" actualItem="//@application/@sharedContributionItems.1"/> <items xsi:type="gmfgen:GenSeparator"/> <items xsi:type="gmfgen:GenSharedContributionItem" actualItem="//@application/@sharedContributionItems.2"/> <items xsi:type="gmfgen:GenSharedContributionItem" actualItem="//@application/@sharedContributionItems.3"/> <items xsi:type="gmfgen:GenSharedContributionItem" actualItem="//@application/@sharedContributionItems.4"/> <items xsi:type="gmfgen:GenSeparator"/> <items xsi:type="gmfgen:GenSharedContributionItem" actualItem="//@application/@sharedContributionItems.5"/> <items xsi:type="gmfgen:GenGroupMarker" groupName="org.eclipse.ui.IWorkbenchActionConstants.FILE_END"/> </items> <items xsi:type="gmfgen:GenMenuManager" iD="org.eclipse.ui.IWorkbenchActionConstants.M_EDIT" name="&Edit"> <items xsi:type="gmfgen:GenGroupMarker" groupName="org.eclipse.ui.IWorkbenchActionConstants.EDIT_START"/> <items xsi:type="gmfgen:GenSharedContributionItem" actualItem="//@application/@sharedContributionItems.6"/> <items xsi:type="gmfgen:GenSharedContributionItem" actualItem="//@application/@sharedContributionItems.7"/> <items xsi:type="gmfgen:GenGroupMarker" groupName="org.eclipse.ui.IWorkbenchActionConstants.UNDO_EXT"/> <items xsi:type="gmfgen:GenSeparator"/> <items xsi:type="gmfgen:GenSharedContributionItem" actualItem="//@application/@sharedContributionItems.8"/> <items xsi:type="gmfgen:GenSharedContributionItem" actualItem="//@application/@sharedContributionItems.9"/> <items xsi:type="gmfgen:GenSharedContributionItem" actualItem="//@application/@sharedContributionItems.10"/> <items xsi:type="gmfgen:GenGroupMarker" groupName="org.eclipse.ui.IWorkbenchActionConstants.CUT_EXT"/> <items xsi:type="gmfgen:GenSeparator"/> <items xsi:type="gmfgen:GenSharedContributionItem" actualItem="//@application/@sharedContributionItems.11"/> <items xsi:type="gmfgen:GenSharedContributionItem" actualItem="//@application/@sharedContributionItems.12"/> <items xsi:type="gmfgen:GenSeparator"/> <items xsi:type="gmfgen:GenGroupMarker" groupName="org.eclipse.ui.IWorkbenchActionConstants.ADD_EXT"/> <items xsi:type="gmfgen:GenGroupMarker" groupName="org.eclipse.ui.IWorkbenchActionConstants.EDIT_END"/> <items xsi:type="gmfgen:GenSeparator" groupName="org.eclipse.ui.IWorkbenchActionConstants.MB_ADDITIONS"/> </items> <items xsi:type="gmfgen:GenGroupMarker" groupName="org.eclipse.ui.IWorkbenchActionConstants.MB_ADDITIONS"/> <items xsi:type="gmfgen:GenMenuManager" iD="org.eclipse.ui.IWorkbenchActionConstants.M_WINDOW" name="&Window"> <items xsi:type="gmfgen:GenSharedContributionItem" actualItem="//@application/@sharedContributionItems.13"/> <items xsi:type="gmfgen:GenGroupMarker" groupName="org.eclipse.ui.IWorkbenchActionConstants.MB_ADDITIONS"/> </items> <items xsi:type="gmfgen:GenMenuManager" iD="org.eclipse.ui.IWorkbenchActionConstants.M_HELP" name="&Help"> <items xsi:type="gmfgen:GenGroupMarker" groupName="org.eclipse.ui.IWorkbenchActionConstants.HELP_START"/> <items xsi:type="gmfgen:GenGroupMarker" groupName="org.eclipse.ui.IWorkbenchActionConstants.HELP_END"/> <items xsi:type="gmfgen:GenGroupMarker" groupName="org.eclipse.ui.IWorkbenchActionConstants.MB_ADDITIONS"/> </items> </mainMenu> <mainToolBar> <items xsi:type="gmfgen:GenGroupMarker" groupName=""group.file""/> <items xsi:type="gmfgen:GenToolBarManager" iD="org.eclipse.ui.IWorkbenchActionConstants.TOOLBAR_FILE"> <items xsi:type="gmfgen:GenSeparator" groupName="org.eclipse.ui.IWorkbenchActionConstants.NEW_GROUP"/> <items xsi:type="gmfgen:GenGroupMarker" groupName="org.eclipse.ui.IWorkbenchActionConstants.NEW_EXT"/> <items xsi:type="gmfgen:GenGroupMarker" groupName="org.eclipse.ui.IWorkbenchActionConstants.SAVE_GROUP"/> <items xsi:type="gmfgen:GenSharedContributionItem" actualItem="//@application/@sharedContributionItems.2"/> <items xsi:type="gmfgen:GenGroupMarker" groupName="org.eclipse.ui.IWorkbenchActionConstants.SAVE_EXT"/> <items xsi:type="gmfgen:GenSharedContributionItem" actualItem="//@application/@sharedContributionItems.14"/> <items xsi:type="gmfgen:GenGroupMarker" groupName="org.eclipse.ui.IWorkbenchActionConstants.PRINT_EXT"/> <items xsi:type="gmfgen:GenSeparator" groupName="org.eclipse.ui.IWorkbenchActionConstants.MB_ADDITIONS"/> </items> <items xsi:type="gmfgen:GenGroupMarker" groupName="org.eclipse.ui.IWorkbenchActionConstants.MB_ADDITIONS"/> <items xsi:type="gmfgen:GenGroupMarker" groupName=""group.nav""/> <items xsi:type="gmfgen:GenGroupMarker" groupName="org.eclipse.ui.IWorkbenchActionConstants.GROUP_EDITOR"/> <items xsi:type="gmfgen:GenGroupMarker" groupName="org.eclipse.ui.IWorkbenchActionConstants.GROUP_HELP"/> <items xsi:type="gmfgen:GenToolBarManager" iD="org.eclipse.ui.IWorkbenchActionConstants.TOOLBAR_HELP"> <items xsi:type="gmfgen:GenSeparator" groupName="org.eclipse.ui.IWorkbenchActionConstants.GROUP_HELP"/> <items xsi:type="gmfgen:GenGroupMarker" groupName="org.eclipse.ui.IWorkbenchActionConstants.GROUP_APP"/> </items> </mainToolBar> </application> <domainGenModel href="mathModel.genmodel#/"/> </gmfgen:GenEditorGenerator> |
Edit Parts Generated
Wizards
If I select the link and click on 'change' I get:
Do I need to change this? If so, how?
Explicit mapping (this works):
Link mapping to super class (This does not work):