From: lempinen Date: Fri, 15 Jun 2012 04:50:09 +0000 (+0000) Subject: Removed dependencies to documentation plugin (refs #3511) X-Git-Tag: simantics-1.7~29 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=36e7322b71ad6766443a5a617aeb8d182b4a5d3e;p=simantics%2Fsysdyn.git Removed dependencies to documentation plugin (refs #3511) git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@25187 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.sysdyn.ui/META-INF/MANIFEST.MF b/org.simantics.sysdyn.ui/META-INF/MANIFEST.MF index ae24f88b..159a3b70 100644 --- a/org.simantics.sysdyn.ui/META-INF/MANIFEST.MF +++ b/org.simantics.sysdyn.ui/META-INF/MANIFEST.MF @@ -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 diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/DiagramViewer.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/DiagramViewer.java index ea7930e5..4a375688 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/DiagramViewer.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/DiagramViewer.java @@ -80,10 +80,12 @@ public class DiagramViewer extends org.simantics.modeling.ui.diagramEditor.Diagr if (isDisposed()) { return; } else { - ElementPainter ep = canvasContext.getSingleItem(ElementPainter.class); - for(IElement e : sourceDiagram.getElements()) { - if(e.getElementClass().getId().contains("Connection")){ - ep.update(e); + if(canvasContext != null && sourceDiagram != null) { + ElementPainter ep = canvasContext.getSingleItem(ElementPainter.class); + for(IElement e : sourceDiagram.getElements()) { + if(e.getElementClass().getId().contains("Connection")){ + ep.update(e); + } } } //scheduleZoomToFit(); diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/manager/SysdynModel.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/manager/SysdynModel.java index 3912a70e..e0750fd5 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/manager/SysdynModel.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/manager/SysdynModel.java @@ -477,14 +477,16 @@ public class SysdynModel implements IMappingListener, IModel { inits.put(prfx + po.getVariable().getName(), po.getExpression()); } } else if (element instanceof IndependentVariable) { - IndependentVariable variable = (IndependentVariable) element; - //FIXME: more general solution for finding out if the variable is a parameter - IExpression expression = variable.getExpressions().getExpressions().get(0); - if (expression instanceof ParameterExpression) { - Double value = ((ParameterExpression)expression).getValue(); - if(value != null) - inits.put(prefix + variable.getName(), "" + value); - } + IndependentVariable variable = (IndependentVariable) element; + //FIXME: more general solution for finding out if the variable is a parameter + if(variable != null && variable.getExpressions() != null && variable.getExpressions().getExpressions() != null && variable.getExpressions().getExpressions().get(0) != null) { + IExpression expression = variable.getExpressions().getExpressions().get(0); + if (expression instanceof ParameterExpression) { + Double value = ((ParameterExpression)expression).getValue(); + if(value != null) + inits.put(prefix + variable.getName(), "" + value); + } + } } } return inits;