]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Merged trunk@30066-30400 to branches/sysdyn-1.8 on 2014-10-16 for 1.8.2 release.
authorjsimomaa <jsimomaa@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 16 Oct 2014 08:13:49 +0000 (08:13 +0000)
committerjsimomaa <jsimomaa@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 16 Oct 2014 08:13:49 +0000 (08:13 +0000)
refs #5170
refs #5119
refs #4882
refs #5197
refs #5204
refs #5205
refs #5184
refs #5206
refs #5207
refs #5208
refs #5209
refs #5196
refs #5185
refs #5227
refs #5267
refs #5273
refs #5280
refs #5314
refs #5357
refs #5386

git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/branches/1.8@30425 ac1ea38d-2e2b-0410-8846-a27921b304fc

40 files changed:
org.simantics.sysdyn.ui/Splash.xcf [deleted file]
org.simantics.sysdyn.ui/adapters.xml
org.simantics.sysdyn.ui/logo/Simantics_sysdyn_logo2.blend [new file with mode: 0644]
org.simantics.sysdyn.ui/logo/Simantics_sysdyn_text.png [new file with mode: 0644]
org.simantics.sysdyn.ui/logo/Splash.xcf [new file with mode: 0644]
org.simantics.sysdyn.ui/logo/sysdyn.png [new file with mode: 0644]
org.simantics.sysdyn.ui/logo/sysdyn_with_arrows.png [new file with mode: 0644]
org.simantics.sysdyn.ui/logo/sysdyn_with_arrows.xcf [new file with mode: 0644]
org.simantics.sysdyn.ui/logo/sysdyn_with_arrows_and_orange_bg.xcf [new file with mode: 0644]
org.simantics.sysdyn.ui/plugin.xml
org.simantics.sysdyn.ui/plugin_customization.ini
org.simantics.sysdyn.ui/splash.bmp
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/actions/drop/ChartDropAction.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/actions/drop/FunctionDropAction.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/Project.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/SysdynProject.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/FunctionLibraryNode.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/FunctionNode.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/FunctionsFolder.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/SharedFunctionLibraryNode.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/OpenDiagramFromComponentAdapter.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/SysdynCreationInstruction.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/participant/SysdynConnectionBuilder.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/connections/RouteFlowConnectionFactory.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/profiles/ShadowStyle.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/AssignIC.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/EnumerationIndexRenameNodeHandler.java [new file with mode: 0644]
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/SaveHistoryHandler.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/SaveICHandler.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/imports/ImportMdlHandler.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/preferences/ModelicaPreferencePage.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ArrayIndexesTab.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ConfigurationTab.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/EnumerationTab.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/EquationTab.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/IsOutputWidget.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/arrays/EnumerationIndexNode.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/arrays/ReplaceableIndexesWidget.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/NameValidator.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/wizards/mdl/WizardMdlImportPage.java

diff --git a/org.simantics.sysdyn.ui/Splash.xcf b/org.simantics.sysdyn.ui/Splash.xcf
deleted file mode 100644 (file)
index 388267f..0000000
Binary files a/org.simantics.sysdyn.ui/Splash.xcf and /dev/null differ
index 517bc7e212b4b7be5b04c81b42305812c6cd17bd..26ca56a7046fccdccabec71eab58137e1d46d6af 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               <resource uri="http://www.simantics.org/Sysdyn-0.0/ShadowSymbol"\r                       class="org.simantics.sysdyn.ui.elements.ShadowFactory" />                       \r               <resource uri="http://www.simantics.org/Sysdyn-0.0/LoopSymbol"\r                 class="org.simantics.sysdyn.ui.elements.LoopFactory" />                 \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               <type uri="http://www.simantics.org/Sysdyn-0.0/ShadowSymbol"\r                   class="org.simantics.sysdyn.ui.elements.ShadowFactory" />       \r               <type uri="http://www.simantics.org/Sysdyn-0.0/LoopSymbol"\r                     class="org.simantics.sysdyn.ui.elements.LoopFactory" /> \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/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            \r            \r       <!-- Sensitivity analysis -->\r      <resource uri="http://www.simantics.org/Sysdyn-0.0/SensitivityAnalysisExperiment/ParameterBrowseContext/ParameterChildRule"\r            class="org.simantics.sysdyn.ui.properties.widgets.sensitivity.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  \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/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            \r    <!-- Sensitivity analysis -->\r      <resource uri="http://www.simantics.org/Sysdyn-0.0/SensitivityAnalysisExperiment/ParameterBrowseContext/ParameterLabelRule"\r            class="org.simantics.sysdyn.ui.properties.widgets.sensitivity.ParameterLabelRule"/>\r\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                    \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        <resource uri="http://www.simantics.org/Sysdyn-0.0/ShadowStyle"\r            class="org.simantics.sysdyn.ui.elements.profiles.ShadowStyle">\r        </resource>        \r    </target>\r    \r \r    <!--  TODO: currently maps jfree concepts directly to Sysdyn implementations. Sysdyn needs tool specific types for the datasets. -->\r    <!--  TODO: AllVariablesOfModel query is run on random Resources; listing all possible types explicitly is cumbersome, we need a better implementation. -->\r    <target interface="org.simantics.jfreechart.chart.properties.IAllVariablesOfModel">  \r        <type uri="http://www.simantics.org/Sysdyn-1.1/SysdynModel"\r            class="org.simantics.sysdyn.ui.trend.AllVariablesOfModel">\r            <this />\r        </type>  \r        <type uri="http://www.simantics.org/JFreeChart-1.0/NumberAxis"\r            class="org.simantics.sysdyn.ui.trend.AllVariablesOfModel">\r            <this />\r        </type>   \r        <type uri="http://www.simantics.org/JFreeChart-1.0/Series"\r            class="org.simantics.sysdyn.ui.trend.AllVariablesOfModel">\r            <this />\r        </type>      \r        <type uri="http://www.simantics.org/Sysdyn-0.0/SensitivityAnalysisExperiment/Parameter"\r            class="org.simantics.sysdyn.ui.trend.AllParametersOfModel">\r            <this />\r        </type>\r    </target> \r       \r    <target interface="org.simantics.jfreechart.chart.properties.RangeHandlerFactory">  \r        <type uri="http://www.simantics.org/JFreeChart-1.0/Series"\r            class="org.simantics.sysdyn.ui.trend.SysdynRangeHandlerFactory">\r        </type>    \r        <type uri="http://www.simantics.org/Sysdyn-0.0/SensitivityAnalysisExperiment/Parameter"\r            class="org.simantics.sysdyn.ui.properties.widgets.sensitivity.SensitivityRangeHandlerFactory">\r        </type>\r    </target> \r    \r    <!--  TODO: currently maps jfree concepts directly to Sysdyn implementations. Sysdyn needs tool specific types for the datasets. -->\r     <target interface="org.simantics.jfreechart.chart.IDataset">\r        <type uri="http://www.simantics.org/JFreeChart-0.0/XYDataset"\r            class="org.simantics.sysdyn.ui.trend.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.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.PieDataset">\r            <graph />\r            <this />\r        </type>   \r        <type uri="http://www.simantics.org/Sysdyn-0.0/Charts/SensitivityDataset"\r            class="org.simantics.sysdyn.ui.trend.SensitivityDataset">\r            <graph />\r            <this />\r        </type>\r    </target>\r    \r       <!-- Sensitivity analysis -->\r   <target\r        interface="org.simantics.sysdyn.ui.properties.widgets.sensitivity.IDistributionProperties">\r        <type\r            uri="http://www.simantics.org/Sysdyn-0.0/NormalDistribution"\r            class="org.simantics.sysdyn.ui.properties.widgets.sensitivity.NormalDistributionProperties">\r            <this />\r        </type>       \r        <type\r            uri="http://www.simantics.org/Sysdyn-0.0/UniformDistribution"\r            class="org.simantics.sysdyn.ui.properties.widgets.sensitivity.UniformDistributionProperties">\r            <this />\r        </type> \r        <type\r            uri="http://www.simantics.org/Sysdyn-0.0/Interval"\r            class="org.simantics.sysdyn.ui.properties.widgets.sensitivity.IntervalProperties">\r            <this />\r        </type>\r    </target>\r    \r    <!-- Search -->\r       <target interface="org.simantics.scl.runtime.function.Function">\r               <resource uri="http://www.simantics.org/Sysdyn-0.0/ModulesSearchFunction"\r                      class="org.simantics.sysdyn.ui.function.ModulesSearchFunction">\r                </resource>\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/Simulation-0.0/Model"\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 uri="http://www.simantics.org/Simulation-0.0/Model"\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               <resource uri="http://www.simantics.org/Sysdyn-0.0/ShadowSymbol"\r                       class="org.simantics.sysdyn.ui.elements.ShadowFactory" />                       \r               <resource uri="http://www.simantics.org/Sysdyn-0.0/LoopSymbol"\r                 class="org.simantics.sysdyn.ui.elements.LoopFactory" />                 \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               <type uri="http://www.simantics.org/Sysdyn-0.0/ShadowSymbol"\r                   class="org.simantics.sysdyn.ui.elements.ShadowFactory" />       \r               <type uri="http://www.simantics.org/Sysdyn-0.0/LoopSymbol"\r                     class="org.simantics.sysdyn.ui.elements.LoopFactory" /> \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/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            \r            \r       <!-- Sensitivity analysis -->\r      <resource uri="http://www.simantics.org/Sysdyn-0.0/SensitivityAnalysisExperiment/ParameterBrowseContext/ParameterChildRule"\r            class="org.simantics.sysdyn.ui.properties.widgets.sensitivity.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  \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/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            \r    <!-- Sensitivity analysis -->\r      <resource uri="http://www.simantics.org/Sysdyn-0.0/SensitivityAnalysisExperiment/ParameterBrowseContext/ParameterLabelRule"\r            class="org.simantics.sysdyn.ui.properties.widgets.sensitivity.ParameterLabelRule"/>\r\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                    \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        <resource uri="http://www.simantics.org/Sysdyn-0.0/ShadowStyle"\r            class="org.simantics.sysdyn.ui.elements.profiles.ShadowStyle">\r        </resource>        \r    </target>\r    \r \r    <!--  TODO: currently maps jfree concepts directly to Sysdyn implementations. Sysdyn needs tool specific types for the datasets. -->\r    <!--  TODO: AllVariablesOfModel query is run on random Resources; listing all possible types explicitly is cumbersome, we need a better implementation. -->\r    <target interface="org.simantics.jfreechart.chart.properties.IAllVariablesOfModel">  \r        <type uri="http://www.simantics.org/Sysdyn-1.1/SysdynModel"\r            class="org.simantics.sysdyn.ui.trend.AllVariablesOfModel">\r            <this />\r        </type>  \r        <type uri="http://www.simantics.org/JFreeChart-1.0/NumberAxis"\r            class="org.simantics.sysdyn.ui.trend.AllVariablesOfModel">\r            <this />\r        </type>   \r        <type uri="http://www.simantics.org/JFreeChart-1.0/Series"\r            class="org.simantics.sysdyn.ui.trend.AllVariablesOfModel">\r            <this />\r        </type>      \r        <type uri="http://www.simantics.org/Sysdyn-0.0/SensitivityAnalysisExperiment/Parameter"\r            class="org.simantics.sysdyn.ui.trend.AllParametersOfModel">\r            <this />\r        </type>\r    </target> \r       \r    <target interface="org.simantics.jfreechart.chart.properties.RangeHandlerFactory">  \r        <type uri="http://www.simantics.org/JFreeChart-1.0/Series"\r            class="org.simantics.sysdyn.ui.trend.SysdynRangeHandlerFactory">\r        </type>    \r        <type uri="http://www.simantics.org/Sysdyn-0.0/SensitivityAnalysisExperiment/Parameter"\r            class="org.simantics.sysdyn.ui.properties.widgets.sensitivity.SensitivityRangeHandlerFactory">\r        </type>\r    </target> \r    \r    <!--  TODO: currently maps jfree concepts directly to Sysdyn implementations. Sysdyn needs tool specific types for the datasets. -->\r     <target interface="org.simantics.jfreechart.chart.IDataset">\r        <type uri="http://www.simantics.org/JFreeChart-0.0/XYDataset"\r            class="org.simantics.sysdyn.ui.trend.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.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.PieDataset">\r            <graph />\r            <this />\r        </type>   \r        <type uri="http://www.simantics.org/Sysdyn-0.0/Charts/SensitivityDataset"\r            class="org.simantics.sysdyn.ui.trend.SensitivityDataset">\r            <graph />\r            <this />\r        </type>\r    </target>\r    \r       <!-- Sensitivity analysis -->\r   <target\r        interface="org.simantics.sysdyn.ui.properties.widgets.sensitivity.IDistributionProperties">\r        <type\r            uri="http://www.simantics.org/Sysdyn-0.0/NormalDistribution"\r            class="org.simantics.sysdyn.ui.properties.widgets.sensitivity.NormalDistributionProperties">\r            <this />\r        </type>       \r        <type\r            uri="http://www.simantics.org/Sysdyn-0.0/UniformDistribution"\r            class="org.simantics.sysdyn.ui.properties.widgets.sensitivity.UniformDistributionProperties">\r            <this />\r        </type> \r        <type\r            uri="http://www.simantics.org/Sysdyn-0.0/Interval"\r            class="org.simantics.sysdyn.ui.properties.widgets.sensitivity.IntervalProperties">\r            <this />\r        </type>\r    </target>\r    \r    <!-- Search -->\r       <target interface="org.simantics.scl.runtime.function.Function">\r               <resource uri="http://www.simantics.org/Sysdyn-0.0/ModulesSearchFunction"\r                      class="org.simantics.sysdyn.ui.function.ModulesSearchFunction">\r                </resource>\r    </target>\r    \r
 </adapters>
