]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Removed dependencies to documentation plugin (refs #3511)
authorlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Fri, 15 Jun 2012 04:50:09 +0000 (04:50 +0000)
committerlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Fri, 15 Jun 2012 04:50:09 +0000 (04:50 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@25187 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ui/META-INF/MANIFEST.MF
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/DiagramViewer.java
org.simantics.sysdyn/src/org/simantics/sysdyn/manager/SysdynModel.java

index ae24f88b0c37f7324a4a90a53a3ad1d91960f99d..159a3b70ae04b2a2b898c6e3bf58d903518a458d 100644 (file)
@@ -53,9 +53,7 @@ Require-Bundle: org.simantics.layer0.utils;bundle-version="0.6.2",
  org.simantics.jfreechart.ontology;bundle-version="0.1.0",
  org.eclipse.ui.forms;bundle-version="3.5.2",
  org.simantics.scenegraph.swing;bundle-version="1.0.0",
- org.eclipse.nebula.widgets.tablecombo;bundle-version="1.0.0",
- org.simantics.document.ontology2;bundle-version="1.0.0",
- org.simantics.document.workbench;bundle-version="1.0.0"
+ org.eclipse.nebula.widgets.tablecombo;bundle-version="1.0.0"
 Bundle-Activator: org.simantics.sysdyn.ui.Activator
 Bundle-ActivationPolicy: lazy
 Export-Package: org.simantics.sysdyn.ui.browser.nodes
index ea7930e50d02ca583416492f63780c5fc84cf873..4a37568882697d581a6571fe14a8ebfc2bfb0952 100644 (file)
@@ -80,10 +80,12 @@ public class DiagramViewer extends org.simantics.modeling.ui.diagramEditor.Diagr
                                if (isDisposed())  {\r
                                        return; \r
                                } else {\r
-                                       ElementPainter ep = canvasContext.getSingleItem(ElementPainter.class);\r
-                                       for(IElement e : sourceDiagram.getElements()) {\r
-                                               if(e.getElementClass().getId().contains("Connection")){\r
-                                                       ep.update(e);\r
+                                       if(canvasContext != null && sourceDiagram != null) {\r
+                                               ElementPainter ep = canvasContext.getSingleItem(ElementPainter.class);\r
+                                               for(IElement e : sourceDiagram.getElements()) {\r
+                                                       if(e.getElementClass().getId().contains("Connection")){\r
+                                                               ep.update(e);\r
+                                                       }\r
                                                }\r
                                        }\r
                                        //scheduleZoomToFit();\r
index 3912a70eecd9cfac669eef243e6e3029ec538d33..e0750fd557f8934cc2f439eccfb36f40825f613f 100644 (file)
@@ -477,14 +477,16 @@ public class SysdynModel implements IMappingListener, IModel {
                        inits.put(prfx + po.getVariable().getName(), po.getExpression());\r
                 }\r
             } else if (element instanceof IndependentVariable) {\r
-                IndependentVariable variable = (IndependentVariable) element;\r
-                //FIXME: more general solution for finding out if the variable is a parameter\r
-                IExpression expression = variable.getExpressions().getExpressions().get(0);\r
-                if (expression instanceof ParameterExpression) {\r
-                    Double value = ((ParameterExpression)expression).getValue();\r
-                    if(value != null)\r
-                        inits.put(prefix + variable.getName(), "" + value);\r
-                }\r
+               IndependentVariable variable = (IndependentVariable) element;\r
+               //FIXME: more general solution for finding out if the variable is a parameter\r
+               if(variable != null && variable.getExpressions() != null && variable.getExpressions().getExpressions() != null && variable.getExpressions().getExpressions().get(0) != null) {\r
+                       IExpression expression = variable.getExpressions().getExpressions().get(0);\r
+                       if (expression instanceof ParameterExpression) {\r
+                               Double value = ((ParameterExpression)expression).getValue();\r
+                               if(value != null)\r
+                                       inits.put(prefix + variable.getName(), "" + value);\r
+                       }\r
+               }\r
             }\r
         }\r
         return inits;\r