]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling/scl/Simantics/Diagram.scl
Support subrelations of DIA.Flag.ConnectionPoint in Diagram.setElements
[simantics/platform.git] / bundles / org.simantics.modeling / scl / Simantics / Diagram.scl
index 14a558bec05c0b549ddd5600e4c3ebec224e6cab..451bda827d64c910d20f328689d72406bc46136a 100644 (file)
@@ -512,10 +512,7 @@ setElements (DiagramInfo diagram configuration componentMap) joinMap elementSpec
         Just connection
     createNode connection (Terminal elementName terminal) = do
         element = newOrMappedElement elementName
         Just connection
     createNode connection (Terminal elementName terminal) = do
         element = newOrMappedElement elementName
-        if terminal == DIA.Flag.ConnectionPoint then
-            createConnector connection element terminal DIA.HasPlainConnector
-        else        
-            createConnector connection element terminal DIA.HasPlainConnector
+        createConnector connection element terminal DIA.HasPlainConnector
     createNode connection (RouteLine isHorizontal position) = do
         newEntity [
             hasName (freshElementName ()),
     createNode connection (RouteLine isHorizontal position) = do
         newEntity [
             hasName (freshElementName ()),
@@ -552,7 +549,7 @@ setElements (DiagramInfo diagram configuration componentMap) joinMap elementSpec
         claim a DIA.AreConnected b
     // Returns (connectionRelation :: Maybe Resource, connector attachment relation :: Resource)  
     resolveAttachmentRelation element terminal defaultAttachmentRelation =
         claim a DIA.AreConnected b
     // Returns (connectionRelation :: Maybe Resource, connector attachment relation :: Resource)  
     resolveAttachmentRelation element terminal defaultAttachmentRelation =
-        if terminal == DIA.Flag.ConnectionPoint then
+        if isSubrelationOf terminal DIA.Flag.ConnectionPoint then
             (Nothing, flagTypeToAttachmentRelation element)
         else
             match possibleObject terminal MOD.DiagramConnectionRelationToConnectionRelation with
             (Nothing, flagTypeToAttachmentRelation element)
         else
             match possibleObject terminal MOD.DiagramConnectionRelationToConnectionRelation with