\ No newline at end of file
diff --git a/org.simantics.sysdyn.ui/logo/Simantics_sysdyn_logo2.blend b/org.simantics.sysdyn.ui/logo/Simantics_sysdyn_logo2.blend
new file mode 100644 (file)
index 0000000..8307229
Binary files /dev/null and b/org.simantics.sysdyn.ui/logo/Simantics_sysdyn_logo2.blend differ
diff --git a/org.simantics.sysdyn.ui/logo/Simantics_sysdyn_text.png b/org.simantics.sysdyn.ui/logo/Simantics_sysdyn_text.png
new file mode 100644 (file)
index 0000000..98035c2
Binary files /dev/null and b/org.simantics.sysdyn.ui/logo/Simantics_sysdyn_text.png differ
diff --git a/org.simantics.sysdyn.ui/logo/Splash.xcf b/org.simantics.sysdyn.ui/logo/Splash.xcf
new file mode 100644 (file)
index 0000000..110af1a
Binary files /dev/null and b/org.simantics.sysdyn.ui/logo/Splash.xcf differ
diff --git a/org.simantics.sysdyn.ui/logo/sysdyn.png b/org.simantics.sysdyn.ui/logo/sysdyn.png
new file mode 100644 (file)
index 0000000..30e09cf
Binary files /dev/null and b/org.simantics.sysdyn.ui/logo/sysdyn.png differ
diff --git a/org.simantics.sysdyn.ui/logo/sysdyn_with_arrows.png b/org.simantics.sysdyn.ui/logo/sysdyn_with_arrows.png
new file mode 100644 (file)
index 0000000..7a52a5a
Binary files /dev/null and b/org.simantics.sysdyn.ui/logo/sysdyn_with_arrows.png differ
diff --git a/org.simantics.sysdyn.ui/logo/sysdyn_with_arrows.xcf b/org.simantics.sysdyn.ui/logo/sysdyn_with_arrows.xcf
new file mode 100644 (file)
index 0000000..d4d4cdb
Binary files /dev/null and b/org.simantics.sysdyn.ui/logo/sysdyn_with_arrows.xcf differ
diff --git a/org.simantics.sysdyn.ui/logo/sysdyn_with_arrows_and_orange_bg.xcf b/org.simantics.sysdyn.ui/logo/sysdyn_with_arrows_and_orange_bg.xcf
new file mode 100644 (file)
index 0000000..dae6145
Binary files /dev/null and b/org.simantics.sysdyn.ui/logo/sysdyn_with_arrows_and_orange_bg.xcf differ
index 7b06dd5bb14c4e834bb7da0f042c1a8d94648638..3cac4f5ea6b80ee9858cb227aec41d8972a90cda 100644 (file)
                tooltip="Exports the trend to SVG file">\r
          </command>\r
       </menuContribution>\r
+      \r
+      <menuContribution\r
+            locationURI="popup:#EnumerationTabPopup?after=wbStart">\r
+            \r
+            <command\r
+               commandId="org.simantics.sysdyn.ui.renameNode1"\r
+               icon="platform:/plugin/com.famfamfam.silk/icons/textfield_rename.png"\r
+               id="org.simantics.sysdyn.ui.browser.rename"\r
+               label="Rename"\r
+               style="push">\r
+            <visibleWhen checkEnabled="true">\r
+            </visibleWhen>\r
+         </command>\r
+            \r
+      </menuContribution>\r
       <menuContribution\r
             locationURI="popup:#SysdynBrowserPopup?after=wbStart">\r
          <menu id="org.simantics.new"\r
                      checkEnabled="true">\r
                   <with\r
                         variable="selection">\r
+                     <or>\r
                         <test\r
                               args="http://www.simantics.org/Layer0-0.0/Library"\r
                               property="org.simantics.graph.resourceType"\r
                               value="true">\r
                         </test>\r
+                 <test\r
+                       args="http://www.simantics.org/Structural-0.0/ComponentType"\r
+                       property="org.simantics.graph.resourceType"\r
+                       value="true">\r
+                 </test>\r
+                 </or>\r
                   </with>\r
                </visibleWhen>\r
             </command>\r
             id="org.simantics.sysdyn.ui.renameNode"\r
             name="Rename Node">\r
       </command>\r
+      <command\r
+            id="org.simantics.sysdyn.ui.enumerationIndexRenameNode"\r
+            name="Rename Node">\r
+      </command>\r
       <command\r
             defaultHandler="org.simantics.sysdyn.ui.handlers.ToggleSimulation"\r
             id="org.simantics.sysdyn.ui.toggleSimulation"\r
    </extension>\r
    <extension\r
          point="org.eclipse.ui.handlers">\r
+         \r
+      <handler\r
+            class="org.simantics.sysdyn.ui.handlers.EnumerationIndexRenameNodeHandler"\r
+            commandId="org.simantics.sysdyn.ui.enumerationIndexRenameNode">\r
+      </handler>\r
+         \r
+         \r
       <handler\r
             class="org.simantics.sysdyn.ui.trend.PinTrend"\r
             commandId="org.simantics.sysdyn.ui.trend.view.pin">\r
                        property="org.simantics.graph.resourceType"\r
                        value="true">\r
                  </test>\r
+                 <test\r
+                       args="http://www.simantics.org/Structural-0.0/ComponentType"\r
+                       property="org.simantics.graph.resourceType"\r
+                       value="true">\r
+                 </test>\r
                </or>\r
             </with>\r
          </activeWhen>\r
index 92e8ed0c0a7cf0e914520a8fc7b0c9c7f93fb234..2d6b595d262a44327d7f47450a0aa34618efbd91 100644 (file)
@@ -1,2 +1,4 @@
 org.eclipse.ui/SHOW_PROGRESS_ON_STARTUP = false\r
