]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Added remover to remove references from dependency arrows when the referred variables...
authorlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Wed, 21 Nov 2012 13:14:14 +0000 (13:14 +0000)
committerlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Wed, 21 Nov 2012 13:14:14 +0000 (13:14 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@26382 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ui/adapters.xml
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/actions/SysdynVariableRemover.java [new file with mode: 0644]
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/exports/ExportModelHandler.java

index e5efdca79b06230ec916f6bdcd82d05549b03524..d2ce6b7a9ab21a4c23d590ab23d255ae14bfd576 100644 (file)
@@ -10,5 +10,5 @@
         VTT Technical Research Centre of Finland - initial API and implementation\r
  -->\r
 
-<adapters>\r\r   <target interface="org.simantics.db.layer0.adapter.Realization">\r               <type uri="http://www.simantics.org/Sysdyn-0.0/Module"\r                 class="org.simantics.structural2.realization.StructuralRealization">\r                   <this />\r               </type>\r        </target>\r\r     <target interface="org.simantics.layer0.utils.triggers.ITrigger">\r      <type uri = "http://www.simantics.org/Sysdyn-0.0/DiagramToCompositeMapping"\r          class = "org.simantics.sysdyn.ui.editor.DiagramToCompositeMapping3">\r         <graph/>\r           <this />\r       </type>\r        </target>\r      \r       <target interface="org.simantics.structural.ui.modelBrowser.nodes.AbstractNode">\r               <type uri="http://www.simantics.org/Sysdyn-0.0/SysdynModel"\r                    class="org.simantics.structural.ui.modelBrowser.nodes.ModelNode">\r                      <this />\r               </type>\r        </target>               \r               \r\r      <target\r                interface="org.simantics.browsing.ui.common.node.AbstractNode">\r                <type\r                  uri="http://www.simantics.org/Sysdyn-0.0/SysdynModel"\r                  class="org.simantics.sysdyn.ui.browser.nodes.ModelNode">\r                       <this />\r               </type>\r\r               <resource\r                      uri="http://www.simantics.org/Sysdyn-0.0/ModuleSymbol"\r                 class="org.simantics.sysdyn.ui.browser.nodes.SymbolNode">\r                      <this />\r               </resource>\r\r           <type\r                  uri="http://www.simantics.org/Simulation-0.0/Experiment"\r                       class="org.simantics.sysdyn.ui.browser.nodes.ExperimentNode">\r                  <this />\r               </type>\r                \r               <type\r                  uri="http://www.simantics.org/Sysdyn-0.0/Result"\r                       class="org.simantics.sysdyn.ui.browser.nodes.SimulationResultNode">\r                    <this />\r               </type>\r                \r       </target>\r\r     <!-- Inject default connection routing algorithm for sysdyn diagrams -->\r       <target interface="org.simantics.g2d.diagram.DiagramClass">\r            <adapter uri="http://www.simantics.org/Sysdyn-0.0/ConfigurationDiagram"\r                        adapterClass="org.simantics.sysdyn.ui.elements.ConfigurationDiagramClassAdapter" />\r    </target>\r\r     <!-- Sysdyn symbols -->\r        <target interface="org.simantics.diagram.adapter.ElementFactory">\r              <resource uri="http://www.simantics.org/Sysdyn-0.0/StockSymbol"\r                        class="org.simantics.sysdyn.ui.elements.StockFactory" />\r               <resource uri="http://www.simantics.org/Sysdyn-0.0/ModuleSymbol"\r                       class="org.simantics.sysdyn.ui.elements.ModuleFactory" />\r              <resource uri="http://www.simantics.org/Sysdyn-0.0/ValveSymbol"\r                        class="org.simantics.sysdyn.ui.elements.ValveFactory" />\r               <resource uri="http://www.simantics.org/Sysdyn-0.0/AuxiliarySymbol"\r                    class="org.simantics.sysdyn.ui.elements.AuxiliaryFactory" />\r           <resource uri="http://www.simantics.org/Sysdyn-0.0/CloudSymbol"\r                        class="org.simantics.sysdyn.ui.elements.CloudFactory" />\r               <resource uri="http://www.simantics.org/Sysdyn-0.0/InputSymbol"\r                        class="org.simantics.sysdyn.ui.elements.InputFactory" />\r\r              <type uri="http://www.simantics.org/Sysdyn-0.0/StockSymbol"\r                    class="org.simantics.sysdyn.ui.elements.StockFactory" />\r               <type uri="http://www.simantics.org/Sysdyn-0.0/ModuleSymbol"\r                   class="org.simantics.sysdyn.ui.elements.ModuleFactory" />\r              <type uri="http://www.simantics.org/Sysdyn-0.0/ValveSymbol"\r                    class="org.simantics.sysdyn.ui.elements.ValveFactory" />\r               <type uri="http://www.simantics.org/Sysdyn-0.0/AuxiliarySymbol"\r                        class="org.simantics.sysdyn.ui.elements.AuxiliaryFactory" />\r           <type uri="http://www.simantics.org/Sysdyn-0.0/CloudSymbol"\r                    class="org.simantics.sysdyn.ui.elements.CloudFactory" />\r               <type uri="http://www.simantics.org/Sysdyn-0.0/InputSymbol"\r                    class="org.simantics.sysdyn.ui.elements.InputFactory" />                        \r       </target>\r      \r       <!-- Additional symbols -->\r    <target interface="org.simantics.diagram.adapter.ElementFactory">\r          <resource uri="http://www.simantics.org/Sysdyn-0.0/AdditionalSymbols/MultilineText"\r            class="org.simantics.sysdyn.ui.elements.MultilineTextElementFactory" />\r        <type uri="http://www.simantics.org/Sysdyn-0.0/AdditionalSymbols/MultilineText"\r            class="org.simantics.sysdyn.ui.elements.MultilineTextElementFactory" />         \r    </target>                  \r       \r       <!-- Sysdyn connections -->\r    <target interface="org.simantics.diagram.adapter.ElementFactory">\r              <!-- Edges -->       \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/FlowConnection"\r            class="org.simantics.sysdyn.ui.elements.connections.RouteFlowEdgeFactory" />\r        <type uri="http://www.simantics.org/Sysdyn-0.0/FlowConnection"\r            class="org.simantics.sysdyn.ui.elements.connections.RouteFlowEdgeFactory" />            \r        <type uri="http://www.simantics.org/Sysdyn-0.0/FlowConnection"\r            class="org.simantics.sysdyn.ui.elements.connections.RouteFlowConnectionFactory">\r            <graph/>\r        </type>                          \r                       \r               <resource uri="http://www.simantics.org/Sysdyn-0.0/DependencyConnection"\r                       class="org.simantics.sysdyn.ui.elements.connections.DependencyEdgeFactory" />\r          <type uri="http://www.simantics.org/Sysdyn-0.0/DependencyConnection"\r                   class="org.simantics.sysdyn.ui.elements.connections.DependencyEdgeFactory" />\r          <type uri="http://www.simantics.org/Sysdyn-0.0/DependencyConnection"\r                   class="org.simantics.sysdyn.ui.elements.connections.DependencyConnectionFactory" />\r    </target>\r      \r       <target interface="org.simantics.g2d.connection.EdgeVisualsConfigurer">\r          <baseType uri="http://www.simantics.org/Diagram-0.0/HasConnector" />\r   <resource uri="http://www.simantics.org/Diagram-0.0/HasPlainConnector"\r          class="org.simantics.diagram.content.ArrowConfigurer">\r         <string>none 0</string>\r       </resource>\r    <resource uri="http://www.simantics.org/Diagram-0.0/HasArrowConnector"\r          class="org.simantics.diagram.content.ArrowConfigurer">\r         <string>fill 1</string>\r       </resource>\r  </target>\r      \r       <!-- ModelBrowser2 -->\r \r       <target interface="org.simantics.browsing.ui.model.children.ChildRule">\r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/ModuleTypeChildRule"\r            class="org.simantics.sysdyn.ui.browser.childrules.ModuleTypeChildRule"/>\r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/ModuleContentChildRule"\r            class="org.simantics.sysdyn.ui.browser.childrules.ModuleContentChildRule"/>              \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/VariableChildRule"\r            class="org.simantics.sysdyn.ui.browser.childrules.VariableChildRule"/>                  \r              \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ChartAxisAndVariablesBrowseContext/AxisChildRule"\r            class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.AxisChildRule"/>     \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ChartAxisAndVariablesBrowseContext/VariableChildRule"\r            class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.VariableChildRule"/>  \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/BarSeriesBrowseContext/SeriesChildRule"\r            class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesChildRule"/>           \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/PieSeriesBrowseContext/SeriesChildRule"\r            class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesChildRule"/>    \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/HistoryDataset/HistoryDatasetVariablesBrowseContext/VariableChildRule"\r            class="org.simantics.sysdyn.ui.properties.widgets.historyDataset.VariableChildRule"/>     \r        <resource uri=" http://www.simantics.org/Sysdyn-0.0/Module/ParameterOverrideBrowseContext/ParameterChildRule"\r            class="org.simantics.sysdyn.ui.properties.widgets.modules.ParameterChildRule"/>               \r    </target>\r    \r    <target interface="org.simantics.browsing.ui.model.visuals.VisualsRule">\r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/ModuleTypeLabelRule"\r            class="org.simantics.sysdyn.ui.browser.labelrules.ModuleTypeLabelRule"/>\r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/VariableNameLabelRule"\r            class="org.simantics.sysdyn.ui.browser.labelrules.VariableNameLabelRule"/>\r\r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/VariableImageRule"\r            class="org.simantics.sysdyn.ui.browser.imagerules.VariableImageRule"/>   \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/ChartImageRule"\r            class="org.simantics.sysdyn.ui.browser.imagerules.ChartImageRule"/>      \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/ResultImageRule"\r            class="org.simantics.sysdyn.ui.browser.imagerules.ResultImageRule"/>                        \r            \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ChartAxisAndVariablesBrowseContext/SeriesLabelRule"\r            class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesLabelRule"/>         \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ChartAxisAndVariablesBrowseContext/AxisLabelRule"\r            class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.AxisLabelRule"/> \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/BarSeriesBrowseContext/SeriesLabelRule"\r            class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesLabelRule"/>         \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/PieSeriesBrowseContext/SeriesLabelRule"\r            class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesLabelRule"/>   \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/HistoryDataset/HistoryDatasetVariablesBrowseContext/VariableLabelRule"\r            class="org.simantics.sysdyn.ui.properties.widgets.historyDataset.VariableLabelRule"/>                \r                \r                     \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ChartAxisAndVariablesBrowseContext/SeriesLabelDecorationRule"\r            class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesLabelDecorationRule"/>   \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/BarSeriesBrowseContext/SeriesLabelDecorationRule"\r            class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesLabelDecorationRule"/>         \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/PieSeriesBrowseContext/SeriesLabelDecorationRule"\r            class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesLabelDecorationRule"/>     \r            \r        <resource uri=" http://www.simantics.org/Sysdyn-0.0/Module/ParameterOverrideBrowseContext/ParameterLabelRule"\r            class="org.simantics.sysdyn.ui.properties.widgets.modules.ParameterLabelRule"/>    \r        <resource uri=" http://www.simantics.org/Sysdyn-0.0/Module/ParameterOverrideBrowseContext/ParameterLabelDecorationRule"\r            class="org.simantics.sysdyn.ui.properties.widgets.modules.ParameterLabelDecorationRule"/>               \r        <resource uri=" http://www.simantics.org/Sysdyn-0.0/Module/ParameterOverrideBrowseContext/ParameterModifierRule"\r            class="org.simantics.sysdyn.ui.properties.widgets.modules.ParameterModifierRule"/>    \r        <resource uri=" http://www.simantics.org/Sysdyn-0.0/Module/ParameterOverrideBrowseContext/ParameterSorterRule"\r            class="org.simantics.sysdyn.ui.properties.widgets.modules.ParameterSorterRule"/>                                      \r    </target>    \r    \r    <target interface="org.simantics.db.layer0.adapter.ActionFactory">\r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewModuleType"\r            class="org.simantics.sysdyn.ui.browser.actions.newActions.NewModuleTypeAction" />\r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewEnumeration"\r            class="org.simantics.sysdyn.ui.browser.actions.newActions.NewEnumerationAction" />\r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewFunction"\r            class="org.simantics.sysdyn.ui.browser.actions.newActions.NewFunctionAction" />\r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewFunctionLibrary"\r            class="org.simantics.sysdyn.ui.browser.actions.newActions.NewFunctionLibraryAction" />\r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewSharedFunctionLibrary"\r            class="org.simantics.sysdyn.ui.browser.actions.newActions.NewSharedFunctionLibraryAction" />   \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewExperiment"\r            class="org.simantics.sysdyn.ui.browser.actions.newActions.NewExperimentAction" />   \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewSimulationPlaybackExperiment"\r            class="org.simantics.sysdyn.ui.browser.actions.newActions.NewSimulationPlaybackExperimentAction" />    \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewLineChart"\r            class="org.simantics.sysdyn.ui.browser.actions.newActions.NewLineChartAction" /> \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewBarChart"\r            class="org.simantics.sysdyn.ui.browser.actions.newActions.NewBarChartAction" /> \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewPieChart"\r            class="org.simantics.sysdyn.ui.browser.actions.newActions.NewPieChartAction" />        \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewSheet"\r            class="org.simantics.sysdyn.ui.browser.actions.newActions.NewSheetAction" />       \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewHistoryData"\r            class="org.simantics.sysdyn.ui.browser.actions.newActions.NewHistoryDataAction" />                                                                                              \r    </target>         \r    \r   <target interface="org.simantics.db.layer0.adapter.DropActionFactory">\r        <resource\r            uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/FunctionDropAction"\r            class="org.simantics.sysdyn.ui.browser.actions.drop.FunctionDropAction" />\r        <resource\r            uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/ChartDropAction"\r            class="org.simantics.sysdyn.ui.browser.actions.drop.ChartDropAction" />            \r   \r        <resource\r            uri="http://www.simantics.org/Sysdyn-0.0/ChartAxisAndVariablesActionContext/Actions/SeriesDropAction"\r            class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesDropAction" />\r        <resource\r            uri="http://www.simantics.org/Sysdyn-0.0/ChartAxisAndVariablesActionContext/Actions/AxisDropAction"\r            class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.AxisDropAction" />            \r            \r        <resource\r            uri="http://www.simantics.org/Sysdyn-0.0/BarSeriesActionContext/Actions/SeriesDropAction"\r            class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesDropAction" />\r        <resource\r            uri="http://www.simantics.org/Sysdyn-0.0/PieSeriesActionContext/Actions/SeriesDropAction"\r            class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesDropAction" />                        \r    </target>     \r  \r    <target interface="org.simantics.db.layer0.adapter.Remover">\r        <type uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/ModuleSymbol"\r            class="org.simantics.sysdyn.ui.browser.actions.remove.ModuleTypeRemover">\r            <graph />\r            <this />\r        </type>\r    </target>\r    \r    \r    <target interface="org.simantics.browsing.ui.model.nodetypes.NodeType">\r        <baseType uri="http://www.simantics.org/Layer0-0.0/Entity" />\r        <type\r            uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/ModuleSymbolNodeType"\r            class="org.simantics.sysdyn.ui.browser.nodeTypes.ModuleSymbolNodeType"\r            constructor="create">\r            <this/>\r        </type>        \r     </target>\r    \r  <!-- PROFILES -->\r    <target interface="org.simantics.scenegraph.profile.Style">\r        <resource uri="http://www.simantics.org/Sysdyn-0.0/SimulationPlaybackStyle"\r            class="org.simantics.sysdyn.ui.elements.profiles.SimulationPlaybackStyle">\r        </resource>\r                <resource uri="http://www.simantics.org/Sysdyn-0.0/IssueStyle"\r            class="org.simantics.sysdyn.ui.elements.profiles.IssueDecorationStyle">\r        </resource>\r    </target>\r    \r  <!-- Charts -->\r    <target interface="org.simantics.diagram.adapter.ElementFactory">\r        <resource uri="http://www.simantics.org/JFreeChart-0.0/ChartElement"\r            class="org.simantics.sysdyn.ui.trend.chart.element.ChartElementFactory" />\r            \r        <type uri="http://www.simantics.org/JFreeChart-0.0/ChartElement"\r            class="org.simantics.sysdyn.ui.trend.chart.element.ChartElementFactory" />\r    </target>\r                \r    <target interface="org.simantics.diagram.synchronization.graph.ElementWriter">\r        <resource uri="http://www.simantics.org/JFreeChart-0.0/ChartElement"\r            class="org.simantics.sysdyn.ui.trend.chart.element.ChartElementWriter" />\r    </target>\r                    \r    <target interface="org.simantics.sysdyn.ui.trend.chart.IJFreeChart">\r        <type uri="http://www.simantics.org/JFreeChart-0.0/Chart"\r            class="org.simantics.sysdyn.ui.trend.chart.JFreeChart">\r            <graph />\r            <this />\r        </type>\r    </target>  \r    \r    <target interface="org.simantics.sysdyn.ui.trend.chart.IDataset">\r        <type uri="http://www.simantics.org/JFreeChart-0.0/XYDataset"\r            class="org.simantics.sysdyn.ui.trend.chart.XYDataset">\r            <graph />\r            <this />\r        </type>\r        <type uri="http://www.simantics.org/JFreeChart-0.0/CategoryDataset"\r            class="org.simantics.sysdyn.ui.trend.chart.CategoryDataset">\r            <graph />\r            <this />\r        </type>        \r        <type uri="http://www.simantics.org/JFreeChart-0.0/PieDataset"\r            class="org.simantics.sysdyn.ui.trend.chart.PieDataset">\r            <graph />\r            <this />\r        </type>          \r    </target>\r    \r     <target interface="org.simantics.sysdyn.ui.trend.chart.ITitle">\r        <type uri="http://www.simantics.org/JFreeChart-0.0/TextTitle"\r            class="org.simantics.sysdyn.ui.trend.chart.TextTitle">\r            <graph />\r            <this />\r        </type>\r    </target>\r    \r    <target interface="org.simantics.sysdyn.ui.trend.chart.IAxis">\r        <type uri="http://www.simantics.org/JFreeChart-0.0/NumberAxis"\r            class="org.simantics.sysdyn.ui.trend.chart.NumberAxis">\r            <graph />\r            <this />\r        </type>\r        <type uri="http://www.simantics.org/JFreeChart-0.0/CategoryAxis"\r            class="org.simantics.sysdyn.ui.trend.chart.CategoryAxis">\r            <graph />\r            <this />\r        </type>        \r    </target>\r       \r    <target interface="org.simantics.sysdyn.ui.trend.chart.IPlot">\r        <type uri="http://www.simantics.org/JFreeChart-0.0/XYPlot"\r            class="org.simantics.sysdyn.ui.trend.chart.XYPlot">\r            <graph />\r            <this />\r        </type>\r        <type uri="http://www.simantics.org/JFreeChart-0.0/CategoryPlot"\r            class="org.simantics.sysdyn.ui.trend.chart.CategoryPlot">\r            <graph />\r            <this />\r        </type>      \r        <type uri="http://www.simantics.org/JFreeChart-0.0/PiePlot"\r            class="org.simantics.sysdyn.ui.trend.chart.PiePlot">\r            <graph />\r            <this />\r        </type>               \r    </target>\r    \r     <target interface="org.simantics.sysdyn.ui.trend.chart.IRenderer">\r     \r        <type uri="http://www.simantics.org/JFreeChart-0.0/XYLineRenderer"\r            class="org.simantics.sysdyn.ui.trend.chart.XYLineRenderer">\r            <graph />\r            <this />\r        </type>  \r        <type uri="http://www.simantics.org/JFreeChart-0.0/XYAreaRenderer"\r            class="org.simantics.sysdyn.ui.trend.chart.XYAreaRenderer">\r            <graph />\r            <this />\r        </type>        \r                \r        <type uri="http://www.simantics.org/JFreeChart-0.0/BarRenderer"\r            class="org.simantics.sysdyn.ui.trend.chart.BarRenderer">\r            <graph />\r            <this />\r        </type>\r        <type uri="http://www.simantics.org/JFreeChart-0.0/StackedBarRenderer"\r            class="org.simantics.sysdyn.ui.trend.chart.StackedBarRenderer">\r            <graph />\r            <this />\r        </type>        \r    </target>    \r       \r
+<adapters>\r\r   <target interface="org.simantics.db.layer0.adapter.Realization">\r               <type uri="http://www.simantics.org/Sysdyn-0.0/Module"\r                 class="org.simantics.structural2.realization.StructuralRealization">\r                   <this />\r               </type>\r        </target>\r\r     <target interface="org.simantics.layer0.utils.triggers.ITrigger">\r      <type uri = "http://www.simantics.org/Sysdyn-0.0/DiagramToCompositeMapping"\r          class = "org.simantics.sysdyn.ui.editor.DiagramToCompositeMapping3">\r         <graph/>\r           <this />\r       </type>\r        </target>\r      \r       <target interface="org.simantics.structural.ui.modelBrowser.nodes.AbstractNode">\r               <type uri="http://www.simantics.org/Sysdyn-0.0/SysdynModel"\r                    class="org.simantics.structural.ui.modelBrowser.nodes.ModelNode">\r                      <this />\r               </type>\r        </target>               \r               \r\r      <target\r                interface="org.simantics.browsing.ui.common.node.AbstractNode">\r                <type\r                  uri="http://www.simantics.org/Sysdyn-0.0/SysdynModel"\r                  class="org.simantics.sysdyn.ui.browser.nodes.ModelNode">\r                       <this />\r               </type>\r\r               <resource\r                      uri="http://www.simantics.org/Sysdyn-0.0/ModuleSymbol"\r                 class="org.simantics.sysdyn.ui.browser.nodes.SymbolNode">\r                      <this />\r               </resource>\r\r           <type\r                  uri="http://www.simantics.org/Simulation-0.0/Experiment"\r                       class="org.simantics.sysdyn.ui.browser.nodes.ExperimentNode">\r                  <this />\r               </type>\r                \r               <type\r                  uri="http://www.simantics.org/Sysdyn-0.0/Result"\r                       class="org.simantics.sysdyn.ui.browser.nodes.SimulationResultNode">\r                    <this />\r               </type>\r                \r       </target>\r\r     <!-- Inject default connection routing algorithm for sysdyn diagrams -->\r       <target interface="org.simantics.g2d.diagram.DiagramClass">\r            <adapter uri="http://www.simantics.org/Sysdyn-0.0/ConfigurationDiagram"\r                        adapterClass="org.simantics.sysdyn.ui.elements.ConfigurationDiagramClassAdapter" />\r    </target>\r\r     <!-- Sysdyn symbols -->\r        <target interface="org.simantics.diagram.adapter.ElementFactory">\r              <resource uri="http://www.simantics.org/Sysdyn-0.0/StockSymbol"\r                        class="org.simantics.sysdyn.ui.elements.StockFactory" />\r               <resource uri="http://www.simantics.org/Sysdyn-0.0/ModuleSymbol"\r                       class="org.simantics.sysdyn.ui.elements.ModuleFactory" />\r              <resource uri="http://www.simantics.org/Sysdyn-0.0/ValveSymbol"\r                        class="org.simantics.sysdyn.ui.elements.ValveFactory" />\r               <resource uri="http://www.simantics.org/Sysdyn-0.0/AuxiliarySymbol"\r                    class="org.simantics.sysdyn.ui.elements.AuxiliaryFactory" />\r           <resource uri="http://www.simantics.org/Sysdyn-0.0/CloudSymbol"\r                        class="org.simantics.sysdyn.ui.elements.CloudFactory" />\r               <resource uri="http://www.simantics.org/Sysdyn-0.0/InputSymbol"\r                        class="org.simantics.sysdyn.ui.elements.InputFactory" />\r\r              <type uri="http://www.simantics.org/Sysdyn-0.0/StockSymbol"\r                    class="org.simantics.sysdyn.ui.elements.StockFactory" />\r               <type uri="http://www.simantics.org/Sysdyn-0.0/ModuleSymbol"\r                   class="org.simantics.sysdyn.ui.elements.ModuleFactory" />\r              <type uri="http://www.simantics.org/Sysdyn-0.0/ValveSymbol"\r                    class="org.simantics.sysdyn.ui.elements.ValveFactory" />\r               <type uri="http://www.simantics.org/Sysdyn-0.0/AuxiliarySymbol"\r                        class="org.simantics.sysdyn.ui.elements.AuxiliaryFactory" />\r           <type uri="http://www.simantics.org/Sysdyn-0.0/CloudSymbol"\r                    class="org.simantics.sysdyn.ui.elements.CloudFactory" />\r               <type uri="http://www.simantics.org/Sysdyn-0.0/InputSymbol"\r                    class="org.simantics.sysdyn.ui.elements.InputFactory" />                        \r       </target>\r      \r       <!-- Additional symbols -->\r    <target interface="org.simantics.diagram.adapter.ElementFactory">\r          <resource uri="http://www.simantics.org/Sysdyn-0.0/AdditionalSymbols/MultilineText"\r            class="org.simantics.sysdyn.ui.elements.MultilineTextElementFactory" />\r        <type uri="http://www.simantics.org/Sysdyn-0.0/AdditionalSymbols/MultilineText"\r            class="org.simantics.sysdyn.ui.elements.MultilineTextElementFactory" />         \r    </target>                  \r       \r       <!-- Sysdyn connections -->\r    <target interface="org.simantics.diagram.adapter.ElementFactory">\r              <!-- Edges -->       \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/FlowConnection"\r            class="org.simantics.sysdyn.ui.elements.connections.RouteFlowEdgeFactory" />\r        <type uri="http://www.simantics.org/Sysdyn-0.0/FlowConnection"\r            class="org.simantics.sysdyn.ui.elements.connections.RouteFlowEdgeFactory" />            \r        <type uri="http://www.simantics.org/Sysdyn-0.0/FlowConnection"\r            class="org.simantics.sysdyn.ui.elements.connections.RouteFlowConnectionFactory">\r            <graph/>\r        </type>                          \r                       \r               <resource uri="http://www.simantics.org/Sysdyn-0.0/DependencyConnection"\r                       class="org.simantics.sysdyn.ui.elements.connections.DependencyEdgeFactory" />\r          <type uri="http://www.simantics.org/Sysdyn-0.0/DependencyConnection"\r                   class="org.simantics.sysdyn.ui.elements.connections.DependencyEdgeFactory" />\r          <type uri="http://www.simantics.org/Sysdyn-0.0/DependencyConnection"\r                   class="org.simantics.sysdyn.ui.elements.connections.DependencyConnectionFactory" />\r    </target>\r      \r       <target interface="org.simantics.g2d.connection.EdgeVisualsConfigurer">\r          <baseType uri="http://www.simantics.org/Diagram-0.0/HasConnector" />\r   <resource uri="http://www.simantics.org/Diagram-0.0/HasPlainConnector"\r          class="org.simantics.diagram.content.ArrowConfigurer">\r         <string>none 0</string>\r       </resource>\r    <resource uri="http://www.simantics.org/Diagram-0.0/HasArrowConnector"\r          class="org.simantics.diagram.content.ArrowConfigurer">\r         <string>fill 1</string>\r       </resource>\r  </target>\r      \r       <!-- ModelBrowser2 -->\r \r       <target interface="org.simantics.browsing.ui.model.children.ChildRule">\r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/ModuleTypeChildRule"\r            class="org.simantics.sysdyn.ui.browser.childrules.ModuleTypeChildRule"/>\r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/ModuleContentChildRule"\r            class="org.simantics.sysdyn.ui.browser.childrules.ModuleContentChildRule"/>              \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/VariableChildRule"\r            class="org.simantics.sysdyn.ui.browser.childrules.VariableChildRule"/>                  \r              \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ChartAxisAndVariablesBrowseContext/AxisChildRule"\r            class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.AxisChildRule"/>     \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ChartAxisAndVariablesBrowseContext/VariableChildRule"\r            class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.VariableChildRule"/>  \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/BarSeriesBrowseContext/SeriesChildRule"\r            class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesChildRule"/>           \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/PieSeriesBrowseContext/SeriesChildRule"\r            class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesChildRule"/>    \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/HistoryDataset/HistoryDatasetVariablesBrowseContext/VariableChildRule"\r            class="org.simantics.sysdyn.ui.properties.widgets.historyDataset.VariableChildRule"/>     \r        <resource uri=" http://www.simantics.org/Sysdyn-0.0/Module/ParameterOverrideBrowseContext/ParameterChildRule"\r            class="org.simantics.sysdyn.ui.properties.widgets.modules.ParameterChildRule"/>               \r    </target>\r    \r    <target interface="org.simantics.browsing.ui.model.visuals.VisualsRule">\r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/ModuleTypeLabelRule"\r            class="org.simantics.sysdyn.ui.browser.labelrules.ModuleTypeLabelRule"/>\r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/VariableNameLabelRule"\r            class="org.simantics.sysdyn.ui.browser.labelrules.VariableNameLabelRule"/>\r\r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/VariableImageRule"\r            class="org.simantics.sysdyn.ui.browser.imagerules.VariableImageRule"/>   \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/ChartImageRule"\r            class="org.simantics.sysdyn.ui.browser.imagerules.ChartImageRule"/>      \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/ResultImageRule"\r            class="org.simantics.sysdyn.ui.browser.imagerules.ResultImageRule"/>                        \r            \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ChartAxisAndVariablesBrowseContext/SeriesLabelRule"\r            class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesLabelRule"/>         \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ChartAxisAndVariablesBrowseContext/AxisLabelRule"\r            class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.AxisLabelRule"/> \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/BarSeriesBrowseContext/SeriesLabelRule"\r            class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesLabelRule"/>         \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/PieSeriesBrowseContext/SeriesLabelRule"\r            class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesLabelRule"/>   \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/HistoryDataset/HistoryDatasetVariablesBrowseContext/VariableLabelRule"\r            class="org.simantics.sysdyn.ui.properties.widgets.historyDataset.VariableLabelRule"/>                \r                \r                     \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ChartAxisAndVariablesBrowseContext/SeriesLabelDecorationRule"\r            class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesLabelDecorationRule"/>   \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/BarSeriesBrowseContext/SeriesLabelDecorationRule"\r            class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesLabelDecorationRule"/>         \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/PieSeriesBrowseContext/SeriesLabelDecorationRule"\r            class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesLabelDecorationRule"/>     \r            \r        <resource uri=" http://www.simantics.org/Sysdyn-0.0/Module/ParameterOverrideBrowseContext/ParameterLabelRule"\r            class="org.simantics.sysdyn.ui.properties.widgets.modules.ParameterLabelRule"/>    \r        <resource uri=" http://www.simantics.org/Sysdyn-0.0/Module/ParameterOverrideBrowseContext/ParameterLabelDecorationRule"\r            class="org.simantics.sysdyn.ui.properties.widgets.modules.ParameterLabelDecorationRule"/>               \r        <resource uri=" http://www.simantics.org/Sysdyn-0.0/Module/ParameterOverrideBrowseContext/ParameterModifierRule"\r            class="org.simantics.sysdyn.ui.properties.widgets.modules.ParameterModifierRule"/>    \r        <resource uri=" http://www.simantics.org/Sysdyn-0.0/Module/ParameterOverrideBrowseContext/ParameterSorterRule"\r            class="org.simantics.sysdyn.ui.properties.widgets.modules.ParameterSorterRule"/>                                      \r    </target>    \r    \r    <target interface="org.simantics.db.layer0.adapter.ActionFactory">\r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewModuleType"\r            class="org.simantics.sysdyn.ui.browser.actions.newActions.NewModuleTypeAction" />\r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewEnumeration"\r            class="org.simantics.sysdyn.ui.browser.actions.newActions.NewEnumerationAction" />\r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewFunction"\r            class="org.simantics.sysdyn.ui.browser.actions.newActions.NewFunctionAction" />\r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewFunctionLibrary"\r            class="org.simantics.sysdyn.ui.browser.actions.newActions.NewFunctionLibraryAction" />\r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewSharedFunctionLibrary"\r            class="org.simantics.sysdyn.ui.browser.actions.newActions.NewSharedFunctionLibraryAction" />   \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewExperiment"\r            class="org.simantics.sysdyn.ui.browser.actions.newActions.NewExperimentAction" />   \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewSimulationPlaybackExperiment"\r            class="org.simantics.sysdyn.ui.browser.actions.newActions.NewSimulationPlaybackExperimentAction" />    \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewLineChart"\r            class="org.simantics.sysdyn.ui.browser.actions.newActions.NewLineChartAction" /> \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewBarChart"\r            class="org.simantics.sysdyn.ui.browser.actions.newActions.NewBarChartAction" /> \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewPieChart"\r            class="org.simantics.sysdyn.ui.browser.actions.newActions.NewPieChartAction" />        \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewSheet"\r            class="org.simantics.sysdyn.ui.browser.actions.newActions.NewSheetAction" />       \r        <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewHistoryData"\r            class="org.simantics.sysdyn.ui.browser.actions.newActions.NewHistoryDataAction" />                                                                                              \r    </target>         \r    \r   <target interface="org.simantics.db.layer0.adapter.DropActionFactory">\r        <resource\r            uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/FunctionDropAction"\r            class="org.simantics.sysdyn.ui.browser.actions.drop.FunctionDropAction" />\r        <resource\r            uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/ChartDropAction"\r            class="org.simantics.sysdyn.ui.browser.actions.drop.ChartDropAction" />            \r   \r        <resource\r            uri="http://www.simantics.org/Sysdyn-0.0/ChartAxisAndVariablesActionContext/Actions/SeriesDropAction"\r            class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesDropAction" />\r        <resource\r            uri="http://www.simantics.org/Sysdyn-0.0/ChartAxisAndVariablesActionContext/Actions/AxisDropAction"\r            class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.AxisDropAction" />            \r            \r        <resource\r            uri="http://www.simantics.org/Sysdyn-0.0/BarSeriesActionContext/Actions/SeriesDropAction"\r            class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesDropAction" />\r        <resource\r            uri="http://www.simantics.org/Sysdyn-0.0/PieSeriesActionContext/Actions/SeriesDropAction"\r            class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesDropAction" />                        \r    </target>     \r  \r    <target interface="org.simantics.db.layer0.adapter.Remover">\r        <type uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/ModuleSymbol"\r            class="org.simantics.sysdyn.ui.browser.actions.remove.ModuleTypeRemover">\r            <graph />\r            <this />\r        </type>\r        <type uri="http://www.simantics.org/Sysdyn-0.0/Variable"\r            class="org.simantics.sysdyn.ui.actions.SysdynVariableRemover">\r            <this />\r        </type>\r    </target>\r    \r    \r    <target interface="org.simantics.browsing.ui.model.nodetypes.NodeType">\r        <baseType uri="http://www.simantics.org/Layer0-0.0/Entity" />\r        <type\r            uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/ModuleSymbolNodeType"\r            class="org.simantics.sysdyn.ui.browser.nodeTypes.ModuleSymbolNodeType"\r            constructor="create">\r            <this/>\r        </type>        \r     </target>\r    \r  <!-- PROFILES -->\r    <target interface="org.simantics.scenegraph.profile.Style">\r        <resource uri="http://www.simantics.org/Sysdyn-0.0/SimulationPlaybackStyle"\r            class="org.simantics.sysdyn.ui.elements.profiles.SimulationPlaybackStyle">\r        </resource>\r                <resource uri="http://www.simantics.org/Sysdyn-0.0/IssueStyle"\r            class="org.simantics.sysdyn.ui.elements.profiles.IssueDecorationStyle">\r        </resource>\r    </target>\r    \r  <!-- Charts -->\r    <target interface="org.simantics.diagram.adapter.ElementFactory">\r        <resource uri="http://www.simantics.org/JFreeChart-0.0/ChartElement"\r            class="org.simantics.sysdyn.ui.trend.chart.element.ChartElementFactory" />\r            \r        <type uri="http://www.simantics.org/JFreeChart-0.0/ChartElement"\r            class="org.simantics.sysdyn.ui.trend.chart.element.ChartElementFactory" />\r    </target>\r                \r    <target interface="org.simantics.diagram.synchronization.graph.ElementWriter">\r        <resource uri="http://www.simantics.org/JFreeChart-0.0/ChartElement"\r            class="org.simantics.sysdyn.ui.trend.chart.element.ChartElementWriter" />\r    </target>\r                    \r    <target interface="org.simantics.sysdyn.ui.trend.chart.IJFreeChart">\r        <type uri="http://www.simantics.org/JFreeChart-0.0/Chart"\r            class="org.simantics.sysdyn.ui.trend.chart.JFreeChart">\r            <graph />\r            <this />\r        </type>\r    </target>  \r    \r    <target interface="org.simantics.sysdyn.ui.trend.chart.IDataset">\r        <type uri="http://www.simantics.org/JFreeChart-0.0/XYDataset"\r            class="org.simantics.sysdyn.ui.trend.chart.XYDataset">\r            <graph />\r            <this />\r        </type>\r        <type uri="http://www.simantics.org/JFreeChart-0.0/CategoryDataset"\r            class="org.simantics.sysdyn.ui.trend.chart.CategoryDataset">\r            <graph />\r            <this />\r        </type>        \r        <type uri="http://www.simantics.org/JFreeChart-0.0/PieDataset"\r            class="org.simantics.sysdyn.ui.trend.chart.PieDataset">\r            <graph />\r            <this />\r        </type>          \r    </target>\r    \r     <target interface="org.simantics.sysdyn.ui.trend.chart.ITitle">\r        <type uri="http://www.simantics.org/JFreeChart-0.0/TextTitle"\r            class="org.simantics.sysdyn.ui.trend.chart.TextTitle">\r            <graph />\r            <this />\r        </type>\r    </target>\r    \r    <target interface="org.simantics.sysdyn.ui.trend.chart.IAxis">\r        <type uri="http://www.simantics.org/JFreeChart-0.0/NumberAxis"\r            class="org.simantics.sysdyn.ui.trend.chart.NumberAxis">\r            <graph />\r            <this />\r        </type>\r        <type uri="http://www.simantics.org/JFreeChart-0.0/CategoryAxis"\r            class="org.simantics.sysdyn.ui.trend.chart.CategoryAxis">\r            <graph />\r            <this />\r        </type>        \r    </target>\r       \r    <target interface="org.simantics.sysdyn.ui.trend.chart.IPlot">\r        <type uri="http://www.simantics.org/JFreeChart-0.0/XYPlot"\r            class="org.simantics.sysdyn.ui.trend.chart.XYPlot">\r            <graph />\r            <this />\r        </type>\r        <type uri="http://www.simantics.org/JFreeChart-0.0/CategoryPlot"\r            class="org.simantics.sysdyn.ui.trend.chart.CategoryPlot">\r            <graph />\r            <this />\r        </type>      \r        <type uri="http://www.simantics.org/JFreeChart-0.0/PiePlot"\r            class="org.simantics.sysdyn.ui.trend.chart.PiePlot">\r            <graph />\r            <this />\r        </type>               \r    </target>\r    \r     <target interface="org.simantics.sysdyn.ui.trend.chart.IRenderer">\r     \r        <type uri="http://www.simantics.org/JFreeChart-0.0/XYLineRenderer"\r            class="org.simantics.sysdyn.ui.trend.chart.XYLineRenderer">\r            <graph />\r            <this />\r        </type>  \r        <type uri="http://www.simantics.org/JFreeChart-0.0/XYAreaRenderer"\r            class="org.simantics.sysdyn.ui.trend.chart.XYAreaRenderer">\r            <graph />\r            <this />\r        </type>        \r                \r        <type uri="http://www.simantics.org/JFreeChart-0.0/BarRenderer"\r            class="org.simantics.sysdyn.ui.trend.chart.BarRenderer">\r            <graph />\r            <this />\r        </type>\r        <type uri="http://www.simantics.org/JFreeChart-0.0/StackedBarRenderer"\r            class="org.simantics.sysdyn.ui.trend.chart.StackedBarRenderer">\r            <graph />\r            <this />\r        </type>        \r    </target>    \r       \r
 </adapters>
\ No newline at end of file
diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/actions/SysdynVariableRemover.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/actions/SysdynVariableRemover.java
new file mode 100644 (file)
index 0000000..e4769c2
--- /dev/null
@@ -0,0 +1,97 @@
+package org.simantics.sysdyn.ui.actions;\r
+\r
+import java.util.Map;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.Statement;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.common.request.ObjectsWithSupertype;\r
+import org.simantics.db.common.request.ObjectsWithType;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.adapter.Instances;\r
+import org.simantics.db.layer0.adapter.Remover;\r
+import org.simantics.db.layer0.adapter.impl.EntityRemover;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.project.ontology.ProjectResource;\r
+import org.simantics.simulation.ontology.SimulationResource;\r
+import org.simantics.structural.stubs.StructuralResource2;\r
+import org.simantics.sysdyn.SysdynResource;\r
+\r
+/**\r
+ * Remover for sysdyn variables. The main purpose is to take care that input and output references\r
+ * are removed \r
+ * @author Teemu Lempinen\r
+ *\r
+ */\r
+public class SysdynVariableRemover implements Remover {\r
+    \r
+    private Resource resource;\r
+     \r
+    public SysdynVariableRemover(Resource resource) {\r
+        this.resource = resource;\r
+    }\r
+\r
+    @Override\r
+    public String canRemove(ReadGraph graph, Map<Object, Object> aux) throws DatabaseException {\r
+        return null;\r
+    }\r
+\r
+    @Override\r
+    public void remove(WriteGraph graph) throws DatabaseException {\r
+        SysdynResource SR = SysdynResource.getInstance(graph);\r
+        if(graph.hasStatement(resource, SR.IsOutput) || graph.isInstanceOf(resource, SR.Input)) {\r
+            Layer0 L0 = Layer0.getInstance(graph);\r
+            ProjectResource PROJ = ProjectResource.getInstance(graph);\r
+            Resource configuration = graph.getPossibleObject(resource, L0.PartOf);\r
+            Resource moduleType =  graph.getPossibleObject(configuration, L0.PartOf);\r
+            if(graph.isInheritedFrom(moduleType, SR.Module)) {\r
+                Resource project = moduleType;\r
+                do {\r
+                    project = graph.getPossibleObject(project, L0.PartOf);\r
+                } while (project != null && !graph.isInstanceOf(project, PROJ.Project));\r
+\r
+                if(project != null) {\r
+                    for(Resource model : graph.syncRequest(new ObjectsWithType(project, L0.ConsistsOf, SR.SysdynModel))) {\r
+                        removeOutputReferencesFromModel(graph, model, resource, moduleType);\r
+                    }\r
+                }\r
+\r
+            }\r
+        }\r
+        EntityRemover.remove(graph, resource);\r
+    }\r
+\r
+    private void removeOutputReferencesFromModel(WriteGraph graph, Resource model, Resource reference, Resource moduleType) throws DatabaseException {\r
+        SysdynResource SR = SysdynResource.getInstance(graph);\r
+        StructuralResource2 SR2 = StructuralResource2.getInstance(graph);\r
+        Layer0 L0 = Layer0.getInstance(graph);\r
+        \r
+        Instances moduleInstanceFinder = graph.adapt(moduleType, Instances.class);\r
+        \r
+        denyReferences(graph, moduleInstanceFinder, graph.getPossibleObject(model, SimulationResource.getInstance(graph).HasConfiguration), reference);\r
+        \r
+        for(Resource type : graph.syncRequest(new ObjectsWithSupertype(model, L0.ConsistsOf, SR.Module))) {\r
+            Resource configuration = graph.getPossibleObject(type, SR2.IsDefinedBy);\r
+            denyReferences(graph, moduleInstanceFinder, configuration, reference);\r
+\r
+        }\r
+        \r
+    }\r
+    \r
+    private void denyReferences(WriteGraph graph, Instances moduleInstanceFinder, Resource indexRoot, Resource reference) throws DatabaseException {\r
+        StructuralResource2 SR2 = StructuralResource2.getInstance(graph);\r
+        SysdynResource SR = SysdynResource.getInstance(graph);\r
+\r
+        for(Resource module : moduleInstanceFinder.find(graph, indexRoot)) {\r
+            for(Statement stm : graph.getStatements(module, SR2.IsConnectedTo)) {\r
+                Resource connection = stm.getObject();\r
+                Resource ref = graph.getPossibleObject(connection, SR.Dependency_refersTo);\r
+                if(ref != null && ref.equals(reference)) {\r
+                    graph.deny(connection, SR.Dependency_refersTo);\r
+                }\r
+            }\r
+        }\r
+    }\r
+\r
+}\r
index 7434b851460e7fa9481e09b83aed068e5796874c..f67d85940c647c7781d922c67c11756876f078da 100644 (file)
@@ -12,8 +12,6 @@
 package org.simantics.sysdyn.ui.handlers.exports;\r
 \r
 import java.io.File;\r
-import java.io.IOException;\r
-import java.util.ArrayList;\r
 \r
 import org.eclipse.core.commands.AbstractHandler;\r
 import org.eclipse.core.commands.ExecutionEvent;\r
@@ -25,24 +23,21 @@ import org.eclipse.swt.widgets.FileDialog;
 import org.eclipse.swt.widgets.Shell;\r
 import org.eclipse.ui.handlers.HandlerUtil;\r
 import org.simantics.databoard.Bindings;\r
-import org.simantics.databoard.binding.error.RuntimeBindingConstructionException;\r
-import org.simantics.databoard.binding.mutable.Variant;\r
-import org.simantics.databoard.container.DataContainer;\r
-import org.simantics.databoard.container.DataContainers;\r
 import org.simantics.db.ReadGraph;\r
 import org.simantics.db.Resource;\r
 import org.simantics.db.common.primitiverequest.PossibleRelatedValue;\r
 import org.simantics.db.common.request.ReadRequest;\r
 import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.db.layer0.util.TransferableGraphRequest2;\r
+import org.simantics.db.layer0.util.ModelTransferableGraphSourceRequest;\r
+import org.simantics.db.layer0.util.TransferableGraphConfiguration2;\r
 import org.simantics.db.request.Read;\r
-import org.simantics.graph.representation.TransferableGraph1;\r
+import org.simantics.graph.db.TransferableGraphSource;\r
+import org.simantics.graph.db.TransferableGraphs;\r
 import org.simantics.layer0.Layer0;\r
 import org.simantics.sysdyn.ui.Activator;\r
 import org.simantics.sysdyn.ui.handlers.imports.ImportModelHandler;\r
 import org.simantics.ui.SimanticsUI;\r
 import org.simantics.ui.utils.ResourceAdaptionUtils;\r
-import org.simantics.utils.datastructures.Pair;\r
 \r
 /**\r
  * Exports a selected model\r
@@ -94,31 +89,22 @@ public class ExportModelHandler extends AbstractHandler {
                fd.setFilterExtensions(filterExt);\r
                final String selected = fd.open();\r
                if(selected == null) return null;\r
-               \r
-        // Save location to preference store\r
+\r
+               // Save location to preference store\r
                Activator.getDefault().getPreferenceStore().setValue(ImportModelHandler.IMPORTMODELTPATH, (new File(selected)).getParent());\r
-               \r
-        // Asynchronously create the file using transferable graph\r
-               SimanticsUI.getSession().asyncRequest(new ReadRequest() {\r
-                       \r
-                       @Override\r
-                       public void run(ReadGraph graph) throws DatabaseException {\r
-                               \r
-                               Layer0 l0 = Layer0.getInstance(graph);\r
-                               String name = graph.syncRequest(new PossibleRelatedValue<String>(model, l0.HasName, Bindings.STRING ));\r
-                               ArrayList<Pair<Resource, String>> roots = new ArrayList<Pair<Resource, String>>();\r
-                               roots.add(Pair.make(model, name));\r
-                               TransferableGraph1 tg = graph.syncRequest(new TransferableGraphRequest2(roots, model));\r
 \r
-                               try {\r
-                                       DataContainers.writeFile(new File(selected), new DataContainer("sysdynModel", 1, new Variant(TransferableGraph1.BINDING, tg)));\r
-                               } catch (RuntimeBindingConstructionException e) {\r
-                                       e.printStackTrace();\r
-                               } catch (IOException e) {\r
-                                       e.printStackTrace();\r
-                               }\r
+               // Asynchronously create the file using transferable graph\r
+               SimanticsUI.getSession().asyncRequest(new ReadRequest() {\r
 \r
-                               \r
+                   @Override\r
+                   public void run(ReadGraph graph) throws DatabaseException {\r
+                       TransferableGraphConfiguration2 conf = new TransferableGraphConfiguration2(graph, model);\r
+                       TransferableGraphSource s = graph.syncRequest(new ModelTransferableGraphSourceRequest(conf));\r
+                       try {\r
+                           TransferableGraphs.writeTransferableGraph(graph, "sysdynModel", 1, s,new File(selected));\r
+                       } catch (Exception e) {\r
+                           e.printStackTrace();\r
+                       }\r
                        }\r
                });\r
 \r