]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Deleting symbols and connectors from diagram viewer causes errors 15/2915/1
authorJani Mäkinen <jani.makinen@semantum.fi>
Mon, 3 Jun 2019 09:54:31 +0000 (12:54 +0300)
committerJani Mäkinen <jani.makinen@semantum.fi>
Mon, 3 Jun 2019 09:54:31 +0000 (12:54 +0300)
gitlab #46

Change-Id: Iede73d259885df55dbc577ad44d7d6a188170c66

bundles/org.simantics.sysdyn.ui/adapters.xml
bundles/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/connections/DependencyConnectionFactory.java
bundles/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/connections/DependencyNode.java
bundles/org.simantics.sysdyn/src/org/simantics/sysdyn/manager/SysdynExperiment.java

index 531c4cf91c3ca8e6b6c98468bdd7f4f875767ec5..32864ef31270e82a8b795be058f09c2c9c7ec64d 100644 (file)
                <!-- Edges -->       
         <resource uri="http://www.simantics.org/Sysdyn-0.0/FlowConnection"
             class="org.simantics.sysdyn.ui.elements.connections.RouteFlowEdgeFactory" />
-        <type uri="http://www.simantics.org/Sysdyn-0.0/FlowConnection"
-            class="org.simantics.sysdyn.ui.elements.connections.RouteFlowEdgeFactory" />            
         <type uri="http://www.simantics.org/Sysdyn-0.0/FlowConnection"
             class="org.simantics.sysdyn.ui.elements.connections.RouteFlowConnectionFactory">
             <graph/>
         </type>                        
                        
                <resource uri="http://www.simantics.org/Sysdyn-0.0/DependencyConnection"
-                       class="org.simantics.sysdyn.ui.elements.connections.DependencyEdgeFactory" />
-               <type uri="http://www.simantics.org/Sysdyn-0.0/DependencyConnection"
-                       class="org.simantics.sysdyn.ui.elements.connections.DependencyEdgeFactory" />
-               <type uri="http://www.simantics.org/Sysdyn-0.0/DependencyConnection"
-                       class="org.simantics.sysdyn.ui.elements.connections.DependencyConnectionFactory" />
+         class="org.simantics.sysdyn.ui.elements.connections.DependencyEdgeFactory" />
+                 <type uri="http://www.simantics.org/Sysdyn-0.0/DependencyConnection"
+                 class="org.simantics.sysdyn.ui.elements.connections.DependencyConnectionFactory" />
        </target>
        
        <target interface="org.simantics.g2d.connection.EdgeVisualsConfigurer">
index 6316eec853e9d92adb0c47bb07a802d04efdcba3..2846a51bc6a0f50256c4df8395e3dccad221b6e6 100644 (file)
@@ -264,6 +264,8 @@ public class DependencyConnectionFactory extends ElementFactoryAdapter {
        ModelingResources MO = ModelingResources.getInstance(graph);\r
        Layer0 L0 = Layer0.getInstance(graph);\r
        Resource connection = graph.getPossibleObject(elementResource, MO.DiagramConnectionToConnection);\r
+       if(connection == null) \r
+               return false;\r
        Resource tail = graph.getPossibleObject(connection, SR.Variable_HasTail);\r
        if (tail == null)\r
                return false;\r
index 2bd3a51c15c0a6dd8ae32b671e0430758c7abdb4..0d9314a3ca220d4ebea507fdadebaf80a7beb59f 100644 (file)
@@ -104,6 +104,7 @@ public class DependencyNode extends TextNode implements ISelectionPainterNode, I
 \r
     @Override\r
     public void cleanup() {\r
+       removeEventHandler(this);\r
         super.cleanup();\r
     }\r
 \r
index b8269d4b1ff63e92599bd022139e0fc87f69ee89..59d175e50200f917bd7777f717e65adf16cfb3c8 100644 (file)
@@ -449,5 +449,11 @@ public class SysdynExperiment extends Experiment implements IDynamicExperiment,
                return SolverSettings.getSelectedSolverType();
        }
 
+       @Override
+       public double getSimulationTime() {
+               // TODO Auto-generated method stub
+               return 0;
+       }
+
 }