-org.eclipse.ui/DOCK_PERSPECTIVE_BAR=right
\ No newline at end of file
+org.eclipse.ui/DOCK_PERSPECTIVE_BAR=right\r
+\r
+org.simantics.sysdyn.solver.preferences/SOLVER_TYPE=OPENMODELICA
\ No newline at end of file
index faea2d91571ba8e9d0bad4970f8e064d7f2fecb5..3c372f64ac1892e1ad6e7238ef41ae8e1713957a 100644 (file)
Binary files a/org.simantics.sysdyn.ui/splash.bmp and b/org.simantics.sysdyn.ui/splash.bmp differ
index 27c0272ce80dad29f28ad75f5948f58b1910becc..e5e308acf4d64a9c60f7a3d8989f5e1c513a3088 100644 (file)
@@ -40,7 +40,7 @@ import org.simantics.utils.ui.AdaptionUtils;
 public class ChartDropAction implements DropActionFactory {\r
 \r
     @Override\r
-    public Runnable create(ReadGraph g, Object target, Object source) throws DatabaseException {\r
+    public Runnable create(ReadGraph g, Object target, Object source, int operation) throws DatabaseException {\r
 \r
         final Resource targetChart = AdaptionUtils.adaptToSingle(target, Resource.class);\r
         if(targetChart == null || source == null || !(source instanceof IStructuredSelection))\r
index 354f25b3f0135eff9dffd7824cc1247cc3edfd15..cb3e16269837dab440726d4555e0e7e1c09e3e84 100644 (file)
@@ -30,7 +30,7 @@ import org.simantics.utils.ui.AdaptionUtils;
 public class FunctionDropAction implements DropActionFactory {\r
 \r
     @Override\r
-    public Runnable create(ReadGraph g, Object target, Object source) throws DatabaseException {\r
+    public Runnable create(ReadGraph g, Object target, Object source, int operation) throws DatabaseException {\r
         Resource t = AdaptionUtils.adaptToSingle(target, Resource.class);\r
         Resource s = AdaptionUtils.adaptToSingle(source, Resource.class);\r
 \r
index 0d381be52c645e1e20c8eeacf896c88367996018..06105db3bfd80b345520db61a30443f77ce52206 100644 (file)
@@ -24,7 +24,7 @@ import org.simantics.db.common.request.ObjectsWithType;
 import org.simantics.db.exception.DatabaseException;\r
 import org.simantics.layer0.Layer0;\r
 import org.simantics.project.ontology.ProjectResource;\r
-import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.simulation.ontology.SimulationResource;\r
 import org.simantics.sysdyn.ui.browser.nodes.SharedOntologyNode;\r
 \r
 public class Project extends ViewpointContributor<Resource> {\r
@@ -36,8 +36,8 @@ public class Project extends ViewpointContributor<Resource> {
 \r
         ArrayList<AbstractNode<Resource>> result = new ArrayList<AbstractNode<Resource>>();\r
         Layer0 l0 = Layer0.getInstance(graph);\r
-        SysdynResource sr = SysdynResource.getInstance(graph);\r
-        for(Resource r : graph.syncRequest(new ObjectsWithType(project, l0.ConsistsOf, sr.SysdynModel))) {\r
+        SimulationResource SIMU = SimulationResource.getInstance(graph);\r
+        for(Resource r : graph.syncRequest(new ObjectsWithType(project, l0.ConsistsOf, SIMU.Model))) {\r
             try {\r
                 result.add(graph.adapt(r, AbstractNode.class));\r
             } catch(DatabaseException e) {\r
@@ -49,7 +49,7 @@ public class Project extends ViewpointContributor<Resource> {
         if(!graph.isInstanceOf(project, PROJ.Project)) return Collections.emptyList();\r
         Collection<Resource> ontologies = Simantics.applySCL("Simantics/SharedOntologies", "traverseSharedOntologies", graph, graph.getRootLibrary());\r
         for(Resource o : ontologies) {\r
-               if(!graph.isImmutable(o))\r
+//             if(!graph.isImmutable(o))\r
                        result.add(new SharedOntologyNode(o));\r
         }\r
 \r
index 91c46b6a9080f00e2402f5c0bc75c10254baa6a9..ce71ad296e553fd625a406456b3d06859ee1a51f 100644 (file)
@@ -9,8 +9,8 @@ import org.simantics.db.Resource;
 import org.simantics.db.common.request.ObjectsWithType;\r
 import org.simantics.db.exception.DatabaseException;\r
 import org.simantics.layer0.Layer0;\r
+import org.simantics.simulation.ontology.SimulationResource;\r
 import org.simantics.structural.ui.modelBrowser.nodes.AbstractNode;\r
-import org.simantics.sysdyn.SysdynResource;\r
 \r
 public class SysdynProject  extends ViewpointContributor<Resource> {\r
 \r
@@ -20,7 +20,7 @@ public class SysdynProject  extends ViewpointContributor<Resource> {
 \r
         ArrayList<AbstractNode> result = new ArrayList<AbstractNode>();\r
         Layer0 L0 = Layer0.getInstance(graph);\r
-        for(Resource r : graph.syncRequest(new ObjectsWithType(project, L0.ConsistsOf, SysdynResource.getInstance(graph).SysdynModel))) {\r
+        for(Resource r : graph.syncRequest(new ObjectsWithType(project, L0.ConsistsOf, SimulationResource.getInstance(graph).Model))) {\r
             try {\r
                 result.add(graph.adapt(r, AbstractNode.class));\r
             } catch(DatabaseException e) {\r
index 00a3dcb5ff87d2240f7211993b6f8c0b798bc00e..8813df952232924589b2670f47289e35740c30d5 100644 (file)
@@ -11,6 +11,7 @@
  *******************************************************************************/\r
 package org.simantics.sysdyn.ui.browser.nodes;\r
 \r
+import org.simantics.Simantics;\r
 import org.simantics.browsing.ui.common.node.AbstractNode;\r
 import org.simantics.browsing.ui.common.node.DeleteException;\r
 import org.simantics.browsing.ui.common.node.IDeletableNode;\r
@@ -21,7 +22,9 @@ import org.simantics.browsing.ui.graph.impl.LabelModifier;
 import org.simantics.db.Resource;\r
 import org.simantics.db.WriteGraph;\r
 import org.simantics.db.common.request.WriteRequest;\r
+import org.simantics.db.common.utils.NameUtils;\r
 import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.util.Layer0Utils;\r
 import org.simantics.db.layer0.util.RemoverUtil;\r
 import org.simantics.layer0.Layer0;\r
 import org.simantics.sysdyn.SysdynResource;\r
@@ -62,6 +65,8 @@ public class FunctionLibraryNode<T> extends AbstractNode<Resource> implements ID
 \r
                @Override\r
                public void perform(WriteGraph graph) throws DatabaseException {\r
+                   graph.markUndoPoint();\r
+                   Layer0Utils.addCommentMetadata(graph, "Removed " + NameUtils.getSafeName(graph, data));\r
                    RemoverUtil.remove(graph, data);\r
                }\r
            });\r
@@ -72,12 +77,18 @@ public class FunctionLibraryNode<T> extends AbstractNode<Resource> implements ID
                final Resource[] resources = ResourceAdaptionUtils.toResources(data);\r
                final Resource library = this.data;\r
                if(resources.length > 0) {\r
-                       SimanticsUI.getSession().asyncRequest(new WriteRequest() {\r
+                       Simantics.getSession().asyncRequest(new WriteRequest() {\r
                                \r
                                @Override\r
                                public void perform(WriteGraph graph) throws DatabaseException {\r
                                        SysdynResource sr = SysdynResource.getInstance(graph);\r
                                        Layer0 l0 = Layer0.getInstance(graph);\r
+                                       \r
+                                       // Fixing #5196\r
+                                       // Prevent dropping functions to immutable function libraries such as Built-in Functions, Modelica Array Functions etc.\r
+                                       if (graph.isImmutable(library))\r
+                                           return;\r
+                                       \r
                                        for(Resource tobeMoved : resources) {\r
                                                if(graph.isInstanceOf(tobeMoved, sr.SysdynModelicaFunction) ||\r
                                                                graph.isInstanceOf(tobeMoved, sr.SysdynModelicaFunctionLibrary)) {\r
index 21312513b4c2d206ed87c53098b9bb4bfc8641f9..df983ed1de5790406f10462bcd48543ec05281f3 100644 (file)
@@ -11,6 +11,7 @@
  *******************************************************************************/\r
 package org.simantics.sysdyn.ui.browser.nodes;\r
 \r
+import org.simantics.Simantics;\r
 import org.simantics.browsing.ui.common.node.DeleteException;\r
 import org.simantics.browsing.ui.common.node.IDeletableNode;\r
 import org.simantics.browsing.ui.common.node.IDropTargetNode;\r
@@ -20,12 +21,13 @@ import org.simantics.browsing.ui.graph.impl.LabelModifier;
 import org.simantics.db.Resource;\r
 import org.simantics.db.WriteGraph;\r
 import org.simantics.db.common.request.WriteRequest;\r
+import org.simantics.db.common.utils.NameUtils;\r
 import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.util.Layer0Utils;\r
 import org.simantics.db.layer0.util.RemoverUtil;\r
 import org.simantics.layer0.Layer0;\r
 import org.simantics.sysdyn.SysdynResource;\r
 import org.simantics.sysdyn.ui.utils.FunctionNameValidator;\r
-import org.simantics.ui.SimanticsUI;\r
 import org.simantics.ui.utils.ResourceAdaptionUtils;\r
 \r
 public class FunctionNode extends VariableNode<Resource> implements IDeletableNode, IModifiableNode, IDropTargetNode {\r
@@ -37,8 +39,8 @@ public class FunctionNode extends VariableNode<Resource> implements IDeletableNo
        @Override\r
        public Modifier getModifier(String columnId) {\r
                try {\r
-                       Resource hasName = Layer0.getInstance(SimanticsUI.getSession()).HasName;\r
-                       LabelModifier modifier = new LabelModifier(SimanticsUI.getSession(), data, hasName) {\r
+                       Resource hasName = Layer0.getInstance(Simantics.getSession()).HasName;\r
+                       LabelModifier modifier = new LabelModifier(Simantics.getSession(), data, hasName) {\r
                 @Override\r
                 public String isValid(String label) {\r
                     if (!new FunctionNameValidator().isValid(data, label))\r
@@ -56,10 +58,12 @@ public class FunctionNode extends VariableNode<Resource> implements IDeletableNo
 \r
        @Override\r
        public void delete() throws DeleteException {\r
-           SimanticsUI.getSession().asyncRequest(new WriteRequest() {\r
+           Simantics.getSession().asyncRequest(new WriteRequest() {\r
 \r
                @Override\r
                public void perform(WriteGraph graph) throws DatabaseException {\r
+                graph.markUndoPoint();\r
+                Layer0Utils.addCommentMetadata(graph, "Removed " + NameUtils.getSafeName(graph, data));\r
                    RemoverUtil.remove(graph, data);\r
                }\r
            });\r
@@ -71,7 +75,7 @@ public class FunctionNode extends VariableNode<Resource> implements IDeletableNo
                final Resource thisFunction = this.data;\r
                \r
                if(resources.length > 0) {\r
-                       SimanticsUI.getSession().asyncRequest(new WriteRequest() {\r
+                       Simantics.getSession().asyncRequest(new WriteRequest() {\r
                                \r
                                @Override\r
                                public void perform(WriteGraph graph) throws DatabaseException {\r
index 5e4f8748da8d4138cfdcee82d73e1257d0b02107..2bdb2e448060bed53e6bd0291f8c1c9be8dde1af 100644 (file)
@@ -11,6 +11,7 @@
  *******************************************************************************/\r
 package org.simantics.sysdyn.ui.browser.nodes;\r
 \r
+import org.simantics.Simantics;\r
 import org.simantics.browsing.ui.common.node.AbstractNode;\r
 import org.simantics.browsing.ui.common.node.IDropTargetNode;\r
 import org.simantics.db.Resource;\r
@@ -19,7 +20,6 @@ import org.simantics.db.common.request.WriteRequest;
 import org.simantics.db.exception.DatabaseException;\r
 import org.simantics.layer0.Layer0;\r
 import org.simantics.sysdyn.SysdynResource;\r
-import org.simantics.ui.SimanticsUI;\r
 import org.simantics.ui.utils.ResourceAdaptionUtils;\r
 \r
 public class FunctionsFolder extends AbstractNode<Resource> implements IDropTargetNode{\r
@@ -41,7 +41,7 @@ public class FunctionsFolder extends AbstractNode<Resource> implements IDropTarg
                final Resource[] resources = ResourceAdaptionUtils.toResources(data);\r
                final Resource library = this.data;\r
                if(resources.length > 0) {\r
-                       SimanticsUI.getSession().asyncRequest(new WriteRequest() {\r
+                       Simantics.getSession().asyncRequest(new WriteRequest() {\r
                                \r
                                @Override\r
                                public void perform(WriteGraph graph) throws DatabaseException {\r
index b508227732e4818dc2c11314bf989653314e2c65..ec8d5f89ecd8912fbf6c8c76957fc2d3e15a2894 100644 (file)
@@ -11,6 +11,7 @@
  *******************************************************************************/\r
 package org.simantics.sysdyn.ui.browser.nodes;\r
 \r
+import org.simantics.Simantics;\r
 import org.simantics.browsing.ui.common.node.DeleteException;\r
 import org.simantics.browsing.ui.common.node.IDropTargetNode;\r
 import org.simantics.browsing.ui.content.Labeler.Modifier;\r
@@ -25,7 +26,6 @@ import org.simantics.db.layer0.util.RemoverUtil;
 import org.simantics.layer0.Layer0;\r
 import org.simantics.sysdyn.SysdynResource;\r
 import org.simantics.sysdyn.ui.utils.SharedFunctionLibraryNameValidator;\r
-import org.simantics.ui.SimanticsUI;\r
 import org.simantics.ui.utils.ResourceAdaptionUtils;\r
 \r
 public class SharedFunctionLibraryNode extends FunctionLibraryNode<Resource> implements IDropTargetNode {\r
@@ -36,7 +36,7 @@ public class SharedFunctionLibraryNode extends FunctionLibraryNode<Resource> imp
 \r
        @Override\r
        public void delete() throws DeleteException {\r
-               SimanticsUI.getSession().asyncRequest(new WriteRequest() {\r
+               Simantics.getSession().asyncRequest(new WriteRequest() {\r
 \r
                        @Override\r
                        public void perform(WriteGraph graph) throws DatabaseException {\r
@@ -50,8 +50,8 @@ public class SharedFunctionLibraryNode extends FunctionLibraryNode<Resource> imp
     @Override\r
     public Modifier getModifier(String columnId) {\r
         try {\r
-            Resource hasName = Layer0.getInstance(SimanticsUI.getSession()).HasName;\r
-            LabelModifier modifier = new LabelModifier(SimanticsUI.getSession(), data, hasName) {\r
+            Resource hasName = Layer0.getInstance(Simantics.getSession()).HasName;\r
+            LabelModifier modifier = new LabelModifier(Simantics.getSession(), data, hasName) {\r
                 @Override\r
                 public String isValid(String label) {\r
                     if (!new SharedFunctionLibraryNameValidator().isValid(data, label))\r
@@ -72,7 +72,7 @@ public class SharedFunctionLibraryNode extends FunctionLibraryNode<Resource> imp
                final Resource[] resources = ResourceAdaptionUtils.toResources(data);\r
                final Resource library = this.data;\r
                if(resources.length > 0) {\r
-                       SimanticsUI.getSession().asyncRequest(new WriteRequest() {\r
+                       Simantics.getSession().asyncRequest(new WriteRequest() {\r
                                \r
                                @Override\r
                                public void perform(WriteGraph graph) throws DatabaseException {\r
index fb89ccc3c531824a406ff7ca4503c98a9fc770c5..5456e92a71d6bde212f5801fd49fc5b2252305bd 100644 (file)
@@ -6,9 +6,11 @@ import java.util.Collections;
 \r
 import org.eclipse.swt.widgets.Display;\r
 import org.eclipse.ui.IEditorPart;\r
+import org.simantics.Simantics;\r
 import org.simantics.db.ReadGraph;\r
 import org.simantics.db.Resource;\r
-import org.simantics.db.common.request.ReadRequest;\r
+import org.simantics.db.common.procedure.adapter.TransientCacheAsyncListener;\r
+import org.simantics.db.common.request.UnaryRead;\r
 import org.simantics.db.exception.DatabaseException;\r
 import org.simantics.db.layer0.request.PossibleModel;\r
 import org.simantics.db.layer0.variable.RVI;\r
@@ -25,11 +27,9 @@ import org.simantics.modeling.ModelingResources;
 import org.simantics.modeling.actions.NavigateToTarget;\r
 import org.simantics.modeling.ui.Activator;\r
 import org.simantics.sysdyn.SysdynResource;\r
-import org.simantics.ui.SimanticsUI;\r
 import org.simantics.ui.utils.ResourceAdaptionUtils;\r
 import org.simantics.ui.workbench.editor.AbstractResourceEditorAdapter;\r
 import org.simantics.utils.datastructures.Callback;\r
-import org.simantics.utils.threads.SWTThread;\r
 import org.simantics.utils.threads.ThreadUtils;\r
 import org.simantics.utils.ui.AdaptionUtils;\r
 \r
@@ -46,11 +46,7 @@ public class OpenDiagramFromComponentAdapter extends AbstractResourceEditorAdapt
 \r
     @Override\r
     public boolean canHandle(ReadGraph graph, Object input) throws DatabaseException {\r
-        Resource r = tryGetResource(graph, input);\r
-        if (r == null)\r
-            return false;\r
-        Variable v = AdaptionUtils.adaptToSingle(input, Variable.class);\r
-        Collection<Runnable> rs = tryFindDiagram(graph, r, v);\r
+        Collection<Runnable> rs = graph.syncRequest(new DiagramFinderRequest(input), TransientCacheAsyncListener.<Collection<Runnable>>instance());\r
         return !rs.isEmpty();\r
     }\r
 \r
@@ -78,30 +74,11 @@ public class OpenDiagramFromComponentAdapter extends AbstractResourceEditorAdapt
         final Display d = Display.getCurrent();\r
         if (d == null)\r
             return;\r
-\r
-        SimanticsUI.getSession().syncRequest(new ReadRequest() {\r
-            @Override\r
-            public void run(ReadGraph graph) throws DatabaseException {\r
-                Resource r = tryGetResource(graph, input);\r
-                if (r == null)\r
-                    return;\r
-\r
-                Variable v = AdaptionUtils.adaptToSingle(input, Variable.class);\r
-\r
-                final Collection<Runnable> rs = tryFindDiagram(graph, r, v);\r
-                if (rs.isEmpty())\r
-                    return;\r
-\r
-                SWTThread.getThreadAccess(d).asyncExec(new Runnable() {\r
-                    @Override\r
-                    public void run() {\r
-                        for (Runnable runnable : rs) {\r
-                            runnable.run();\r
-                        }\r
-                    }\r
-                });\r
-            }\r
-        });\r
+        \r
+        Collection<Runnable> rs = Simantics.getSession().syncRequest(new DiagramFinderRequest(input), TransientCacheAsyncListener.<Collection<Runnable>>instance());\r
+        for (Runnable runnable : rs) {\r
+            runnable.run();\r
+        }\r
     }\r
 \r
     private Collection<Runnable> tryFindDiagram(ReadGraph g, Resource module, Variable variable) throws DatabaseException {\r
@@ -200,5 +177,21 @@ public class OpenDiagramFromComponentAdapter extends AbstractResourceEditorAdapt
         }\r
         return selectedObjects;\r
     }\r
+    \r
+    private class DiagramFinderRequest extends UnaryRead<Object, Collection<Runnable>> {\r
+\r
+        public DiagramFinderRequest(Object parameter) {\r
+            super(parameter);\r
+        }\r
+\r
+        @Override\r
+        public Collection<Runnable> perform(ReadGraph graph) throws DatabaseException {\r
+            Resource r = tryGetResource(graph, parameter);\r
+            if (r == null)\r
+                return Collections.emptyList();\r
+            Variable v = AdaptionUtils.adaptToSingle(parameter, Variable.class);\r
+            return tryFindDiagram(graph, r, v);\r
+        }\r
+    }\r
 \r
 }\r
index 67721548d5b12464aeed43d9719f3f321452c024..0e5de3ad45056ffc827b361cc5cae57806887f0d 100644 (file)
@@ -16,11 +16,11 @@ import gnu.trove.TIntIntHashMap;
 import java.util.Collection;\r
 import java.util.HashMap;\r
 \r
+import org.simantics.databoard.util.URIStringUtils;\r
 import org.simantics.db.Resource;\r
 import org.simantics.db.WriteGraph;\r
 import org.simantics.db.common.request.ObjectsWithType;\r
 import org.simantics.db.common.utils.NameUtils;\r
-import org.simantics.db.common.utils.URIStringUtils;\r
 import org.simantics.db.exception.DatabaseException;\r
 import org.simantics.layer0.Layer0;\r
 import org.simantics.layer0.utils.direct.GraphUtils;\r
index cd30949958538ebf0dae663c0f6d888a7e08cb2c..4963437dbcff85a547c11f80be4190e592675f74 100644 (file)
@@ -66,7 +66,7 @@ public class SysdynConnectionBuilder extends ConnectionBuilder{
      */\r
     public void create(WriteGraph graph, ConnectionJudgement judgment, Deque<ControlPoint> controlPoints,\r
             TerminalInfo startTerminal, TerminalInfo endTerminal) throws DatabaseException {\r
-        \r
+\r
        if(startTerminal == null) return;\r
        if(endTerminal == null) return;\r
        \r
@@ -81,11 +81,12 @@ public class SysdynConnectionBuilder extends ConnectionBuilder{
                createConnection(graph, judgment, controlPoints, startTerminal, endTerminal, false);\r
         }\r
         \r
-        String startElementName = startTerminal.e.getHint(ElementHints.KEY_TEXT);\r
-        String endElementName = endTerminal.e.getHint(ElementHints.KEY_TEXT);\r
         \r
-        String startElementResource = startTerminal.e.getHint(ElementHints.KEY_OBJECT).toString();\r
-        String endElementResource = endTerminal.e.getHint(ElementHints.KEY_OBJECT).toString();\r
+        String startElementName = startTerminal != null ? startTerminal.e.getHint(ElementHints.KEY_TEXT).toString() : "null";\r
+        String endElementName = endTerminal != null ? endTerminal.e.getHint(ElementHints.KEY_TEXT).toString() : "null";\r
+        \r
+        String startElementResource = startTerminal != null ? startTerminal.e.getHint(ElementHints.KEY_OBJECT).toString() : "null";\r
+        String endElementResource = endTerminal != null ? endTerminal.e.getHint(ElementHints.KEY_OBJECT).toString() : "null";\r
         \r
         Layer0Utils.addCommentMetadata(graph, "Created dependency starting from " + startElementName + " " + startElementResource + " and ending to " + endElementName + " " + endElementResource);\r
     }\r
index 6515eb056fa769aeac5664c8325a987586421321..517a696e57e7f93709d5a20ae622f1725ec872c9 100644 (file)
@@ -128,14 +128,8 @@ public class RouteFlowConnectionFactory extends SyncElementFactory {
 \r
         // Do we need this?\r
         element.setHint(DiagramHints.ROUTE_ALGORITHM, new Router4(false));\r
-\r
         IModelingRules modelingRules = diagram.getHint(DiagramModelHints.KEY_MODELING_RULES);\r
 \r
-        IElement mappedElement = ElementUtils.getByData(diagram, connection);\r
-        if (mappedElement == null)\r
-            // FIXME: With undo this seems to happen, don't know why yet!\r
-            return;\r
-\r
         Color color = null;\r
         DiagramResource DR = DiagramResource.getInstance(graph);\r
         G2DResource G2D = G2DResource.getInstance(graph);\r
@@ -344,7 +338,7 @@ public class RouteFlowConnectionFactory extends SyncElementFactory {
         // Initialize ConnectionEntity in element\r
         // NOTE: MUST use the mapped element with class CE, not the connection (element) were loading into.\r
         // GDS will synchronize element into mappedElement in a controlled manner.\r
-        element.setHint(ElementHints.KEY_CONNECTION_ENTITY, new CE(connection, mappedElement, backendonnections));\r
+        element.setHint(ElementHints.KEY_CONNECTION_ENTITY, new CE(diagram, connection, element, backendonnections));\r
 \r
         // Setup graph writeback support for route graph modifications\r
         final Session session = graph.getSession();\r
@@ -565,6 +559,11 @@ public class RouteFlowConnectionFactory extends SyncElementFactory {
      */\r
     static class CE implements ConnectionEntity {\r
 \r
+        \r
+        private IDiagram diagram;\r
+\r
+        private transient DataElementMap dataMap;\r
+        \r
         /**\r
          * The connection instance resource in the graph backend.\r
          */\r
@@ -573,7 +572,7 @@ public class RouteFlowConnectionFactory extends SyncElementFactory {
         /**\r
          * The connection entity element which is a part of the diagram.\r
          */\r
-        final IElement               connectionElement;\r
+        IElement               connectionElement;\r
 \r
         /**\r
          * @see #getTerminalConnections(Collection)\r
@@ -585,15 +584,31 @@ public class RouteFlowConnectionFactory extends SyncElementFactory {
          */\r
         Set<Connection>              terminalConnections;\r
 \r
-        CE(Resource connection, IElement connectionElement, Set<BackendConnection> backendConnections) {\r
+        \r
+        public CE(IDiagram diagram, Resource connection, IElement connectionElement, Set<BackendConnection> backendConnections) {\r
+            if (connectionElement == null)\r
+                throw new NullPointerException("null connection element");\r
+            this.diagram = diagram;\r
+            this.dataMap = diagram.getDiagramClass().getSingleItem(DataElementMap.class);\r
             this.connection = connection;\r
             this.connectionElement = connectionElement;\r
             this.backendConnections = backendConnections;\r
+            IElement ce = getConnection0();\r
+            if (ce != null)\r
+                this.connectionElement = ce;\r
+        }\r
+\r
+        public IElement getConnection0() {\r
+            IElement connectionElement = dataMap.getElement(diagram, connection);\r
+            return connectionElement;\r
         }\r
 \r
         @Override\r
         public IElement getConnection() {\r
-            return connectionElement;\r
+            IElement c = getConnection0();\r
+            if (c == null)\r
+                c = this.connectionElement;\r
+            return c;\r
         }\r
 \r
         public Object getConnectionObject() {\r
@@ -626,7 +641,6 @@ public class RouteFlowConnectionFactory extends SyncElementFactory {
         }\r
 \r
         private Set<Connection> calculateTerminalConnections() {\r
-            IDiagram diagram = connectionElement.getDiagram();\r
             DataElementMap dem = diagram.getDiagramClass().getSingleItem(DataElementMap.class);\r
             Set<Connection> result = new HashSet<Connection>();\r
             ArrayList<Terminal> ts = new ArrayList<Terminal>();\r
index 5e5f981cf29c274a6d70e3be7de432b6f5c014bc..ee0f442bcf2de267f479906a3ba5639debaccc4b 100644 (file)
@@ -50,6 +50,9 @@ public class ShadowStyle extends StyleBase<ShadowResult> {
         AffineTransform transform = DiagramGraphUtil.getAffineTransform(graph, element);\r
         \r
         Resource component = graph.getPossibleObject(element, MOD.ElementToComponent);\r
+        \r
+        if (component == null)\r
+               return new ShadowResult(Style.NONE, transform);\r
 \r
         Resource original = graph.getPossibleObject(component, SR.Shadow_original);\r
         Collection<Resource> shadows = graph.getObjects(component, SR.Shadow_original_Inverse);\r
index a84ec5507e5612c0ec7087c10db3bc906308f66e..16bb242b5e5ec5815a55cc52f691a7198ba8a34f 100644 (file)
@@ -34,6 +34,7 @@ import org.simantics.db.common.request.WriteRequest;
 import org.simantics.db.common.utils.NameUtils;\r
 import org.simantics.db.exception.DatabaseException;\r
 import org.simantics.db.layer0.request.PossibleModel;\r
+import org.simantics.db.layer0.util.Layer0Utils;\r
 import org.simantics.layer0.Layer0;\r
 import org.simantics.modeling.ui.Activator;\r
 import org.simantics.sysdyn.SysdynResource;\r
@@ -99,22 +100,17 @@ public class AssignIC extends AbstractHandler {
 \r
                        @Override\r
                        public void perform(WriteGraph graph) throws DatabaseException {\r
-\r
+                           graph.markUndoPoint();\r
                                SysdynResource SYSDYN = SysdynResource.getInstance(graph);\r
 \r
                                graph.deny(experiment, SYSDYN.Experiment_ic);\r
                                graph.claim(experiment, SYSDYN.Experiment_ic, ic);\r
-\r
+                               Layer0Utils.addCommentMetadata(graph, "Assigned new IC " + NameUtils.getSafeName(graph, ic) + " to experiment " + NameUtils.getSafeLabel(graph, experiment));\r
                        }\r
-\r
                });\r
-\r
         } catch (DatabaseException e) {\r
-\r
+            e.printStackTrace();\r
         }\r
-\r
         return null;\r
-        \r
     }\r
-\r
 }\r
diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/EnumerationIndexRenameNodeHandler.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/EnumerationIndexRenameNodeHandler.java
new file mode 100644 (file)
index 0000000..11b5cc3
--- /dev/null
@@ -0,0 +1,73 @@
+/*******************************************************************************\r
+ * Copyright (c) 2010 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ *     VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.ui.handlers;\r
+\r
+import org.eclipse.core.commands.AbstractHandler;\r
+import org.eclipse.core.commands.ExecutionEvent;\r
+import org.eclipse.core.commands.ExecutionException;\r
+import org.eclipse.jface.viewers.ISelection;\r
+import org.eclipse.swt.widgets.Composite;\r
+import org.eclipse.swt.widgets.Control;\r
+import org.eclipse.ui.IEditorPart;\r
+import org.eclipse.ui.IWorkbenchPart;\r
+import org.eclipse.ui.IWorkbenchSite;\r
+import org.eclipse.ui.handlers.HandlerUtil;\r
+import org.eclipse.ui.part.IPage;\r
+import org.eclipse.ui.part.IPageSite;\r
+import org.simantics.browsing.ui.GraphExplorer;\r
+import org.simantics.browsing.ui.NodeContext;\r
+import org.simantics.browsing.ui.common.ColumnKeys;\r
+import org.simantics.browsing.ui.platform.PropertyPageView;\r
+import org.simantics.browsing.ui.swt.widgets.GraphExplorerComposite;\r
+import org.simantics.sysdyn.ui.properties.SysdynPropertyPage;\r
+import org.simantics.utils.ui.ISelectionUtils;\r
+\r
+public class EnumerationIndexRenameNodeHandler extends AbstractHandler {\r
+\r
+    @Override\r
+    public Object execute(ExecutionEvent event) throws ExecutionException {\r
+        ISelection sel2 = HandlerUtil.getActiveMenuSelection(event);\r
+        NodeContext ctx = ISelectionUtils.filterSingleSelection(sel2, NodeContext.class);\r
+        if (ctx == null)\r
+            return null;\r
+\r
+        IWorkbenchPart part = HandlerUtil.getActivePart(event);\r
+        if (part == null)\r
+            return null;\r
+\r
+        PropertyPageView ppv = (PropertyPageView) part;\r
+        IPage p = ppv.getCurrentPage();\r
+        Control control = p.getControl();\r
+        \r
+        Control geComposite = findGEComposite(control);\r
+        GraphExplorerComposite ge = (GraphExplorerComposite) geComposite;\r
+        ge.getExplorer().startEditing(ctx, ColumnKeys.SINGLE);\r
+        \r
+        return null;\r
+    }\r
+    \r
+    private Control findGEComposite(Control control) {\r
+        Control[] comp = ((Composite) control).getChildren();\r
+        Control ge = null;\r
+        for (Control cont : comp) {\r
+            if (cont instanceof GraphExplorerComposite)\r
+                return cont;\r
+            else if (cont instanceof Composite) {\r
+                ge = findGEComposite(cont);\r
+                return ge;\r
+            }\r
+            else\r
+                continue;\r
+        }\r
+        return ge;\r
+    }\r
+}\r
index f4a103c01add0d117ca383f0a0988ff1275954f3..dde222be1a25e9479333b0bd9012f71878b4a8eb 100644 (file)
@@ -20,6 +20,9 @@ import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;\r
 import org.eclipse.jface.resource.ImageDescriptor;\r
 import org.eclipse.jface.window.Window;\r
+import org.eclipse.swt.SWT;\r
+import org.eclipse.swt.widgets.Display;\r
+import org.eclipse.swt.widgets.MessageBox;\r
 import org.eclipse.swt.widgets.Shell;\r
 import org.eclipse.ui.PlatformUI;\r
 import org.simantics.Simantics;\r
@@ -45,7 +48,6 @@ import org.simantics.sysdyn.manager.MemoryResult;
 import org.simantics.sysdyn.manager.SysdynGameExperimentBase;\r
 import org.simantics.sysdyn.manager.SysdynResult;\r
 import org.simantics.sysdyn.ui.utils.HandlerUtils;\r
-import org.simantics.ui.SimanticsUI;\r
 import org.simantics.utils.datastructures.Pair;\r
        \r
 public class SaveHistoryHandler extends AbstractHandler {\r
@@ -55,7 +57,7 @@ public class SaveHistoryHandler extends AbstractHandler {
         HandlerUtils.saveBeforeExperimentRun(event);\r
         \r
         IExperimentManager manager = \r
-            SimanticsUI.getProject().getHint(IExperimentManager.KEY_EXPERIMENT_MANAGER);\r
+            Simantics.getProject().getHint(IExperimentManager.KEY_EXPERIMENT_MANAGER);\r
         IExperiment experiment = manager.getActiveExperiment();\r
         if(experiment instanceof SysdynGameExperimentBase) {\r
             final SysdynGameExperimentBase exp = (SysdynGameExperimentBase)experiment;\r
@@ -67,6 +69,15 @@ public class SaveHistoryHandler extends AbstractHandler {
                        if(r instanceof MemoryResult) {\r
                                MemoryResult gr = (MemoryResult)r;\r
                                SimulationResult sr = gr.getSimulationResult();\r
+                               if (sr == null) {\r
+                                   \r
+                                   MessageBox messageDialog = new MessageBox(Display.getCurrent().getActiveShell(), SWT.ICON_WARNING | SWT.OK);\r
+                                   messageDialog.setText("No Simulation History");\r
+                                   messageDialog.setMessage("There is no simulation history available, please simulate first!");\r
+\r
+                                   messageDialog.open();\r
+                                   return null;\r
+                               }\r
                                for(DataSet ds : sr.getVariableDataSets()) {\r
                                        map.put(ds, new Pair<String,ImageDescriptor>(ds.name, null));\r
                                }\r
index de7383442f59c7e0ff0d6eea4f7a2c20c32121ef..b11fddffbf24edcf1efe3ae4928f34626a8ad65e 100644 (file)
@@ -25,7 +25,6 @@ import org.simantics.simulation.project.IExperimentManager;
 import org.simantics.sysdyn.manager.SysdynExperiment;\r
 import org.simantics.sysdyn.manager.SysdynExperiments;\r
 import org.simantics.sysdyn.ui.utils.HandlerUtils;\r
-import org.simantics.ui.SimanticsUI;\r
 \r
 public class SaveICHandler extends AbstractHandler {\r
 \r
@@ -34,7 +33,7 @@ public class SaveICHandler extends AbstractHandler {
         HandlerUtils.saveBeforeExperimentRun(event);\r
         \r
         IExperimentManager manager = \r
-            SimanticsUI.getProject().getHint(IExperimentManager.KEY_EXPERIMENT_MANAGER);\r
+            Simantics.getProject().getHint(IExperimentManager.KEY_EXPERIMENT_MANAGER);\r
         IExperiment experiment = manager.getActiveExperiment();\r
         if(experiment instanceof SysdynExperiment) {\r
             final SysdynExperiment exp = (SysdynExperiment)experiment;\r
@@ -44,7 +43,7 @@ public class SaveICHandler extends AbstractHandler {
                                        @Override\r
                                        public void perform(WriteGraph graph) throws DatabaseException {\r
                                                Variable v = Variables.getVariable(graph, exp.getResource());\r
-                                               SysdynExperiments.saveIC(graph, v, "IC");\r
+                                               SysdynExperiments.saveIC(graph, v);\r
                                        }\r
                                        \r
                                });\r
index 8d35a4ea6ecc76fe547f9fd88bd276446a2fc5cc..e1230b8a0679869a6a46dd1ed921af0d5996ff47 100644 (file)
@@ -68,7 +68,7 @@ public class ImportMdlHandler extends AbstractHandler {
                // Convert Vensim model to Simantics SysDyn format using MdlParser\r
                final Model model;\r
                try {\r
-                       model = MdlParser.parse(file);\r
+                       model = new MdlParser().parse(file);\r
                }\r
                catch (Exception e) {\r
                        e.printStackTrace();\r
index 443c9014280b00bf6fa26f426cb2a6a9d483747f..af438d9a9cf470051a744ecbd68c2ba25994f577 100644 (file)
@@ -84,7 +84,6 @@ public class ModelicaPreferencePage extends FieldEditorPreferencePage implements
 \r
                        @Override\r
                        public void doLoadDefault() {\r
-                               System.err.println("LOAD DEFAULT");\r
                                IScopeContext context = ConfigurationScope.INSTANCE;\r
                                Preferences node = context.getNode(Activator.PLUGIN_ID);\r
                                node.put(OpenModelicaPreferences.OM_HOME, ModelicaManager.getDefaultOMHome().getAbsolutePath());\r
index 741cfcc20a92ea7311409075a37a6e3090f2d767..0a2e68ecf32540d7c742f17941a3093aa6bece89 100644 (file)
@@ -408,9 +408,12 @@ public class ArrayIndexesTab extends LabelPropertyTabContributor implements Widg
             \r
             @Override\r
             public void run() {\r
-                up.getControl().setEnabled(finalEnabled);\r
-                down.getControl().setEnabled(finalEnabled);\r
-                remove.getControl().setEnabled(finalEnabled);     \r
+                if (!up.getControl().isDisposed())\r
+                    up.getControl().setEnabled(finalEnabled);\r
+                if (!down.getControl().isDisposed())\r
+                    down.getControl().setEnabled(finalEnabled);\r
+                if (!remove.getControl().isDisposed())\r
+                    remove.getControl().setEnabled(finalEnabled);     \r
             }\r
         });\r
     }\r
index 36e3fa14e3aa2d91e25ba839bb44fcbfbf736ed7..2c783b6e76a76cd72573343a6b95c4c3dc8f7ae4 100644 (file)
@@ -44,6 +44,7 @@ import org.simantics.issues.ontology.IssueResource;
 import org.simantics.jfreechart.chart.properties.AdjustableTab;\r
 import org.simantics.layer0.Layer0;\r
 import org.simantics.operation.Layer0X;\r
+import org.simantics.simulation.ontology.SimulationResource;\r
 import org.simantics.sysdyn.SysdynResource;\r
 import org.simantics.sysdyn.ui.properties.widgets.EquivalentUnitsWidget;\r
 import org.simantics.sysdyn.ui.properties.widgets.factories.ComboStringPropertyModifier;\r
@@ -69,7 +70,7 @@ public class ConfigurationTab extends AdjustableTab {
                outputIntervalLabel, methodLabel, toleranceLabel, variableFilterLabel;\r
        private TrackedText name, startTime, stopTime, stepLength, outputInterval, tolerance, variableFilter;\r
        private TrackedCombo method, timeUnit;\r
-       private Button validateUnits;\r
+       private Button validateUnits, useModelicaLibrary;\r
        private EquivalentUnitsWidget equivalentUnitsWidget;\r
     /**\r
      * Modifier for modifying model labels\r
@@ -299,6 +300,35 @@ public class ConfigurationTab extends AdjustableTab {
                        "NOTE: whitespace must be replaced with an underscore ('_') character" +\r
                        "e.g. 'Growth Rate' -> 'Growth_Rate'");\r
         \r
+        useModelicaLibrary = new Button(composite, support, SWT.CHECK);\r
+        useModelicaLibrary.setText("Use Modelica libraries");\r
+        useModelicaLibrary.setSelectionFactory(new ReadFactoryImpl<Resource, Boolean>() {\r
+\r
+            @Override\r
+            public Boolean perform(ReadGraph graph, Resource model) throws DatabaseException {\r
+               SysdynResource SR = SysdynResource.getInstance(graph);\r
+               SimulationResource SIM = SimulationResource.getInstance(graph);\r
+                Resource configuration = graph.getPossibleObject(model, SIM.HasConfiguration);\r
+                return graph.getPossibleObject(configuration, SR.SysdynModel_useModelicaLibraries) != null;\r
+            }\r
+        });\r
+        \r
+        useModelicaLibrary.addSelectionListener(new SelectionListenerImpl<Resource>(context){\r
+\r
+            @Override\r
+            public void apply(WriteGraph graph, Resource model) throws DatabaseException {\r
+               SysdynResource SR = SysdynResource.getInstance(graph);\r
+               SimulationResource SIM = SimulationResource.getInstance(graph);\r
+                Resource configuration = graph.getPossibleObject(model, SIM.HasConfiguration);\r
+                boolean useModelicaLibraries = graph.getPossibleObject(configuration, SR.SysdynModel_useModelicaLibraries) != null;\r
+\r
+                if (!useModelicaLibraries)\r
+                       graph.claim(configuration, SR.SysdynModel_useModelicaLibraries, configuration);\r
+                else\r
+                       graph.deny(configuration, SR.SysdynModel_useModelicaLibraries);\r
+            }\r
+        });\r
+        \r
         sc.setExpandHorizontal(true);\r
         sc.setExpandVertical(true);\r
        }\r
@@ -330,6 +360,7 @@ public class ConfigurationTab extends AdjustableTab {
         GridDataFactory.fillDefaults().grab(true, false).hint(50, SWT.DEFAULT).applyTo(tolerance.getWidget());\r
         GridDataFactory.fillDefaults().span(2, 1).align(SWT.BEGINNING, SWT.CENTER).applyTo(variableFilterLabel);\r
         GridDataFactory.fillDefaults().span(2, 1).grab(true, false).hint(100, SWT.DEFAULT).applyTo(variableFilter.getWidget());\r
+        GridDataFactory.fillDefaults().span(2, 1).grab(true, false).hint(100, SWT.DEFAULT).applyTo(useModelicaLibrary.getWidget());\r
         \r
         sc.setMinSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT));\r
        }\r
@@ -362,7 +393,8 @@ public class ConfigurationTab extends AdjustableTab {
         GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).applyTo(toleranceLabel);\r
         GridDataFactory.fillDefaults().grab(true, false).span(wideScreen ? 1 : 2, 1).hint(60, SWT.DEFAULT).applyTo(tolerance.getWidget());\r
         GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).applyTo(variableFilterLabel);\r
-        GridDataFactory.fillDefaults().grab(true, false).span(wideScreen ? 10 : 5, 1).hint(200, SWT.DEFAULT).applyTo(variableFilter.getWidget());\r
+        GridDataFactory.fillDefaults().grab(true, false).span(wideScreen ? 9 : 4, 1).hint(200, SWT.DEFAULT).applyTo(variableFilter.getWidget());\r
+        GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).applyTo(useModelicaLibrary.getWidget());\r
         \r
         sc.setMinSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT));\r
        }  \r
index 7514f47c6184dc6e4b8d9366667db965c77b169d..4252b6cd07c44c10b76b59216921d475a38cc957 100644 (file)
@@ -15,6 +15,10 @@ import java.util.ArrayList;
 import java.util.HashSet;\r
 import java.util.List;\r
 \r
+import org.eclipse.core.runtime.IProgressMonitor;\r
+import org.eclipse.core.runtime.IStatus;\r
+import org.eclipse.core.runtime.Status;\r
+import org.eclipse.core.runtime.jobs.Job;\r
 import org.eclipse.jface.layout.GridDataFactory;\r
 import org.eclipse.jface.layout.GridLayoutFactory;\r
 import org.eclipse.jface.viewers.ISelectionProvider;\r
@@ -29,7 +33,9 @@ import org.eclipse.swt.widgets.Listener;
 import org.eclipse.swt.widgets.Tree;\r
 import org.eclipse.swt.widgets.TreeItem;\r
 import org.eclipse.ui.IWorkbenchSite;\r
+import org.simantics.Simantics;\r
 import org.simantics.browsing.ui.NodeContext;\r
+import org.simantics.browsing.ui.common.ColumnKeys;\r
 import org.simantics.browsing.ui.swt.SingleSelectionInputSource;\r
 import org.simantics.browsing.ui.swt.widgets.Button;\r
 import org.simantics.browsing.ui.swt.widgets.GraphExplorerComposite;\r
@@ -47,6 +53,7 @@ import org.simantics.db.common.request.WriteRequest;
 import org.simantics.db.common.utils.ListUtils;\r
 import org.simantics.db.common.utils.NameUtils;\r
 import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.util.Layer0Utils;\r
 import org.simantics.db.layer0.variable.Variable;\r
 import org.simantics.db.layer0.variable.Variables;\r
 import org.simantics.db.management.ISessionContext;\r
@@ -62,8 +69,8 @@ import org.simantics.sysdyn.ui.properties.widgets.arrays.EnumerationIndexNode;
 import org.simantics.sysdyn.ui.properties.widgets.arrays.ReplaceableIndexesWidget;\r
 import org.simantics.sysdyn.ui.properties.widgets.factories.VariableNameInputValidator;\r
 import org.simantics.sysdyn.ui.properties.widgets.factories.VariableNamePropertyModifier;\r
-import org.simantics.ui.SimanticsUI;\r
 import org.simantics.utils.datastructures.ArrayMap;\r
+import org.simantics.utils.threads.SWTThread;\r
 import org.simantics.utils.ui.AdaptionUtils;\r
 \r
 public class EnumerationTab extends LabelPropertyTabContributor implements Widget {\r
@@ -78,6 +85,10 @@ public class EnumerationTab extends LabelPropertyTabContributor implements Widge
        Variable variable;\r
        \r
        Table table;\r
+\r
+    private Button add;\r
+    private Button remove;\r
+    \r
        @Override\r
        public void createControls(Composite body, IWorkbenchSite site,\r
                        final ISessionContext context, WidgetSupport support) {\r
@@ -97,6 +108,8 @@ public class EnumerationTab extends LabelPropertyTabContributor implements Widge
         indexExplorer = new GraphExplorerComposite(ArrayMap.keys(\r
                                "displaySelectors", "displayFilter").values(false, false), site, container, support, SWT.FULL_SELECTION | SWT.BORDER | SWT.MULTI | SWT.CHECK);\r
                \r
+        indexExplorer.setContextMenuId("#EnumerationTabPopup");\r
+        \r
         indexExplorer\r
                .setBrowseContexts(SysdynResource.URIs.EnumerationIndexes);\r
         indexExplorer.setInputSource(new SingleSelectionInputSource(\r
@@ -112,7 +125,7 @@ public class EnumerationTab extends LabelPropertyTabContributor implements Widge
                     final EnumerationIndexNode node = (EnumerationIndexNode) context.getAdapter(EnumerationIndexNode.class);\r
                     node.setShowInChartsSelected(checked);\r
                     \r
-                    SimanticsUI.getSession().asyncRequest(new ReadRequest() {\r
+                    Simantics.getSession().asyncRequest(new ReadRequest() {\r
                                                @Override\r
                                                public void run(ReadGraph graph) throws DatabaseException {\r
                                                        updateModelResults(graph);\r
@@ -122,7 +135,7 @@ public class EnumerationTab extends LabelPropertyTabContributor implements Widge
             }\r
         });\r
         \r
-\r
+        \r
         indexExplorer.finish();\r
 \r
                GridDataFactory.fillDefaults().grab(true, true).span(4, 1).applyTo(\r
@@ -133,13 +146,13 @@ public class EnumerationTab extends LabelPropertyTabContributor implements Widge
                        ((Tree) c).setLinesVisible(true);\r
 \r
 \r
-               final Button add = new Button(container, support, SWT.None);\r
+               add = new Button(container, support, SWT.None);\r
                add.setText("Add");\r
-               add.addSelectionListener(new addEnumerationIndexListener(support));\r
+               add.addSelectionListener(new AddEnumerationIndexListener(support));\r
 \r
-               final Button remove = new Button(container, support, SWT.None);\r
+               remove = new Button(container, support, SWT.None);\r
                remove.setText("Remove");\r
-               remove.addSelectionListener(new removeEnumerationIndexListener(support));\r
+               remove.addSelectionListener(new RemoveEnumerationIndexListener(support));\r
                \r
                ReplaceableIndexesWidget externalIndexes = new ReplaceableIndexesWidget(container, support, SWT.NULL);\r
                GridDataFactory.fillDefaults().applyTo(externalIndexes.getWidget());\r
@@ -150,11 +163,11 @@ public class EnumerationTab extends LabelPropertyTabContributor implements Widge
                \r
        }\r
 \r
-       private class addEnumerationIndexListener implements SelectionListener, Widget {\r
+       private class AddEnumerationIndexListener implements SelectionListener, Widget {\r
 \r
                Resource enumerationIndexes;\r
 \r
-               public addEnumerationIndexListener(WidgetSupport support) {\r
+               public AddEnumerationIndexListener(WidgetSupport support) {\r
                        support.register(this);\r
                }\r
 \r
@@ -177,10 +190,15 @@ public class EnumerationTab extends LabelPropertyTabContributor implements Widge
                @Override\r
                public void widgetSelected(SelectionEvent e) {\r
                        try {\r
-                               SimanticsUI.getSession().syncRequest(new WriteRequest() {\r
+                           \r
+                           currentItemCount = getCurrentItemCount();\r
+                           lastItemCount = currentItemCount;\r
+                           \r
+                               Simantics.getSession().syncRequest(new WriteRequest() {\r
 \r
                                        @Override\r
                                        public void perform(WriteGraph graph) throws DatabaseException {\r
+                                           graph.markUndoPoint();\r
                                                SysdynResource sr = SysdynResource.getInstance(graph);\r
                                                Layer0 l0 = Layer0.getInstance(graph);\r
                                                \r
@@ -195,8 +213,17 @@ public class EnumerationTab extends LabelPropertyTabContributor implements Widge
                                                ArrayList<Resource> index = new ArrayList<Resource>();\r
                                                index.add(ei);\r
                                                ListUtils.insertBack(graph, enumerationIndexes, index);\r
+                                               \r
+                        List<Resource> list = ListUtils.toList(graph, enumerationIndexes);\r
+                        if (!list.isEmpty())\r
+                            updateRemoveButton(true);\r
+                                               \r
+                                               Layer0Utils.addCommentMetadata(graph, "Added new Enumeration Index " + NameUtils.getSafeName(graph, ei) + " to " + enumerationIndexes);\r
                                        }\r
                                });\r
+                               \r
+                               enableItemForRename();\r
+                               \r
                        } catch (DatabaseException e1) {\r
                                e1.printStackTrace();\r
                        }\r
@@ -205,16 +232,16 @@ public class EnumerationTab extends LabelPropertyTabContributor implements Widge
 \r
                @Override\r
                public void widgetDefaultSelected(SelectionEvent e) {\r
-\r
+                   System.out.println("asd");\r
                }\r
 \r
        }\r
 \r
-       private class removeEnumerationIndexListener implements SelectionListener, Widget {\r
+       private class RemoveEnumerationIndexListener implements SelectionListener, Widget {\r
 \r
                Resource enumerationIndexes;\r
 \r
-               public removeEnumerationIndexListener(WidgetSupport support) {\r
+               public RemoveEnumerationIndexListener(WidgetSupport support) {\r
                        support.register(this);\r
                }\r
 \r
@@ -227,6 +254,9 @@ public class EnumerationTab extends LabelPropertyTabContributor implements Widge
                                        @Override\r
                                        public void run(ReadGraph graph) throws DatabaseException {\r
                                                enumerationIndexes = graph.getSingleObject(enumeration, SysdynResource.getInstance(graph).Enumeration_enumerationIndexList);\r
+                                               List<Resource> list = ListUtils.toList(graph, enumerationIndexes);\r
+                                               if (list.isEmpty())\r
+                                                   updateRemoveButton(false);\r
                                        }\r
                                });\r
                        } catch (DatabaseException e) {\r
@@ -240,16 +270,21 @@ public class EnumerationTab extends LabelPropertyTabContributor implements Widge
                        final IStructuredSelection selection = (IStructuredSelection)selectionProvider.getSelection();\r
 \r
                        try {\r
-                               SimanticsUI.getSession().syncRequest(new WriteRequest() {\r
+                               Simantics.getSession().syncRequest(new WriteRequest() {\r
 \r
                                        @Override\r
                                        public void perform(WriteGraph graph) throws DatabaseException {\r
+                                           graph.markUndoPoint();\r
                                                for(Object o : selection.toList()) {\r
                                                        Resource r = AdaptionUtils.adaptToSingle(o, Resource.class);\r
                                                        if(r == null)\r
                                                                continue;\r
                                                        ListUtils.removeElement(graph, enumerationIndexes, r);\r
                                                }\r
+                                               List<Resource> list = ListUtils.toList(graph, enumerationIndexes);\r
+                                               if (list.isEmpty())\r
+                                                   updateRemoveButton(false);\r
+                                               Layer0Utils.addCommentMetadata(graph, "Removed Enumeration Index " );\r
                                        }\r
                                });\r
                        } catch (DatabaseException e1) {\r
@@ -331,10 +366,11 @@ public class EnumerationTab extends LabelPropertyTabContributor implements Widge
                        public void widgetSelected(SelectionEvent e) {\r
                                final boolean selected = showAll.getWidget().getSelection();\r
                                try {\r
-                                       SimanticsUI.getSession().syncRequest(new WriteRequest() {\r
+                                       Simantics.getSession().syncRequest(new WriteRequest() {\r
 \r
                                                @Override\r
                                                public void perform(WriteGraph graph) throws DatabaseException {\r
+                                                   graph.markUndoPoint();\r
                                                        SysdynResource sr = SysdynResource.getInstance(graph);\r
                                                        List<Resource> indexes = ListUtils.toList(graph, enumerationIndexes);\r
                                                        for(Resource index : indexes) {\r
@@ -345,7 +381,7 @@ public class EnumerationTab extends LabelPropertyTabContributor implements Widge
                                                                        graph.claimLiteral(index, sr.EnumerationIndex_showEnumerationIndexInCharts, false, Bindings.BOOLEAN);\r
                                                                }\r
                                                        }\r
-                                                       \r
+                                                       Layer0Utils.addCommentMetadata(graph, "Modified Show all in charts");\r
                                                        updateModelResults(graph);\r
                                                }\r
                                        });\r
@@ -385,4 +421,87 @@ public class EnumerationTab extends LabelPropertyTabContributor implements Widge
        public void setInput(ISessionContext context, Object input) {\r
                variable = AdaptionUtils.adaptToSingle(input, Variable.class);\r
        }\r
+       \r
+       private void updateRemoveButton(final boolean enable) {\r
+           SWTThread.getThreadAccess().asyncExec(new Runnable() {\r
+            \r
+            @Override\r
+            public void run() {\r
+                remove.getWidget().setEnabled(enable);\r
+                if (!enable)\r
+                    add.getWidget().setFocus();\r
+            }\r
+        });\r
+       }\r
+       \r
+       private int currentItemCount = 0;\r
+       private int lastItemCount = 0;\r
+       \r
+       private void enableItemForRename() {\r
+           \r
+           \r
+           \r
+           Job j = new Job("") {\r
+\r
+            @Override\r
+            protected IStatus run(IProgressMonitor monitor) {\r
+                \r
+                while (lastItemCount == currentItemCount) {\r
+                    SWTThread.getThreadAccess().syncExec(new Runnable() {\r
+\r
+                        @Override\r
+                        public void run() {\r
+                            lastItemCount = getCurrentItemCount();\r
+                        }\r
+                    });\r
+                    try {\r
+                        Thread.sleep(50);\r
+                    } catch (InterruptedException e) {\r
+                        e.printStackTrace();\r
+                    }\r
+                }\r
+                \r
+                SWTThread.getThreadAccess().syncExec(new Runnable() {\r
+                    \r
+                    @Override\r
+                    public void run() {\r
+                        Control c = indexExplorer.getExplorer().getControl();\r
+                        if (c instanceof Tree) {\r
+                            Tree tree = (Tree) c;    \r
+                            TreeItem[] items = tree.getItems();\r
+                            TreeItem lastItem = items[items.length - 1];\r
+                            tree.setSelection(lastItem);\r
+                        }\r
+                    }\r
+                });\r
+                \r
+                SWTThread.getThreadAccess().syncExec(new Runnable() {\r
+                    \r
+                    @Override\r
+                    public void run() {\r
+                        Control c = indexExplorer.getExplorer().getControl();\r
+                        if (c instanceof Tree) {\r
+                            Tree tree = (Tree) c;    \r
+                            TreeItem[] items = tree.getItems();\r
+                            TreeItem lastItem = items[items.length - 1];\r
+                            NodeContext context = (NodeContext)lastItem.getData();\r
+                            tree.setSelection(lastItem);\r
+                            indexExplorer.getExplorer().startEditing(context, ColumnKeys.SINGLE); \r
+                            tree.setSelection(lastItem);\r
+                        }\r
+                    }\r
+                });\r
+                \r
+                return Status.OK_STATUS;\r
+            }\r
+           };\r
+           j.schedule();\r
+       }\r
+       \r
+       public int getCurrentItemCount() {\r
+        Control c = indexExplorer.getExplorer().getControl();\r
+        Tree tree = (Tree) c;    \r
+        return tree.getItemCount();\r
+       }\r
 }\r
+\r
index 4d45a5cbad577d80891f6d51d3b3f8b674d1c4ba..4072c806ab87e332bfc7b4d5555bafe40bd2314d 100644 (file)
@@ -504,6 +504,7 @@ public class EquationTab extends AdjustableTab implements Widget {
                                } else {\r
                                    // If there was no active expression, create a normal expression\r
                                        graph.claim(newExpression, l0.InstanceOf, sr.NormalExpression);\r
+                                       graph.claimLiteral(newExpression, sr.Expression_equation, "");\r
                                        Layer0Utils.addCommentMetadata(graph, "Created new Normal Expression " + newExpression + " for " + graph.getPossibleRelatedValue2(input, Layer0.getInstance(graph).HasName, Bindings.STRING));\r
                                }\r
                                ArrayList<Resource> addition = new ArrayList<Resource>(1);\r
index db9a513fde029e4b89e5ee308ca9374a56a05931..40fe24cb1804411daf9ada97cc4b3271adc5832e 100644 (file)
@@ -16,6 +16,7 @@ import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.swt.SWT;\r
 import org.eclipse.swt.widgets.Button;\r
 import org.eclipse.swt.widgets.Composite;\r
+import org.simantics.browsing.ui.swt.widgets.impl.ReadFactoryImpl;\r
 import org.simantics.browsing.ui.swt.widgets.impl.SelectionListenerImpl;\r
 import org.simantics.browsing.ui.swt.widgets.impl.Widget;\r
 import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport;\r
@@ -23,7 +24,6 @@ import org.simantics.databoard.Bindings;
 import org.simantics.db.ReadGraph;\r
 import org.simantics.db.Resource;\r
 import org.simantics.db.WriteGraph;\r
-import org.simantics.db.common.request.ReadRequest;\r
 import org.simantics.db.exception.DatabaseException;\r
 import org.simantics.db.layer0.util.Layer0Utils;\r
 import org.simantics.db.management.ISessionContext;\r
@@ -39,6 +39,14 @@ public class IsOutputWidget implements Widget{
     public IsOutputWidget(Composite parent, WidgetSupport support, int style) {\r
         support.register(this);\r
         isOutputButton = new org.simantics.browsing.ui.swt.widgets.Button(parent, support, style |= SWT.CHECK);\r
+        isOutputButton.setSelectionFactory(new ReadFactoryImpl<Resource, Boolean>() {\r
+\r
+            @Override\r
+            public Boolean perform(ReadGraph graph, Resource input) throws DatabaseException {\r
+                SysdynResource sr = SysdynResource.getInstance(graph);\r
+                return graph.hasStatement(variable, sr.IsOutput);\r
+            }\r
+        });\r
         isOutputButton.setText("Is Output");\r
     }\r
 \r
@@ -56,34 +64,8 @@ public class IsOutputWidget implements Widget{
         \r
         if(variable == null) return;\r
         \r
-        try {\r
-            context.getSession().syncRequest(new ReadRequest() {\r
-                \r
-                @Override\r
-                public void run(ReadGraph graph) throws DatabaseException {\r
-                    SysdynResource sr = SysdynResource.getInstance(graph);\r
-                    final boolean isOutput = graph.hasStatement(variable, sr.IsOutput);\r
-                    final Button button = getWidget();\r
-                    button.getDisplay().asyncExec(new Runnable() {\r
-                        \r
-                        @Override\r
-                        public void run() {\r
-                            if(button.isDisposed()) return;\r
-                            \r
-                            if(isOutput)\r
-                                button.setSelection(true);\r
-                            else\r
-                                button.setSelection(false);\r
-                        }\r
-                    });\r
+        isOutputButton.setInput(context, input);\r
 \r
-                        \r
-                }\r
-            });\r
-        } catch (DatabaseException e) {\r
-            e.printStackTrace();\r
-        }\r
-        \r
         isOutputButton.addSelectionListener(new SelectionListenerImpl<Resource>(context) {\r
 \r
             @Override\r
index ff7b7021f570ccb8a2434eacc86d2b305e5ac013..b2ca447bdb556b7d77cbbe1fe31725851eadd2d9 100644 (file)
@@ -1,5 +1,6 @@
 package org.simantics.sysdyn.ui.properties.widgets.arrays;\r
 \r
+import org.simantics.Simantics;\r
 import org.simantics.browsing.ui.common.node.AbstractNode;\r
 import org.simantics.browsing.ui.common.node.IDoubleClickableNode;\r
 import org.simantics.browsing.ui.common.node.IModifiableNode;\r
@@ -8,12 +9,13 @@ import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;\r
 import org.simantics.db.WriteGraph;\r
 import org.simantics.db.common.request.WriteRequest;\r
+import org.simantics.db.common.utils.NameUtils;\r
 import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.util.Layer0Utils;\r
 import org.simantics.db.request.Read;\r
 import org.simantics.layer0.Layer0;\r
 import org.simantics.sysdyn.SysdynResource;\r
 import org.simantics.sysdyn.ui.utils.VariableNameValidator;\r
-import org.simantics.ui.SimanticsUI;\r
 \r
 public class EnumerationIndexNode  extends AbstractNode<Resource> implements IModifiableNode, IDoubleClickableNode {\r
 \r
@@ -38,7 +40,7 @@ public class EnumerationIndexNode  extends AbstractNode<Resource> implements IMo
 \r
                 };\r
                 try {\r
-                    return SimanticsUI.getSession().syncRequest(request);\r
+                    return Simantics.getSession().syncRequest(request);\r
                 } catch (DatabaseException e) {\r
                     e.printStackTrace();\r
                     return "";\r
@@ -54,7 +56,7 @@ public class EnumerationIndexNode  extends AbstractNode<Resource> implements IMo
 \r
             @Override\r
             public void modify(final String label) {\r
-               SimanticsUI.getSession().asyncRequest(new WriteRequest() {\r
+               Simantics.getSession().asyncRequest(new WriteRequest() {\r
                     @Override\r
                     public void perform(WriteGraph graph) throws DatabaseException {\r
                         graph.claimLiteral(data, Layer0.getInstance(graph).HasName, label);\r
@@ -78,11 +80,13 @@ public class EnumerationIndexNode  extends AbstractNode<Resource> implements IMo
        \r
        public void setShowInChartsSelected(final boolean selected) {\r
        try {\r
-                       SimanticsUI.getSession().syncRequest(new WriteRequest() {\r
+                       Simantics.getSession().syncRequest(new WriteRequest() {\r
                            @Override\r
                            public void perform(WriteGraph graph) throws DatabaseException {\r
+                               graph.markUndoPoint();\r
                                SysdynResource sr = SysdynResource.getInstance(graph);\r
                                graph.claimLiteral(data, sr.EnumerationIndex_showEnumerationIndexInCharts, selected);\r
+                               Layer0Utils.addCommentMetadata(graph, "Modified show in chart of " + NameUtils.getSafeName(graph, data) +  " to " + selected);\r
                            }\r
                        });\r
                } catch (DatabaseException e) {\r
index 0dd0a49a46e977bb422194b63f2e32cea1c7808f..d5403ac984dcf2f1d5a25e4f30284d6bb6f17a30 100644 (file)
@@ -17,14 +17,16 @@ import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionListener;\r
 import org.eclipse.swt.widgets.Button;\r
 import org.eclipse.swt.widgets.Composite;\r
+import org.simantics.browsing.ui.swt.widgets.impl.ReadFactoryImpl;\r
 import org.simantics.browsing.ui.swt.widgets.impl.SelectionListenerImpl;\r
 import org.simantics.browsing.ui.swt.widgets.impl.Widget;\r
 import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport;\r
 import org.simantics.db.ReadGraph;\r
 import org.simantics.db.Resource;\r
 import org.simantics.db.WriteGraph;\r
-import org.simantics.db.common.request.ReadRequest;\r
+import org.simantics.db.common.utils.NameUtils;\r
 import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.util.Layer0Utils;\r
 import org.simantics.db.management.ISessionContext;\r
 import org.simantics.sysdyn.SysdynResource;\r
 import org.simantics.utils.ui.ISelectionUtils;\r
@@ -38,6 +40,14 @@ public class ReplaceableIndexesWidget implements Widget {
     public ReplaceableIndexesWidget(Composite parent, WidgetSupport support, int style) {\r
         support.register(this);\r
         isReplaceableButton = new org.simantics.browsing.ui.swt.widgets.Button(parent, support, style |= SWT.CHECK);\r
+        isReplaceableButton.setSelectionFactory(new ReadFactoryImpl<Resource, Boolean>() {\r
+\r
+            @Override\r
+            public Boolean perform(ReadGraph graph, Resource input) throws DatabaseException {\r
+                SysdynResource sr = SysdynResource.getInstance(graph);\r
+                return graph.getPossibleRelatedValue(variable, sr.Enumeration_isReplaceable);\r
+            }\r
+        });\r
         isReplaceableButton.setText("Can be replaced by parent module");\r
     }\r
 \r
@@ -55,35 +65,7 @@ public class ReplaceableIndexesWidget implements Widget {
         \r
         if(variable == null) return;\r
         \r
-        try {\r
-            context.getSession().syncRequest(new ReadRequest() {\r
-                \r
-                @Override\r
-                public void run(ReadGraph graph) throws DatabaseException {\r
-                    SysdynResource sr = SysdynResource.getInstance(graph);\r
-                    final Boolean replaceable = graph.getPossibleRelatedValue(variable, sr.Enumeration_isReplaceable);\r
-                    if(replaceable != null)\r
-                       selected = replaceable;\r
-                    final Button button = getWidget();\r
-                    button.getDisplay().asyncExec(new Runnable() {\r
-                        \r
-                        @Override\r
-                        public void run() {\r
-                            if(button.isDisposed()) return;\r
-                            \r
-                            if(replaceable)\r
-                                button.setSelection(true);\r
-                            else\r
-                                button.setSelection(false);\r
-                        }\r
-                    });\r
-\r
-                        \r
-                }\r
-            });\r
-        } catch (DatabaseException e) {\r
-            e.printStackTrace();\r
-        }\r
+        isReplaceableButton.setInput(context, input);\r
         \r
         isReplaceableButton.addSelectionListener(new SelectionListenerImpl<Resource>(context) {\r
 \r
@@ -98,6 +80,7 @@ public class ReplaceableIndexesWidget implements Widget {
                        graph.claimLiteral(input, sr.Enumeration_isReplaceable, true);\r
                        selected = true;\r
                 }\r
+                Layer0Utils.addCommentMetadata(graph, "Modified " + NameUtils.getSafeName(graph, input) + " can be replaced to " + selected);\r
             }\r
         });\r
     }\r
index 25d7090baf18db830f42b8ae2aa073c78deea8ac..ff352c72a8343a4540d487cd3ca7ab8dc40c6591 100644 (file)
@@ -113,8 +113,8 @@ public abstract class NameValidator {
                // Function, FunctionLibrary, and SharedFunctionLibrary are not\r
                // allowed to have whitespace.\r
                if (graph.isInstanceOf(resource, sr.Variable)\r
-//                                     || graph.isInstanceOf(resource, sr.Module)\r
-//                                     || graph.isInstanceOf(resource, sr.ModuleType)\r
+                                       || graph.isInstanceOf(resource, sr.Module)\r
+                                       || graph.isInheritedFrom(resource, sr.ModuleSymbol)\r
                                        || graph.isInstanceOf(resource, sr.Enumeration)\r
                                        || graph.isInstanceOf(resource, sr.EnumerationIndex)\r
                                        || graph.isInstanceOf(resource, sheet.Spreadsheet)\r
index 93766ed45e7c21e676f993d1a0240696deb080d7..d4679f7d44c500f886b5c2c618d91436f7828a9d 100644 (file)
@@ -183,7 +183,7 @@ public class WizardMdlImportPage extends WizardPage{
                final Model model;\r
                \r
                try {\r
-                       model = MdlParser.parse(file);\r
+                       model = new MdlParser().parse(file);\r
                }\r
                catch (Exception e) {\r
                        e.printStackTrace();\r