Dear Archi community,
For a research program I am adding 2 new relationship concepts. The first being a copy of the aggregation relationship went smooth; the second (also a copy of aggregation) gives me an issue. The problem is that the added png figure for the Palette does not show up and using the new relation via the magic connector gives the following error:
!SESSION 2017-09-08 21:33:04.122 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_141
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments: -product com.archimatetool.editor.product
Command-line arguments: -product com.archimatetool.editor.product -data C:\Users\Richard\workspace\neon3/../runtime-archi.product -dev file:C:/Users/Richard/workspace/neon3/.metadata/.plugins/org.eclipse.pde.core/archi.product/dev.properties -os win32 -ws win32 -arch x86 -consoleLog
!ENTRY com.archimatetool.editor 4 0 2017-09-10 14:16:05.996
!MESSAGE Could not create EditPart for: com.archimatetool.model.impl.DiagramModelArchimateConnection@15f56ff (id: c14dbfc3-698c-40dc-981d-12f10c5237c1, name: ) (font: null, fontColor: null, documentation: , lineWidth: 1, lineColor: null, text: , textPosition: 1, type: 0)
!ENTRY org.eclipse.ui 4 0 2017-09-10 14:16:06.337
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.ClassCastException: com.archimatetool.editor.diagram.editparts.diagram.EmptyEditPart cannot be cast to org.eclipse.gef.ConnectionEditPart
at org.eclipse.gef.editparts.AbstractGraphicalEditPart.createConnection(AbstractGraphicalEditPart.java:310)
at org.eclipse.gef.editparts.AbstractGraphicalEditPart.createOrFindConnection(AbstractGraphicalEditPart.java:339)
at org.eclipse.gef.editparts.AbstractGraphicalEditPart.refreshSourceConnections(AbstractGraphicalEditPart.java:696)
.....
Can somebody give me a hint for the location to solve? Thank you.
Kind regards,
Richard
Twitter: @richdijkstra
Hi Richard,
Here's an old set of instructions:
https://www.archimatetool.com/dev/model-new-relation
Edit: way out of date!
Phil
Actually I think that method is way out of date. ???
The UIProvider class should look like this one:
public class MyAggregationRelationshipUIProvider extends AbstractArchimateRelationshipUIProvider {
public EClass providerFor() {
return IArchimatePackage.eINSTANCE.getMyAggregationRelationship();
}
@Override
public EditPart createEditPart() {
return new ArchimateRelationshipEditPart(MyAggregationConnectionFigure.class);
}
@Override
public String getDefaultName() {
return "My Relationship";
}
@Override
public Image getImage() {
return IArchiImages.ImageFactory.getImage(IArchiImages.ICON_MY_AGGREGATION_RELATION);
}
@Override
public ImageDescriptor getImageDescriptor() {
return IArchiImages.ImageFactory.getImageDescriptor(IArchiImages.ICON_MY_AGGREGATION_RELATION);
}
}
And should be registered in the plugin.xml as a objectUIProvider.
Thank you.
In fact the UIProvider class mentioned in the developer resource looks ok to me; at least this is the same structure I got from Github.
I will have a check.
R