]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Added proper judgement and connection types to flows that are created automatically
authorlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Fri, 8 Oct 2010 06:46:48 +0000 (06:46 +0000)
committerlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Fri, 8 Oct 2010 06:46:48 +0000 (06:46 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@18323 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/SysdynConnectionAdvisor.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/participant/ConnectTool.java

index 0f562e2fc0a2ead99bd16d505273bff12e97d462..7a64b18a79ea97ef10cadbd1c91d9fd6fdbebb4b 100644 (file)
@@ -96,7 +96,7 @@ public class SysdynConnectionAdvisor  implements IConnectionAdvisor {
                                                modelingRules.judgeConnection(g, cps);                  \r
 \r
                                        if(judgement.type == ConnectionJudgementType.LEGAL)\r
-                                               return judgement.connectionType;\r
+                                               return judgement;\r
                                        else\r
                                                return null;\r
                                }\r
index 408dfc0d7ead19248fe386cec40e532f350d7b73..21ecd463512cc857b6aba0a9d1f9a8efaec39f03 100644 (file)
@@ -243,7 +243,10 @@ public class ConnectTool extends AbstractDiagramParticipant {
                        // TODO: broken.\r
                        connection = ghostDiagram.getMutatedCorrespondence(possibleConnection);\r
                } else {\r
+                       Object connectionType = connection.getHint(ElementHints.KEY_CONNECTION_TYPE);\r
                        connection = createConnection(connectionClass);\r
+                       connection.setHint(ElementHints.KEY_CONNECTION_TYPE, connectionType);\r
+                       \r
                        ghostDiagram.addElement(connection);\r
                }\r
 \r