From: lempinen Date: Tue, 22 Nov 2011 13:35:43 +0000 (+0000) Subject: First implementation of jfreechart charts X-Git-Tag: simantics-1.6~101 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=bbc0593318256b4d59163970285ad8be4bd0a0ba;p=simantics%2Fsysdyn.git First implementation of jfreechart charts git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@23325 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.sysdyn.feature/feature.xml b/org.simantics.sysdyn.feature/feature.xml index 66b609d2..d5e62a54 100644 --- a/org.simantics.sysdyn.feature/feature.xml +++ b/org.simantics.sysdyn.feature/feature.xml @@ -121,4 +121,11 @@ install-size="0" version="0.0.0"/> + + diff --git a/org.simantics.sysdyn.ontology/META-INF/MANIFEST.MF b/org.simantics.sysdyn.ontology/META-INF/MANIFEST.MF index be16f573..c12c356d 100644 --- a/org.simantics.sysdyn.ontology/META-INF/MANIFEST.MF +++ b/org.simantics.sysdyn.ontology/META-INF/MANIFEST.MF @@ -11,7 +11,8 @@ Require-Bundle: org.simantics.layer0, org.simantics.project.ontology;bundle-version="1.0.0", org.simantics.viewpoint.ontology;bundle-version="1.0.0", org.simantics.layer0x.ontology;bundle-version="1.0.0", - org.simantics.issues.ontology;bundle-version="1.1.0" + org.simantics.issues.ontology;bundle-version="1.1.0", + org.simantics.jfreechart.ontology;bundle-version="0.1.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Export-Package: org.simantics.sysdyn Bundle-Vendor: VTT Technical Reserarch Centre of Finland diff --git a/org.simantics.sysdyn.ontology/graph.tg b/org.simantics.sysdyn.ontology/graph.tg index eaa15267..2a414727 100644 Binary files a/org.simantics.sysdyn.ontology/graph.tg and b/org.simantics.sysdyn.ontology/graph.tg differ diff --git a/org.simantics.sysdyn.ontology/graph/ChartAxisAndVariablesViewpoint.pgraph b/org.simantics.sysdyn.ontology/graph/ChartAxisAndVariablesViewpoint.pgraph new file mode 100644 index 00000000..d07ed227 --- /dev/null +++ b/org.simantics.sysdyn.ontology/graph/ChartAxisAndVariablesViewpoint.pgraph @@ -0,0 +1,25 @@ +L0 = +VP = +PROJECT = +MOD = +IMAGE = +COLOR = +ACT = +JFREE = +SYSDYN = + +CBC = SYSDYN.ChartAxisAndVariablesBrowseContext : VP.BrowseContext +CAC = SYSDYN.ChartAxisAndVariablesActionContext : VP.BrowseContext + +CBC.AxisChildRule : VP.ChildRule +CBC.VariableChildRule : VP.ChildRule + +CBC + @VP.customChildRule JFREE.Chart CBC.AxisChildRule + JFREE.Axis : VP.ResourceNodeType + @VP.customChildRule JFREE.Axis CBC.VariableChildRule + JFREE.Series : VP.ResourceNodeType + +CBC + @VP.customLabelRule JFREE.Axis VP.ResourceLabelLabelRule + @VP.customLabelRule JFREE.Series VP.ResourceLabelLabelRule \ No newline at end of file diff --git a/org.simantics.sysdyn.ontology/graph/Sysdyn.pgraph b/org.simantics.sysdyn.ontology/graph/Sysdyn.pgraph index a00b29db..e3ed74d5 100644 --- a/org.simantics.sysdyn.ontology/graph/Sysdyn.pgraph +++ b/org.simantics.sysdyn.ontology/graph/Sysdyn.pgraph @@ -6,6 +6,7 @@ DIA = SIMU = MOD = PROJ = +JFREE = //##################################################################### // Defines ontology and attaches it to SimanticsDomain @@ -371,9 +372,8 @@ SYSDYN.HasParameterFile - none 0 fill 1 + none 0 fill 1 \ No newline at end of file diff --git a/org.simantics.sysdyn.ui/plugin.xml b/org.simantics.sysdyn.ui/plugin.xml index 2eedf70d..dc462d7c 100644 --- a/org.simantics.sysdyn.ui/plugin.xml +++ b/org.simantics.sysdyn.ui/plugin.xml @@ -563,6 +563,22 @@ + + + + + + + + + + @@ -1281,6 +1302,10 @@ class="org.simantics.sysdyn.ui.browser.contributions.Book" preference="2.0"> + + @@ -1445,6 +1470,14 @@ class="org.simantics.sysdyn.ui.browser.contributions.SheetLabeler" preference="2.0"> + + + + @@ -1549,6 +1582,14 @@ class="org.simantics.sysdyn.ui.browser.contributions.SimulationResultImager" preference="2.0"> + + + + @@ -1631,7 +1672,7 @@ diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/ChartImager.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/ChartImager.java new file mode 100644 index 00000000..6cc2a412 --- /dev/null +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/ChartImager.java @@ -0,0 +1,33 @@ +/******************************************************************************* + * Copyright (c) 2007, 2011 Association for Decentralized Information Management in + * Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.sysdyn.ui.browser.contributions; + +import org.eclipse.jface.resource.ImageDescriptor; +import org.simantics.browsing.ui.swt.ImagerContributor; +import org.simantics.db.ReadGraph; +import org.simantics.db.exception.DatabaseException; +import org.simantics.sysdyn.ui.Activator; +import org.simantics.sysdyn.ui.browser.nodes.ChartNode; + +/** + * Provides image for {@link ChartNode} in model browser + * @author Teemu Lempinen + * + */ +public class ChartImager extends ImagerContributor { + + @Override + public ImageDescriptor getDescriptor(ReadGraph graph, ChartNode input) throws DatabaseException { + return ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getResource("icons/chart_organisation.png")); + } + +} diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/ChartLabeler.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/ChartLabeler.java new file mode 100644 index 00000000..55936833 --- /dev/null +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/ChartLabeler.java @@ -0,0 +1,34 @@ +/******************************************************************************* + * Copyright (c) 2007, 2011 Association for Decentralized Information Management in + * Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.sysdyn.ui.browser.contributions; + +import org.simantics.browsing.ui.graph.contributor.labeler.LabelerContributor; +import org.simantics.db.ReadGraph; +import org.simantics.db.exception.DatabaseException; +import org.simantics.layer0.Layer0; +import org.simantics.sysdyn.ui.browser.nodes.ChartNode; + +/** + * Provides label for {@link ChartNode} in model browser + * @author Teemu Lempinen + * + */ +public class ChartLabeler extends LabelerContributor { + + @Override + public String getLabel(ReadGraph graph, ChartNode chart) throws DatabaseException { + String name = graph.getPossibleRelatedValue(chart.data, Layer0.getInstance(graph).HasName); + return name == null ? "Chart (no name)" : name; + } + + +} diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/Charts.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/Charts.java new file mode 100644 index 00000000..766aec6b --- /dev/null +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/Charts.java @@ -0,0 +1,47 @@ +/******************************************************************************* + * Copyright (c) 2007, 2011 Association for Decentralized Information Management in + * Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.sysdyn.ui.browser.contributions; + +import java.util.ArrayList; +import java.util.Collection; + +import org.simantics.browsing.ui.common.node.AbstractNode; +import org.simantics.browsing.ui.graph.contributor.viewpoint.ViewpointContributor; +import org.simantics.db.ReadGraph; +import org.simantics.db.Resource; +import org.simantics.db.common.request.ObjectsWithType; +import org.simantics.db.exception.DatabaseException; +import org.simantics.layer0.Layer0; +import org.simantics.sysdyn.JFreeChartResource; +import org.simantics.sysdyn.ui.browser.nodes.ChartNode; +import org.simantics.sysdyn.ui.browser.nodes.ChartsFolder; + +/** + * Class for creating chart nodes for model browser + * @author Teemu Lempinen + * + */ +public class Charts extends ViewpointContributor { + + @Override + public Collection getContribution(ReadGraph graph, ChartsFolder folder) throws DatabaseException { + ArrayList> result = new ArrayList>(); + for(Resource chart : graph.syncRequest( + new ObjectsWithType(folder.data, + Layer0.getInstance(graph).ConsistsOf, + JFreeChartResource.getInstance(graph).Chart))) { + result.add(new ChartNode(chart)); + } + return result; + } + +} diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/ChartsImager.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/ChartsImager.java new file mode 100644 index 00000000..e51b8e74 --- /dev/null +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/ChartsImager.java @@ -0,0 +1,33 @@ +/******************************************************************************* + * Copyright (c) 2007, 2011 Association for Decentralized Information Management in + * Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.sysdyn.ui.browser.contributions; + +import org.eclipse.jface.resource.ImageDescriptor; +import org.simantics.browsing.ui.swt.ImagerContributor; +import org.simantics.db.ReadGraph; +import org.simantics.db.exception.DatabaseException; +import org.simantics.sysdyn.ui.Activator; +import org.simantics.sysdyn.ui.browser.nodes.ChartsFolder; + +/** + * Provides image for {@link ChartsFolder} in model browser + * @author Teemu Lempinen + * + */ +public class ChartsImager extends ImagerContributor { + + @Override + public ImageDescriptor getDescriptor(ReadGraph graph, ChartsFolder chartNode) throws DatabaseException { + return ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getResource("icons/folder.png")); + } + +} diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/ChartsLabeler.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/ChartsLabeler.java new file mode 100644 index 00000000..fe718b2c --- /dev/null +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/ChartsLabeler.java @@ -0,0 +1,31 @@ +/******************************************************************************* + * Copyright (c) 2007, 2011 Association for Decentralized Information Management in + * Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.sysdyn.ui.browser.contributions; + +import org.simantics.browsing.ui.graph.contributor.labeler.LabelerContributor; +import org.simantics.db.ReadGraph; +import org.simantics.db.exception.DatabaseException; +import org.simantics.sysdyn.ui.browser.nodes.ChartsFolder; + +/** + * Provides label for {@link ChartsFolder} in model browser + * @author Teemu Lempinen + * + */ +public class ChartsLabeler extends LabelerContributor { + + @Override + public String getLabel(ReadGraph graph, ChartsFolder input) throws DatabaseException { + return "Charts"; + } + +} diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/Model.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/Model.java index 1d50d2f1..01c21fb1 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/Model.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/Model.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 Association for Decentralized Information Management in + * Copyright (c) 2010, 2011 Association for Decentralized Information Management in * Industry THTH ry. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -23,12 +23,18 @@ import org.simantics.db.exception.DatabaseException; import org.simantics.db.layer0.variable.Variable; import org.simantics.db.layer0.variable.Variables; import org.simantics.operation.Layer0X; +import org.simantics.sysdyn.ui.browser.nodes.ChartsFolder; import org.simantics.sysdyn.ui.browser.nodes.ConfigurationNode; import org.simantics.sysdyn.ui.browser.nodes.ExperimentsFolder; import org.simantics.sysdyn.ui.browser.nodes.FunctionsFolder; import org.simantics.sysdyn.ui.browser.nodes.ModelNode; import org.simantics.sysdyn.ui.browser.nodes.ModulesNode; +/** + * Provides children for a model in model browser + * @author Teemu Lempinen + * + */ public class Model extends ViewpointContributor { @Override @@ -49,6 +55,7 @@ public class Model extends ViewpointContributor { result.add(new ExperimentsFolder(model.data)); result.add(new ModulesNode(model.data)); result.add(new FunctionsFolder(model.data)); + result.add(new ChartsFolder(model.data)); return result; } diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ChartNode.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ChartNode.java new file mode 100644 index 00000000..a51a9e4c --- /dev/null +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ChartNode.java @@ -0,0 +1,94 @@ +/******************************************************************************* + * Copyright (c) 2007, 2011 Association for Decentralized Information Management in + * Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.sysdyn.ui.browser.nodes; + +import java.util.Iterator; + +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.simantics.browsing.ui.common.node.AbstractNode; +import org.simantics.browsing.ui.common.node.IDropTargetNode; +import org.simantics.databoard.Bindings; +import org.simantics.db.Resource; +import org.simantics.db.WriteGraph; +import org.simantics.db.common.request.SingleObjectWithType; +import org.simantics.db.common.request.WriteRequest; +import org.simantics.db.exception.DatabaseException; +import org.simantics.db.layer0.variable.Variable; +import org.simantics.db.layer0.variable.Variables; +import org.simantics.layer0.Layer0; +import org.simantics.layer0.utils.direct.GraphUtils; +import org.simantics.sysdyn.JFreeChartResource; +import org.simantics.ui.SimanticsUI; + +/** + * Node representing a chart + * @author Teemu Lempinen + * + */ +public class ChartNode extends AbstractNode implements IDropTargetNode { + + public ChartNode(Resource data) { + super(data); + } + + /** + * Add variable to this chart, if the dropped element(s) can be adapted to a {@link Variable} + */ + @Override + public void drop(Object data) { + IStructuredSelection selection = (IStructuredSelection)data; + Iterator iterator = selection.iterator(); + while(iterator.hasNext()) { + Object o = iterator.next(); + if(o instanceof IAdaptable) { + Variable v = (Variable) ((IAdaptable)o).getAdapter(Variable.class); + if(v != null) { + addVariableToChart(v); + } + } + } + } + + + /** + * Adds a variable to this chart + * @param variable + */ + private void addVariableToChart(final Variable variable) { + + SimanticsUI.getSession().asyncRequest(new WriteRequest() { + + @Override + public void perform(WriteGraph graph) throws DatabaseException { + Layer0 l0 = Layer0.getInstance(graph); + JFreeChartResource jfree = JFreeChartResource.getInstance(graph); + + Resource plot = graph.syncRequest(new SingleObjectWithType(data, l0.ConsistsOf, jfree.Plot)); + + Resource dataset = graph.syncRequest(new SingleObjectWithType(plot, l0.ConsistsOf, jfree.Dataset)); //FIXME: Support multiple datasets + + String rvi = Variables.getRVI(graph, variable); + Resource type = l0.String; + Resource literal = graph.newResource(); + graph.claim(literal, l0.InstanceOf, null, type); + graph.claimValue(literal, rvi, Bindings.STRING); + + GraphUtils.create2(graph, jfree.Series, + l0.HasLabel, rvi, + jfree.HasVariableRVI, literal, + l0.PartOf, dataset); + } + }); + } + +} diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ChartsFolder.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ChartsFolder.java new file mode 100644 index 00000000..d75b01ba --- /dev/null +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ChartsFolder.java @@ -0,0 +1,36 @@ +/******************************************************************************* + * Copyright (c) 2007, 2011 Association for Decentralized Information Management in + * Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.sysdyn.ui.browser.nodes; + +import org.simantics.browsing.ui.common.node.AbstractNode; +import org.simantics.db.Resource; + +/** + * Folder containing all sysdyn charts + * @author Teemu Lempinen + * + */ +public class ChartsFolder extends AbstractNode { + + public ChartsFolder(Resource resource) { + super(resource); + } + + @SuppressWarnings("rawtypes") + @Override + public Object getAdapter(Class adapter) { + if(clazz == adapter) // There is no resource for this node.. + return null; + return super.getAdapter(adapter); + } + +} diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/profiles/SimulationPlaybackStyle.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/profiles/SimulationPlaybackStyle.java index 66c36622..91084b6c 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/profiles/SimulationPlaybackStyle.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/profiles/SimulationPlaybackStyle.java @@ -11,7 +11,6 @@ *******************************************************************************/ package org.simantics.sysdyn.ui.elements2.profiles; -//import java.awt.Color; import java.awt.geom.AffineTransform; import java.awt.geom.Rectangle2D; import java.util.ArrayList; @@ -48,15 +47,27 @@ import org.simantics.utils.ui.color.Color; import org.simantics.utils.ui.color.ColorGradient; import org.simantics.utils.ui.color.ColorValue; +/** + * Profile style definition for simulation playback mode. Works only with SimulationPlaybackExperiment + * + * @author Teemu Lempinen + * + */ public class SimulationPlaybackStyle extends StyleBase> { Resource gradientResource; ColorGradient cg; byte[] gradient; + /** + * Determine if style needs to be redrawn and return objects that are needed to redraw the style. + * + * @return All necessary components that are needed to draw this style + */ @Override public Triple calculateStyle(ReadGraph graph, Resource runtimeDiagram, Resource entry, Resource element, Variable configuration) throws DatabaseException { + // Find SimulationPlaybackExperiment IProject project = SimanticsUI.getProject(); IExperimentManager em = project.getHint(IExperimentManager.KEY_EXPERIMENT_MANAGER); IExperiment experiment = em.getActiveExperiment(); @@ -74,6 +85,7 @@ public class SimulationPlaybackStyle extends StyleBase max) max = d; } - + + // Find the index in time and value arrays for this time + // (time steps may vary, we need to loop to find the correct time) int index = 0; if(ta[ta.length - 1] - time > ta[ta.length / 2] ) { index = ta.length - 1; @@ -121,10 +139,14 @@ public class SimulationPlaybackStyle extends StyleBase result) { Double multiplier; if (result != null && (multiplier = result.second) != null && !multiplier.isNaN()) { - + // Create a node that will show the style effect A node = ProfileVariables.claimChild(_node, "", "playbackColour", A.class, observer); if (node == null) return; @@ -174,28 +199,34 @@ public class SimulationPlaybackStyle extends StyleBase T getValue(ReadGraph graph) throws DatabaseException { - Layer0X L0X = Layer0X.getInstance(graph); - SysdynResource sr = SysdynResource.getInstance(graph); - Resource represents = graph.getPossibleObject(resource, L0X.Represents); - if(represents == null) return null; - //FIXME: doesn't support multiple expressions - Resource expressions = graph.getPossibleObject(represents, sr.HasExpressions); - if(expressions == null) return null; - List expressionList = OrderedSetUtils.toList(graph, expressions); - Resource expression = expressionList.get(0); - if(expression == null) return null; - if(!graph.isInstanceOf(expression, sr.ParameterExpression)) return null; - String text = graph.getPossibleRelatedValue(expression, sr.HasEquation); - if(text == null) return null; - Double value = Double.parseDouble(text); - return (T)value; - } - - @Override - public T getValue(ReadGraph graph, Binding binding) throws DatabaseException { - if(!Bindings.DOUBLE.equals(binding)) return null; - return getValue(graph); - } - - @Override - public void setValue(WriteGraph graph, Object object, Binding binding) throws DatabaseException { - Layer0 l0 = Layer0.getInstance(graph); - Layer0X L0X = Layer0X.getInstance(graph); - SysdynResource sr = SysdynResource.getInstance(graph); -// if(!Bindings.DOUBLE.equals(binding)) return; -// if(!MutableDoubleBinding.INSTANCE.equals(binding)) return; - Resource represents = graph.getPossibleObject(resource, L0X.Represents); - if(represents == null) return; - //FIXME: doesn't support multiple expressions - Resource expressions = graph.getPossibleObject(represents, sr.HasExpressions); - if(expressions == null) return; - List expressionList = OrderedSetUtils.toList(graph, expressions); - Resource expression = expressionList.get(0); - if(expression == null) return; - if(!graph.isInstanceOf(expression, sr.ParameterExpression)) return; - graph.claimLiteral(expression, sr.HasEquation, object.toString(), Bindings.STRING); - } - - @SuppressWarnings("unchecked") - @Override - public T getInterface(ReadGraph graph, Class clazz) - throws DatabaseException { - if(Datatype.class.equals(clazz)) return (T)Datatypes.DOUBLE; - return super.getInterface(graph, clazz); - } -} diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/project/HistoryVariable.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/project/HistoryVariable.java deleted file mode 100644 index b7b8539f..00000000 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/project/HistoryVariable.java +++ /dev/null @@ -1,113 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Association for Decentralized Information Management in - * Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.sysdyn.ui.project; - -import java.util.ArrayList; - -import org.simantics.databoard.Accessors; -import org.simantics.databoard.Bindings; -import org.simantics.databoard.accessor.Accessor; -import org.simantics.databoard.accessor.RecordAccessor; -import org.simantics.databoard.accessor.error.AccessorConstructionException; -import org.simantics.databoard.accessor.error.AccessorException; -import org.simantics.databoard.binding.error.RuntimeBindingConstructionException; -import org.simantics.db.ReadGraph; -import org.simantics.db.Resource; -import org.simantics.db.exception.DatabaseException; -import org.simantics.db.layer0.variable.ResourceVariable; -import org.simantics.db.layer0.variable.Variables; -import org.simantics.simulation.ontology.SimulationResource; -import org.simantics.sysdyn.manager.SysdynDataSet; -import org.simantics.sysdyn.manager.SysdynModel; -import org.simantics.sysdyn.manager.SysdynModelManager; -import org.simantics.sysdyn.manager.SysdynResult; - -public class HistoryVariable extends ResourceVariable { - - public HistoryVariable(Resource resource) { - super(resource); - } - -// @Override -// public T getInterface(ReadGraph graph, Class clazz) throws DatabaseException { -// if(Accessor.class.equals(clazz)) { -// -// SimulationResource SIMU = SimulationResource.getInstance(graph); -// Resource model = Variables.getModel(graph, this); -// Resource configuration = graph.getPossibleObject(model, SIMU.HasConfiguration); -// SysdynModel sm = SysdynModelManager.getInstance(graph.getSession()).getModel(graph, configuration); -// SysdynResult sr = sm.getSysdynResult(); -// String rvi = Variables.getRVI(graph, this); -// System.out.println("HistoryVariable rvi='" + rvi + "'"); -// rvi = rvi.substring(1).replace("/", "."); -// SysdynDataSet ds = sr.getDataSet(rvi); -// -// try { -// return (T)Accessors.getAccessor(Bindings.getBindingUnchecked(SysdynDataSet.class), ds); -// } catch (RuntimeBindingConstructionException e) { -// e.printStackTrace(); -// } catch (AccessorConstructionException e) { -// e.printStackTrace(); -// } -// return null; -// -// } -// return super.getInterface(graph, clazz); -// } - - @SuppressWarnings("unchecked") - @Override - public T getInterface(ReadGraph graph, Class clazz) throws DatabaseException { - if(RecordAccessor.class.equals(clazz) || Accessor.class.equals(clazz)) { - SimulationResource SIMU = SimulationResource.getInstance(graph); - Resource model = Variables.getModel(graph, this); - Resource configuration = graph.getPossibleObject(model, SIMU.HasConfiguration); - final SysdynModel sm = SysdynModelManager.getInstance(graph.getSession()).getModel(graph, configuration); - SysdynResult sr = new SysdynResult(sm.getSimulationResult()); // TODO: copy or not to copy ... - - String tmp = Variables.getRVI(graph, this); - System.out.println("HistoryVariable rvi='" + tmp + "'"); - final String rvi = tmp.substring(1).replace("/", "."); - SysdynDataSet ds = sr.getDataSet(rvi); - if(ds == null) ds = new SysdynDataSet("", "", new ArrayList(), new ArrayList()); // We need a dataset, so if not set, create it - try { - final RecordAccessor ac = (RecordAccessor)Accessors.getAccessor(Bindings.getBindingUnchecked(SysdynDataSet.class), ds); - - sm.addResultListener(new Runnable() { // FIXME: remove listener at some point.. - @Override - public void run() { - SysdynResult sr = new SysdynResult(sm.getSimulationResult()); - SysdynDataSet ds = sr.getDataSet(rvi); - if(ds == null) return; - try { - if(ds.result == null) ds.result = ""; - ac.setValue(Bindings.getBindingUnchecked(SysdynDataSet.class), ds); - } catch (RuntimeBindingConstructionException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (AccessorException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - }}); - return (T)ac; - } catch (RuntimeBindingConstructionException e) { - e.printStackTrace(); - } catch (AccessorConstructionException e) { - e.printStackTrace(); - } - return null; - - } - return super.getInterface(graph, clazz); - } -} diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ModelTab.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ModelTab.java deleted file mode 100644 index 77ea180a..00000000 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ModelTab.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Association for Decentralized Information Management in - * Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.sysdyn.ui.properties; - -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.IWorkbenchSite; -import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport; -import org.simantics.db.management.ISessionContext; - -public class ModelTab extends LabelPropertyTabContributor { - - @Override - public void createControls(Composite body, IWorkbenchSite site, ISessionContext context, WidgetSupport support) { - - } -} diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ResourceSelectionProcessor.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ResourceSelectionProcessor.java index c453dd79..d0f4851d 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ResourceSelectionProcessor.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ResourceSelectionProcessor.java @@ -29,263 +29,313 @@ import org.simantics.modeling.ModelingResources; import org.simantics.selectionview.ComparableTabContributor; import org.simantics.selectionview.SelectionProcessor; import org.simantics.simulation.ontology.SimulationResource; +import org.simantics.sysdyn.JFreeChartResource; import org.simantics.sysdyn.SysdynResource; import org.simantics.sysdyn.ui.browser.nodes.SharedFunctionsFolder; +import org.simantics.sysdyn.ui.trend.chart.properties.ChartAxisAndVariablesTab; +import org.simantics.sysdyn.ui.trend.chart.properties.ChartTab; +import org.simantics.sysdyn.ui.trend.chart.properties.GeneralChartPropertiesTab; import org.simantics.ui.utils.AdaptionUtils; +/** + * SelectionProcessor for processing selections for property view in system dynamics + * + * @author Teemu Lempinen + * + */ public class ResourceSelectionProcessor implements SelectionProcessor { - @Override - public Collection process(Object selection, ReadGraph backend) { - Collection tabs = new ArrayList(); - SysdynResource sr = SysdynResource.getInstance(backend); - DiagramResource dr = DiagramResource.getInstance(backend); - ModelingResources mr = ModelingResources.getInstance(backend); - SimulationResource simu = SimulationResource.getInstance(backend); + @Override + public Collection process(Object selection, ReadGraph backend) { + Collection tabs = new ArrayList(); + SysdynResource sr = SysdynResource.getInstance(backend); + DiagramResource dr = DiagramResource.getInstance(backend); + ModelingResources mr = ModelingResources.getInstance(backend); + SimulationResource simu = SimulationResource.getInstance(backend); + JFreeChartResource jfree = JFreeChartResource.getInstance(backend); + + try { + // Many elements + if (selection instanceof ArrayList && ((ArrayList) selection).size() > 1) { + List independentVariables = new ArrayList(); + Resource model = null; + for(Object o : (ArrayList)selection) { + Resource r = AdaptionUtils.adaptToSingle(o, Resource.class); + if(r != null && backend.isInstanceOf(r, sr.IndependentVariable)) { + if(model == null) + model = backend.getSingleObject(r, Layer0.getInstance(backend).PartOf); + if(model.equals( backend.getSingleObject(r, Layer0.getInstance(backend).PartOf))) + independentVariables.add(r); + } + } + + tabs.add(new ComparableTabContributor( + new ArrayIndexesTab(), + 1, + independentVariables, + "Indexes")); + + return tabs; + } + + + // Single element + Resource r = AdaptionUtils.adaptToSingle(selection, Resource.class); + + if(r == null) { + // SharedFunctionsFolder has properties but no adapted resource + SharedFunctionsFolder sff = AdaptionUtils.adaptToSingle(selection, SharedFunctionsFolder.class); + if (sff != null) { + return Collections.singleton(new ComparableTabContributor( + new SharedFunctionLibrariesTab(), + 2, + sff.data, + "Shared Functions")); + } - try { - // Many elements - if (selection instanceof ArrayList && ((ArrayList) selection).size() > 1) { - List independentVariables = new ArrayList(); - Resource model = null; - for(Object o : (ArrayList)selection) { - Resource r = AdaptionUtils.adaptToSingle(o, Resource.class); - if(r != null && backend.isInstanceOf(r, sr.IndependentVariable)) { - if(model == null) - model = backend.getSingleObject(r, Layer0.getInstance(backend).PartOf); - if(model.equals( backend.getSingleObject(r, Layer0.getInstance(backend).PartOf))) - independentVariables.add(r); - } - } + return Collections.emptyList(); + } - tabs.add(new ComparableTabContributor( - new ArrayIndexesTab(), - 1, - independentVariables, - "Indexes")); - - return tabs; - } + // if r == diagram element, change it to component + if (backend.isInstanceOf(r, dr.Element)) { + Resource component = backend.getPossibleObject(r, mr.ElementToComponent); + if (component != null) { + r = component; + } else { + Resource connection = backend.getPossibleObject(r, mr.DiagramConnectionToConnection); + if(connection != null) + r = connection; + } + } + + // Independent variable + if (backend.isInstanceOf(r, sr.IndependentVariable)) { + Resource activeExpression = backend.getPossibleObject(r, sr.HasActiveExpression); + Resource expression = null; + if(activeExpression != null) + // if variable has active expression, display it + expression = activeExpression; + else if (backend.hasStatement(r, sr.HasExpressions)){ + // else display the first expression of the variable + Resource expressions = backend.getPossibleObject(r, sr.HasExpressions); + List expressionList = OrderedSetUtils.toList(backend, expressions); + if(expressionList.isEmpty()) { + System.err.println("expressionList is empty for " + r); + return Collections.emptyList(); + } + expression = expressionList.get(0); + } + tabs.add(new ComparableTabContributor( + new EquationTab(), + 3, + r, + "Equation")); + if(expression != null && backend.isInstanceOf(expression, sr.WithLookupExpression)) { + // WithLookupExpression has its own extra tab for visual configuration + tabs.add(new ComparableTabContributor( + new LookupTableTab(), + 2, + expression, + "Lookup Table")); + } - // Single element - Resource r = AdaptionUtils.adaptToSingle(selection, Resource.class); - - if(r == null) { - SharedFunctionsFolder sff = AdaptionUtils.adaptToSingle(selection, SharedFunctionsFolder.class); - if (sff != null) { - return Collections.singleton(new ComparableTabContributor( - new SharedFunctionLibrariesTab(), - 2, - sff.data, - "Shared Functions")); - } - - return Collections.emptyList(); - } + tabs.add(new ComparableTabContributor( + new ArrayIndexesTab(), + 1, + r, + "Indexes")); + tabs.add(new ComparableTabContributor( + new VariableInformationTab(), + 0, + r, + "Additional Information")); + return tabs; + } + + // Input variable + if (backend.isInstanceOf(r, sr.Input)) { + tabs.add(new ComparableTabContributor( + new InputVariableTab(), + 2, + r, + "Input")); - if (backend.isInstanceOf(r, dr.Element)) { - Resource component = backend.getPossibleObject(r, mr.ElementToComponent); - if (component != null) { - r = component; - } else { - Resource connection = backend.getPossibleObject(r, mr.DiagramConnectionToConnection); - if(connection != null) - r = connection; - } - } - if (backend.isInstanceOf(r, sr.IndependentVariable)) { + tabs.add(new ComparableTabContributor( + new ArrayIndexesTab(), + 1, + r, + "Indexes")); + tabs.add(new ComparableTabContributor( + new VariableInformationTab(), + 0, + r, + "Additional Information")); + return tabs; + } + + // Enumeration + if (backend.isInstanceOf(r, sr.Enumeration)) { + Object s = AdaptionUtils.adaptToSingle(selection, ISelection.class); + if(s == null) + s = r; + // give either variable or the actual resource + return Collections.singleton(new ComparableTabContributor( + new EnumerationTab(), + 2, + s, + "Enumeration")); + } + + // Configuration and model. They both show the properties of the configuration + if ( backend.isInstanceOf(r, sr.Configuration) || backend.isInstanceOf(r, sr.SysdynModel)) { + if(!backend.isInstanceOf(r, sr.SysdynModel)) + r = backend.getPossibleObject(r, SimulationResource.getInstance(backend).IsConfigurationOf); + if (r != null) + return Collections.singleton( + new ComparableTabContributor( + new ConfigurationTab(), + 0, + r, + "Model Properties")); + } + + // Module + if (backend.isInstanceOf(r, sr.Module)){ + tabs.add(new ComparableTabContributor( + new ModuleTab(), + 3, + r, + "Module Properties")); + tabs.add(new ComparableTabContributor( + new ModuleInputTab(), + 2, + r, + "Inputs")); + tabs.add(new ComparableTabContributor( + new ModuleOutputTab(), + 1, + r, + "Outputs")); + return tabs; + } + + // Playback experiment + if (backend.isInstanceOf(r, sr.PlaybackExperiment)) + return Collections.singleton( + new ComparableTabContributor( + new PlaybackExperimentTab(), + 0, + r, + "Experiment Properties")); + + // Default experiment + if (backend.isInstanceOf(r, simu.Experiment)) + return Collections.singleton( + new ComparableTabContributor( + new ExperimentTab(), + 0, + r, + "Experiment Properties")); + + // Saved simulation result + if (backend.isInstanceOf(r, sr.Result)) + return Collections.singleton( + new ComparableTabContributor( + new ResultTab(), + 0, + r, + "Result Properties")); + + // Dependency + if (backend.isInstanceOf(r, sr.Dependency)) + if (backend.hasStatement(r, sr.RefersTo)) + return Collections.singleton( + new ComparableTabContributor( + new ReferenceDependencyTab(), + 0, + r, + "Reference Properties")); + else { + Resource diaConnection = backend.getPossibleObject(r, ModelingResources.getInstance(backend).ConnectionToDiagramConnection); + return Collections.singleton( + new ComparableTabContributor( + new DependencyTab(), + 0, + diaConnection, + "Dependency Properties")); + } + + // Module symbol. Modules in modules-folder are actually symbol resources + if (backend.isInheritedFrom(r, sr.ModuleSymbol)) { + // Find the component resource + r = backend.getPossibleObject(r, mr.SymbolToComponentType); + if(r != null) + return Collections.singleton( + new ComparableTabContributor( + new ModuleTypeTab(), + 0, + r, + "Module Type Properties")); + } - Resource activeExpression = backend.getPossibleObject(r, sr.HasActiveExpression); - Resource expression = null; - if(activeExpression != null) - expression = activeExpression; - else if (backend.hasStatement(r, sr.HasExpressions)){ - Resource expressions = backend.getPossibleObject(r, sr.HasExpressions); - List expressionList = OrderedSetUtils.toList(backend, expressions); - if(expressionList.isEmpty()) { - System.err.println("expressionList is empty for " + r); - return Collections.emptyList(); - } - expression = expressionList.get(0); - } - tabs.add(new ComparableTabContributor( - new EquationTab(), - 3, - r, - "Equation")); - if(expression != null && backend.isInstanceOf(expression, sr.WithLookupExpression)) { - tabs.add(new ComparableTabContributor( - new LookupTableTab(), - 2, - expression, - "Lookup Table")); - } + // Function + if (backend.isInstanceOf(r, sr.SysdynModelicaFunction)) { + tabs.add(new ComparableTabContributor( + new FunctionTab(), + 2, + r, + "Function")); + tabs.add(new ComparableTabContributor( + new ExternalFilesTab(), + 1, + r, + "External files")); + return tabs; + } - tabs.add(new ComparableTabContributor( - new ArrayIndexesTab(), - 1, - r, - "Indexes")); + // Function library + if (backend.isInstanceOf(r, sr.SysdynModelicaFunctionLibrary)) { + Object s = AdaptionUtils.adaptToSingle(selection, ISelection.class); + if(s == null) + s = r; + // give either variable or the actual resource + return Collections.singleton(new ComparableTabContributor( + new FunctionLibraryTab(), + 2, + s, + "Function library")); + } - tabs.add(new ComparableTabContributor( - new VariableInformationTab(), - 0, - r, - "Additional Information")); - return tabs; - } - if (backend.isInstanceOf(r, sr.Input)) { - tabs.add(new ComparableTabContributor( - new InputVariableTab(), - 2, - r, - "Input")); - - tabs.add(new ComparableTabContributor( - new ArrayIndexesTab(), - 1, - r, - "Indexes")); + // Chart + if (backend.isInstanceOf(r, jfree.Chart)) { + tabs.add(new ComparableTabContributor( + new GeneralChartPropertiesTab(), + 10, + r, + "General")); + tabs.add(new ComparableTabContributor( + new ChartAxisAndVariablesTab(), + 9, + r, + "Axis and Variables")); + tabs.add(new ComparableTabContributor( + new ChartTab(), + 1, + r, + "Chart")); + return tabs; + } - tabs.add(new ComparableTabContributor( - new VariableInformationTab(), - 0, - r, - "Additional Information")); - return tabs; - } - if (backend.isInstanceOf(r, sr.Enumeration)) { - Object s = AdaptionUtils.adaptToSingle(selection, ISelection.class); - if(s == null) - s = r; - // give either variable or the actual resource - return Collections.singleton(new ComparableTabContributor( - new EnumerationTab(), - 2, - s, - "Enumeration")); - } - if ( backend.isInstanceOf(r, sr.Configuration) || backend.isInstanceOf(r, sr.SysdynModel)) { - if(!backend.isInstanceOf(r, sr.SysdynModel)) - r = backend.getPossibleObject(r, SimulationResource.getInstance(backend).IsConfigurationOf); - if (r != null) - return Collections.singleton( - new ComparableTabContributor( - new ConfigurationTab(), - 0, - r, - "Model Properties")); - } - if (backend.isInstanceOf(r, sr.Module)){ - tabs.add(new ComparableTabContributor( - new ModuleTab(), - 3, - r, - "Module Properties")); - tabs.add(new ComparableTabContributor( - new ModuleInputTab(), - 2, - r, - "Inputs")); - tabs.add(new ComparableTabContributor( - new ModuleOutputTab(), - 1, - r, - "Outputs")); - return tabs; - } - if (backend.isInstanceOf(r, sr.PlaybackExperiment)) - return Collections.singleton( - new ComparableTabContributor( - new PlaybackExperimentTab(), - 0, - r, - "Experiment Properties")); - if (backend.isInstanceOf(r, simu.Experiment)) - return Collections.singleton( - new ComparableTabContributor( - new ExperimentTab(), - 0, - r, - "Experiment Properties")); - if (backend.isInstanceOf(r, sr.SysdynModel)) - return Collections.singleton( - new ComparableTabContributor( - new ModelTab(), - 0, - r, - "Model Properties")); - if (backend.isInstanceOf(r, sr.Result)) - return Collections.singleton( - new ComparableTabContributor( - new ResultTab(), - 0, - r, - "Result Properties")); - if (backend.isInstanceOf(r, sr.Dependency)) - if (backend.hasStatement(r, sr.RefersTo)) - return Collections.singleton( - new ComparableTabContributor( - new ReferenceDependencyTab(), - 0, - r, - "Reference Properties")); - else { - Resource diaConnection = backend.getPossibleObject(r, ModelingResources.getInstance(backend).ConnectionToDiagramConnection); - return Collections.singleton( - new ComparableTabContributor( - new DependencyTab(), - 0, - diaConnection, - "Dependency Properties")); - } - if (backend.isInheritedFrom(r, sr.ModuleSymbol)) { - r = backend.getPossibleObject(r, mr.SymbolToComponentType); - if(r != null) - return Collections.singleton( - new ComparableTabContributor( - new ModuleTypeTab(), - 0, - r, - "Module Type Properties")); - } - - if (backend.isInstanceOf(r, sr.SysdynModelicaFunction)) { - tabs.add(new ComparableTabContributor( - new FunctionTab(), - 2, - r, - "Function")); - tabs.add(new ComparableTabContributor( - new ExternalFilesTab(), - 1, - r, - "External files")); - return tabs; - } - - if (backend.isInstanceOf(r, sr.SysdynModelicaFunctionLibrary)) { - Object s = AdaptionUtils.adaptToSingle(selection, ISelection.class); - if(s == null) - s = r; - // give either variable or the actual resource - return Collections.singleton(new ComparableTabContributor( - new FunctionLibraryTab(), - 2, - s, - "Function library")); - } - - } catch (ServiceException e) { - e.printStackTrace(); - } catch (ManyObjectsForFunctionalRelationException e) { - e.printStackTrace(); - } catch (DatabaseException e) { - e.printStackTrace(); - } - return Collections.emptyList(); - } + } catch (ServiceException e) { + e.printStackTrace(); + } catch (ManyObjectsForFunctionalRelationException e) { + e.printStackTrace(); + } catch (DatabaseException e) { + e.printStackTrace(); + } + return Collections.emptyList(); + } } diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/trend/ChartPanel.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/trend/ChartPanel.java index 1bf12a70..08a5c629 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/trend/ChartPanel.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/trend/ChartPanel.java @@ -23,8 +23,6 @@ import org.eclipse.swt.dnd.DropTarget; import org.eclipse.swt.dnd.DropTargetAdapter; import org.eclipse.swt.dnd.DropTargetEvent; import org.eclipse.swt.dnd.Transfer; -import org.eclipse.swt.events.MouseAdapter; -import org.eclipse.swt.events.MouseEvent; import org.eclipse.swt.graphics.Point; import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.widgets.Composite; @@ -33,7 +31,13 @@ import org.eclipse.ui.IMemento; import org.eclipse.ui.IViewSite; import org.eclipse.ui.PartInitException; import org.eclipse.ui.part.ViewPart; +import org.simantics.db.ReadGraph; +import org.simantics.db.Resource; +import org.simantics.db.common.request.ReadRequest; +import org.simantics.db.exception.DatabaseException; +import org.simantics.sysdyn.JFreeChartResource; import org.simantics.sysdyn.ui.Activator; +import org.simantics.ui.SimanticsUI; import org.simantics.ui.dnd.LocalObjectTransfer; /** @@ -48,22 +52,19 @@ public class ChartPanel extends ViewPart { private Composite body; private ScrolledComposite sc; - + private IDialogSettings settings; - private ArrayList expandedCharts; - private ArrayList minimizedCharts; - -// private ArrayList elements; -// private ArrayList