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
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
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