]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Model browser changed to use AbstractNode from browsing
authorjplaine <jplaine@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Mon, 23 Aug 2010 14:49:04 +0000 (14:49 +0000)
committerjplaine <jplaine@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Mon, 23 Aug 2010 14:49:04 +0000 (14:49 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@17477 ac1ea38d-2e2b-0410-8846-a27921b304fc

38 files changed:
org.simantics.sysdyn.feature/feature.xml
org.simantics.sysdyn.ui/META-INF/MANIFEST.MF
org.simantics.sysdyn.ui/adapters.xml
org.simantics.sysdyn.ui/plugin.xml
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/Activator.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/SysdynBrowser.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/AbstractNodeImager.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/AbstractNodeLabeler.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/Configuration.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/Experiment.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/ExperimentLabelDecorator.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/ExperimentLabeler.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/InputLabeler.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/Model.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/ModelLabeler.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/Module.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/ModuleLabeler.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/ModuleTypeLabeler.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/Modules.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/SimulationResult.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/SimulationResultDecorator.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/SimulationResultImager.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/SimulationResultLabeler.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/VariableLabeler.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/AbstractNode.java [deleted file]
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ConfigurationNode.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ExperimentNode.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ExperimentsFolder.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/InputNode.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ModelNode.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ModuleNode.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ModuleTypeNode.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ModulesNode.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/OperatingInterfacesFolder.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/SimulationResultNode.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/SymbolNode.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/VariableNode.java

index e39c000fc2f17a1bfc0865b6ecbf523e6808e827..0e9fa1b24d739eeb4427d1167c4df14f226a1bcd 100644 (file)
          version="0.0.0"\r
          unpack="false"/>\r
 \r
+   <plugin\r
+         id="org.simantics.operating"\r
+         download-size="0"\r
+         install-size="0"\r
+         version="0.0.0"\r
+         unpack="false"/>\r
+\r
+   <plugin\r
+         id="org.simantics.operating.ontology"\r
+         download-size="0"\r
+         install-size="0"\r
+         version="0.0.0"\r
+         unpack="false"/>\r
+\r
 </feature>\r
index 4cf234890af79a6b37f9f874b40e3a84af31bf07..474c0076a1fd92af01513402067553d2de41eb27 100644 (file)
@@ -39,3 +39,4 @@ Require-Bundle: org.simantics.layer0.utils;bundle-version="0.6.2",
  org.simantics.diagram.ontology;bundle-version="1.0.0"
 Bundle-Activator: org.simantics.sysdyn.ui.Activator
 Bundle-ActivationPolicy: lazy
+Export-Package: org.simantics.sysdyn.ui.browser.nodes
index 310044e4c6786b20835d71e8879e6e3b3b25fc06..93d76d28e037d29033e3823c9d9bd4cfb61cc7db 100644 (file)
@@ -16,5 +16,5 @@
                <resource\r
                        uri="http://www.simantics.org/Sysdyn-1.0/SysdynProject"\r
                        class="org.simantics.sysdyn.ui.project.SysdynProject" />\r
-               <resource\r                      uri="http://www.simantics.org/Sysdyn-1.0/SysdynModelManager"\r                   class="org.simantics.sysdyn.ui.project.SysdynProject" />\r       </target>\r      \r       <target interface="org.simantics.project.IProjectLifecycle">\r           <resource\r                      uri="http://www.simantics.org/Sysdyn-1.0/SysdynProject"\r                        class="org.simantics.sysdyn.ui.project.SysdynProjectLifeCycle" />\r      </target>\r      \r       <target\r                interface="org.simantics.sysdyn.ui.browser.nodes.AbstractNode">\r                <type\r                  uri="http://www.simantics.org/Sysdyn-1.0/SysdynModel"\r                  class="org.simantics.sysdyn.ui.browser.nodes.ModelNode">\r                       <this />\r               </type>\r                \r               <type\r                  uri="http://www.simantics.org/Sysdyn-1.0/IndependentVariable"\r                  class="org.simantics.sysdyn.ui.browser.nodes.VariableNode">\r                    <this />\r               </type>\r                \r               <type\r                  uri="http://www.simantics.org/Sysdyn-1.0/Input"\r                        class="org.simantics.sysdyn.ui.browser.nodes.InputNode">\r                       <this />\r               </type>\r                \r               <type\r                  uri="http://www.simantics.org/Sysdyn-1.0/Module"\r                       class="org.simantics.sysdyn.ui.browser.nodes.ModuleNode">\r                      <this />\r               </type>\r                \r               <resource\r                      uri="http://www.simantics.org/Sysdyn-1.0/Module"\r                       class="org.simantics.sysdyn.ui.browser.nodes.ModuleTypeNode">\r                  <this />\r               </resource>\r\r           <resource\r                      uri="http://www.simantics.org/Sysdyn-1.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-1.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-1.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-1.0/ConfigurationDiagram"\r                        adapterClass="org.simantics.sysdyn.ui.elements2.ConfigurationDiagramClassAdapter" />\r   </target>\r\r     <!-- Sysdyn symbols -->\r        <target interface="org.simantics.diagram.adapter.ElementFactory">\r              <resource uri="http://www.simantics.org/Sysdyn-1.0/StockSymbol"\r                        class="org.simantics.sysdyn.ui.elements2.StockFactory" />\r              <resource uri="http://www.simantics.org/Sysdyn-1.0/ModuleSymbol"\r                       class="org.simantics.sysdyn.ui.elements2.ModuleFactory" />\r             <resource uri="http://www.simantics.org/Sysdyn-1.0/ValveSymbol"\r                        class="org.simantics.sysdyn.ui.elements2.ValveFactory" />\r              <resource uri="http://www.simantics.org/Sysdyn-1.0/AuxiliarySymbol"\r                    class="org.simantics.sysdyn.ui.elements2.AuxiliaryFactory" />\r          <resource uri="http://www.simantics.org/Sysdyn-1.0/CloudSymbol"\r                        class="org.simantics.sysdyn.ui.elements2.CloudFactory" />\r              <resource uri="http://www.simantics.org/Sysdyn-1.0/InputSymbol"\r                        class="org.simantics.sysdyn.ui.elements2.InputFactory" />\r\r             <type uri="http://www.simantics.org/Sysdyn-1.0/StockSymbol"\r                    class="org.simantics.sysdyn.ui.elements2.StockFactory" />\r              <type uri="http://www.simantics.org/Sysdyn-1.0/ModuleSymbol"\r                   class="org.simantics.sysdyn.ui.elements2.ModuleFactory" />\r             <type uri="http://www.simantics.org/Sysdyn-1.0/ValveSymbol"\r                    class="org.simantics.sysdyn.ui.elements2.ValveFactory" />\r              <type uri="http://www.simantics.org/Sysdyn-1.0/AuxiliarySymbol"\r                        class="org.simantics.sysdyn.ui.elements2.AuxiliaryFactory" />\r          <type uri="http://www.simantics.org/Sysdyn-1.0/CloudSymbol"\r                    class="org.simantics.sysdyn.ui.elements2.CloudFactory" />\r              <type uri="http://www.simantics.org/Sysdyn-1.0/InputSymbol"\r                    class="org.simantics.sysdyn.ui.elements2.InputFactory" />                       \r       </target>\r      \r       <!-- Sysdyn connections -->\r    <target interface="org.simantics.diagram.adapter.ElementFactory">\r              <!-- Edges -->\r         <resource uri="http://www.simantics.org/Sysdyn-1.0/FlowConnection"\r                     class="org.simantics.sysdyn.ui.elements2.connections.FlowEdgeFactory" />\r               <resource uri="http://www.simantics.org/Sysdyn-1.0/DependencyConnection"\r                       class="org.simantics.sysdyn.ui.elements2.connections.DependencyEdgeFactory" />\r         <type uri="http://www.simantics.org/Sysdyn-1.0/FlowConnection"\r                 class="org.simantics.sysdyn.ui.elements2.connections.FlowEdgeFactory" />\r               <type uri="http://www.simantics.org/Sysdyn-1.0/DependencyConnection"\r                   class="org.simantics.sysdyn.ui.elements2.connections.DependencyEdgeFactory" />\r         <!-- : SYSDYN.Connection-->\r            <type uri="http://www.simantics.org/Sysdyn-1.0/FlowConnection"\r                 class="org.simantics.sysdyn.ui.elements2.connections.FlowConnectionFactory" />\r         <type uri="http://www.simantics.org/Sysdyn-1.0/DependencyConnection"\r                   class="org.simantics.sysdyn.ui.elements2.connections.DependencyConnectionFactory" />\r   </target>\r      \r       <target interface="org.simantics.g2d.connection.EdgeVisualsConfigurer">\r          <baseType uri="http://www.simantics.org/Diagram-2.0/HasConnector" />\r   <resource uri="http://www.simantics.org/Diagram-2.0/HasPlainConnector"\r          class="org.simantics.diagram.content.ArrowConfigurer">\r         <string>none 0</string>\r       </resource>\r    <resource uri="http://www.simantics.org/Diagram-2.0/HasArrowConnector"\r          class="org.simantics.diagram.content.ArrowConfigurer">\r         <string>fill 1</string>\r       </resource>\r  </target>\r      \r
+               <resource\r                      uri="http://www.simantics.org/Sysdyn-1.0/SysdynModelManager"\r                   class="org.simantics.sysdyn.ui.project.SysdynProject" />\r       </target>\r      \r       <target interface="org.simantics.project.IProjectLifecycle">\r           <resource\r                      uri="http://www.simantics.org/Sysdyn-1.0/SysdynProject"\r                        class="org.simantics.sysdyn.ui.project.SysdynProjectLifeCycle" />\r      </target>\r      \r       <target\r                interface="org.simantics.browsing.ui.common.node.AbstractNode">\r                <type\r                  uri="http://www.simantics.org/Sysdyn-1.0/SysdynModel"\r                  class="org.simantics.sysdyn.ui.browser.nodes.ModelNode">\r                       <this />\r               </type>\r                \r               <type\r                  uri="http://www.simantics.org/Sysdyn-1.0/IndependentVariable"\r                  class="org.simantics.sysdyn.ui.browser.nodes.VariableNode">\r                    <this />\r               </type>\r                \r               <type\r                  uri="http://www.simantics.org/Sysdyn-1.0/Input"\r                        class="org.simantics.sysdyn.ui.browser.nodes.InputNode">\r                       <this />\r               </type>\r                \r               <type\r                  uri="http://www.simantics.org/Sysdyn-1.0/Module"\r                       class="org.simantics.sysdyn.ui.browser.nodes.ModuleNode">\r                      <this />\r               </type>\r                \r               <resource\r                      uri="http://www.simantics.org/Sysdyn-1.0/Module"\r                       class="org.simantics.sysdyn.ui.browser.nodes.ModuleTypeNode">\r                  <this />\r               </resource>\r\r           <resource\r                      uri="http://www.simantics.org/Sysdyn-1.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-1.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-1.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-1.0/ConfigurationDiagram"\r                        adapterClass="org.simantics.sysdyn.ui.elements2.ConfigurationDiagramClassAdapter" />\r   </target>\r\r     <!-- Sysdyn symbols -->\r        <target interface="org.simantics.diagram.adapter.ElementFactory">\r              <resource uri="http://www.simantics.org/Sysdyn-1.0/StockSymbol"\r                        class="org.simantics.sysdyn.ui.elements2.StockFactory" />\r              <resource uri="http://www.simantics.org/Sysdyn-1.0/ModuleSymbol"\r                       class="org.simantics.sysdyn.ui.elements2.ModuleFactory" />\r             <resource uri="http://www.simantics.org/Sysdyn-1.0/ValveSymbol"\r                        class="org.simantics.sysdyn.ui.elements2.ValveFactory" />\r              <resource uri="http://www.simantics.org/Sysdyn-1.0/AuxiliarySymbol"\r                    class="org.simantics.sysdyn.ui.elements2.AuxiliaryFactory" />\r          <resource uri="http://www.simantics.org/Sysdyn-1.0/CloudSymbol"\r                        class="org.simantics.sysdyn.ui.elements2.CloudFactory" />\r              <resource uri="http://www.simantics.org/Sysdyn-1.0/InputSymbol"\r                        class="org.simantics.sysdyn.ui.elements2.InputFactory" />\r\r             <type uri="http://www.simantics.org/Sysdyn-1.0/StockSymbol"\r                    class="org.simantics.sysdyn.ui.elements2.StockFactory" />\r              <type uri="http://www.simantics.org/Sysdyn-1.0/ModuleSymbol"\r                   class="org.simantics.sysdyn.ui.elements2.ModuleFactory" />\r             <type uri="http://www.simantics.org/Sysdyn-1.0/ValveSymbol"\r                    class="org.simantics.sysdyn.ui.elements2.ValveFactory" />\r              <type uri="http://www.simantics.org/Sysdyn-1.0/AuxiliarySymbol"\r                        class="org.simantics.sysdyn.ui.elements2.AuxiliaryFactory" />\r          <type uri="http://www.simantics.org/Sysdyn-1.0/CloudSymbol"\r                    class="org.simantics.sysdyn.ui.elements2.CloudFactory" />\r              <type uri="http://www.simantics.org/Sysdyn-1.0/InputSymbol"\r                    class="org.simantics.sysdyn.ui.elements2.InputFactory" />                       \r       </target>\r      \r       <!-- Sysdyn connections -->\r    <target interface="org.simantics.diagram.adapter.ElementFactory">\r              <!-- Edges -->\r         <resource uri="http://www.simantics.org/Sysdyn-1.0/FlowConnection"\r                     class="org.simantics.sysdyn.ui.elements2.connections.FlowEdgeFactory" />\r               <resource uri="http://www.simantics.org/Sysdyn-1.0/DependencyConnection"\r                       class="org.simantics.sysdyn.ui.elements2.connections.DependencyEdgeFactory" />\r         <type uri="http://www.simantics.org/Sysdyn-1.0/FlowConnection"\r                 class="org.simantics.sysdyn.ui.elements2.connections.FlowEdgeFactory" />\r               <type uri="http://www.simantics.org/Sysdyn-1.0/DependencyConnection"\r                   class="org.simantics.sysdyn.ui.elements2.connections.DependencyEdgeFactory" />\r         <!-- : SYSDYN.Connection-->\r            <type uri="http://www.simantics.org/Sysdyn-1.0/FlowConnection"\r                 class="org.simantics.sysdyn.ui.elements2.connections.FlowConnectionFactory" />\r         <type uri="http://www.simantics.org/Sysdyn-1.0/DependencyConnection"\r                   class="org.simantics.sysdyn.ui.elements2.connections.DependencyConnectionFactory" />\r   </target>\r      \r       <target interface="org.simantics.g2d.connection.EdgeVisualsConfigurer">\r          <baseType uri="http://www.simantics.org/Diagram-2.0/HasConnector" />\r   <resource uri="http://www.simantics.org/Diagram-2.0/HasPlainConnector"\r          class="org.simantics.diagram.content.ArrowConfigurer">\r         <string>none 0</string>\r       </resource>\r    <resource uri="http://www.simantics.org/Diagram-2.0/HasArrowConnector"\r          class="org.simantics.diagram.content.ArrowConfigurer">\r         <string>fill 1</string>\r       </resource>\r  </target>\r      \r
 </adapters>
\ No newline at end of file
index 84efadd9890ea3db6f0f0657fcf05d677c982bf4..5992bf10d5f98c6728348bc8d2e36c6c970b33bc 100644 (file)
       </menuContribution>\r
       <menuContribution\r
             locationURI="popup:#SysdynBrowserPopup?after=wbStart">\r
-         <menu\r
+         <menu id="org.simantics.new"\r
                label="New">\r
             <command\r
                   commandId="org.simantics.sysdyn.ui.newModel"\r
                class="org.simantics.sysdyn.ui.browser.contributions.ModulesLabeler"\r
                preference="2.0">\r
          </implementation>\r
-         <implementation\r
+<!--         <implementation\r
                class="org.simantics.sysdyn.ui.browser.contributions.OperatingInterfacesLabeler"\r
                preference="2.0">\r
-         </implementation>\r
+         </implementation>-->\r
          <implementation\r
                class="org.simantics.sysdyn.ui.browser.contributions.ExperimentLabeler"\r
                preference="2.0">\r
index 988e479d4d030901f60e8926732e4a7613274f7b..051336452349201e6d8d893daaf8189da6397602 100644 (file)
@@ -11,6 +11,8 @@
  *******************************************************************************/\r
 package org.simantics.sysdyn.ui;\r
 \r
+import java.net.URL;\r
+\r
 import org.apache.log4j.BasicConfigurator;\r
 import org.apache.log4j.ConsoleAppender;\r
 import org.apache.log4j.Level;\r
@@ -65,4 +67,10 @@ public class Activator extends AbstractUIPlugin {
             throw new IllegalStateException("ResourceManager of bundle '" + PLUGIN_ID + "' is not initialized.");\r
         return resourceManager;\r
     }\r
+    \r
+    public static URL getDefaultResource(String name) {\r
+        Activator plugin = getDefault();\r
+        if(plugin == null) throw new IllegalStateException("The plugin is not active.");\r
+        return plugin.getBundle().getResource(name);\r
+    }\r
 }\r
index 3fae63c2b64131a0f6498fa92b43343b89dd776c..181d0505e2449b06c4f35f01b60a00a66fa5e9fe 100644 (file)
@@ -11,7 +11,9 @@
  *******************************************************************************/\r
 package org.simantics.sysdyn.ui.browser;\r
 \r
+import java.util.Arrays;\r
 import java.util.Collections;\r
+import java.util.HashSet;\r
 import java.util.Set;\r
 \r
 import org.eclipse.swt.widgets.Composite;\r
@@ -25,8 +27,9 @@ import org.simantics.sysdyn.ui.properties.SysdynPropertyPage;
 \r
 public class SysdynBrowser extends GraphExplorerView {\r
     \r
-    private static final Set<String> browseContexts  = Collections.singleton("http://www.simantics.org/Sysdyn-1.0/Browser");\r
-    \r
+//  private static final Set<String> browseContexts  = Collections.singleton("http://www.simantics.org/Sysdyn-1.0/Browser");\r
+    private static final Set<String> browseContexts  = new HashSet<String>(Arrays.asList("http://www.simantics.org/Sysdyn-1.0/Browser", "http://www.simantics.org/Operating-1.0/Browser"));    \r
+\r
     @Override\r
     protected IContextMenuInitializer getContextMenuInitializer() {\r
         return new ContextMenuInitializer("#SysdynBrowserPopup");\r
index 21ae321a7783a55586d27038adbef44efbc3dfe1..650709b2b21e320556176179fe449cfdb677a1e1 100644 (file)
 package org.simantics.sysdyn.ui.browser.contributions;\r
 \r
 import org.eclipse.jface.resource.ImageDescriptor;\r
+import org.simantics.browsing.ui.common.node.AbstractNode;\r
 import org.simantics.browsing.ui.swt.ImagerContributor;\r
 import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
 import org.simantics.db.exception.DatabaseException;\r
 import org.simantics.sysdyn.ui.Activator;\r
-import org.simantics.sysdyn.ui.browser.nodes.AbstractNode;\r
 import org.simantics.sysdyn.ui.browser.nodes.ConfigurationNode;\r
 import org.simantics.sysdyn.ui.browser.nodes.ExperimentNode;\r
 import org.simantics.sysdyn.ui.browser.nodes.ExperimentsFolder;\r
@@ -28,14 +29,14 @@ import org.simantics.sysdyn.ui.browser.nodes.ModulesNode;
 import org.simantics.sysdyn.ui.browser.nodes.OperatingInterfacesFolder;\r
 import org.simantics.sysdyn.ui.browser.nodes.VariableNode;\r
 \r
-public class AbstractNodeImager extends ImagerContributor<AbstractNode> {\r
+public class AbstractNodeImager extends ImagerContributor<AbstractNode<Resource>> {\r
 \r
     @Override\r
-    public ImageDescriptor getDescriptor(ReadGraph graph, AbstractNode node) throws DatabaseException {\r
+    public ImageDescriptor getDescriptor(ReadGraph graph, AbstractNode<Resource> node) throws DatabaseException {\r
         \r
         String image = null;\r
         if (node instanceof ExperimentsFolder || \r
-                node instanceof OperatingInterfacesFolder || \r
+//                node instanceof OperatingInterfacesFolder || \r
                 node instanceof ModulesNode)\r
             image = "icons/folder.png";\r
         else if (node instanceof ModuleTypeNode || node instanceof ModuleNode || node instanceof ConfigurationNode)\r
index 813365cb012c6300175b03e75d56a0a698ac9178..5cc983b4b40537818334f37ad8029c6715ec7534 100644 (file)
  *******************************************************************************/\r
 package org.simantics.sysdyn.ui.browser.contributions;\r
 \r
+import org.simantics.browsing.ui.common.node.AbstractNode;\r
 import org.simantics.browsing.ui.graph.contributor.labeler.LabelerContributor;\r
 import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
 import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.sysdyn.ui.browser.nodes.AbstractNode;\r
 \r
-public class AbstractNodeLabeler extends LabelerContributor<AbstractNode> {\r
+public class AbstractNodeLabeler extends LabelerContributor<AbstractNode<Resource>> {\r
 \r
     @Override\r
-    public String getLabel(ReadGraph graph, AbstractNode node) throws DatabaseException {\r
-        if (!graph.hasStatement(node.resource))\r
+    public String getLabel(ReadGraph graph, AbstractNode<Resource> node) throws DatabaseException {\r
+        if (!graph.hasStatement(node.data))\r
             return "";\r
-        return graph.adapt(node.resource, String.class);\r
+        return graph.adapt(node.data, String.class);\r
     }\r
 \r
 }\r
index 086ccde09516af801c3bf857e0bb8542c5a915fb..9f1c4dcf4c8b080a75af00d0f06fcd1b9af911e8 100644 (file)
@@ -3,6 +3,7 @@ package org.simantics.sysdyn.ui.browser.contributions;
 import java.util.ArrayList;\r
 import java.util.Collection;\r
 \r
+import org.simantics.browsing.ui.common.node.AbstractNode;\r
 import org.simantics.browsing.ui.graph.contributor.viewpoint.ViewpointContributor;\r
 import org.simantics.db.Builtins;\r
 import org.simantics.db.ReadGraph;\r
@@ -10,31 +11,30 @@ import org.simantics.db.Resource;
 import org.simantics.db.common.request.ObjectsWithType;\r
 import org.simantics.db.exception.DatabaseException;\r
 import org.simantics.sysdyn.SysdynResource;\r
-import org.simantics.sysdyn.ui.browser.nodes.AbstractNode;\r
 import org.simantics.sysdyn.ui.browser.nodes.ConfigurationNode;\r
 \r
 public class Configuration extends ViewpointContributor<ConfigurationNode> {\r
 \r
         @Override\r
         public Collection<?> getContribution(ReadGraph graph, ConfigurationNode configuration) throws DatabaseException {\r
-            ArrayList<AbstractNode> result = new ArrayList<AbstractNode>();\r
+            ArrayList<AbstractNode<Resource>> result = new ArrayList<AbstractNode<Resource>>();\r
             Builtins b = graph.getBuiltins();\r
             SysdynResource sr = SysdynResource.getInstance(graph);\r
-            for(Resource r : graph.syncRequest(new ObjectsWithType(configuration.resource, b.ConsistsOf, sr.IndependentVariable))) {\r
+            for(Resource r : graph.syncRequest(new ObjectsWithType(configuration.data, b.ConsistsOf, sr.IndependentVariable))) {\r
                 try {\r
                     result.add(graph.adapt(r, AbstractNode.class));\r
                 } catch(DatabaseException e) {\r
                     e.printStackTrace();\r
                 }\r
             }\r
-            for(Resource r : graph.syncRequest(new ObjectsWithType(configuration.resource, b.ConsistsOf, sr.Input))) {\r
+            for(Resource r : graph.syncRequest(new ObjectsWithType(configuration.data, b.ConsistsOf, sr.Input))) {\r
                 try {\r
                     result.add(graph.adapt(r, AbstractNode.class));\r
                 } catch(DatabaseException e) {\r
                     e.printStackTrace();\r
                 }\r
             }\r
-            for(Resource r : graph.syncRequest(new ObjectsWithType(configuration.resource, b.ConsistsOf, sr.Module))) {\r
+            for(Resource r : graph.syncRequest(new ObjectsWithType(configuration.data, b.ConsistsOf, sr.Module))) {\r
                 try {\r
                     result.add(graph.adapt(r, AbstractNode.class));\r
                 } catch(DatabaseException e) {\r
index 6466de72a81957638b18af293b34f9454930cd6a..cf9d84a8862644d02a4a2fc21a4dd405ae96cd12 100644 (file)
@@ -14,6 +14,7 @@ package org.simantics.sysdyn.ui.browser.contributions;
 import java.util.ArrayList;\r
 import java.util.Collection;\r
 \r
+import org.simantics.browsing.ui.common.node.AbstractNode;\r
 import org.simantics.browsing.ui.graph.contributor.viewpoint.ViewpointContributor;\r
 import org.simantics.db.Builtins;\r
 import org.simantics.db.ReadGraph;\r
@@ -21,16 +22,15 @@ import org.simantics.db.Resource;
 import org.simantics.db.common.request.ObjectsWithType;\r
 import org.simantics.db.exception.DatabaseException;\r
 import org.simantics.simulation.ontology.SimulationResource;\r
-import org.simantics.sysdyn.ui.browser.nodes.AbstractNode;\r
 import org.simantics.sysdyn.ui.browser.nodes.ExperimentsFolder;\r
 \r
 public class Experiment extends ViewpointContributor<ExperimentsFolder> {\r
 \r
     @Override\r
     public Collection<?> getContribution(ReadGraph graph, ExperimentsFolder experimentsFolder) throws DatabaseException {\r
-        ArrayList<AbstractNode> result = new ArrayList<AbstractNode>();\r
+        ArrayList<AbstractNode<Resource>> result = new ArrayList<AbstractNode<Resource>>();\r
         Builtins b = graph.getBuiltins();\r
-        for(Resource r : graph.syncRequest(new ObjectsWithType(experimentsFolder.resource, b.ConsistsOf, SimulationResource.getInstance(graph).Experiment))) {\r
+        for(Resource r : graph.syncRequest(new ObjectsWithType(experimentsFolder.data, b.ConsistsOf, SimulationResource.getInstance(graph).Experiment))) {\r
             try {\r
                 result.add(graph.adapt(r, AbstractNode.class));\r
             } catch(DatabaseException e) {\r
index 048c5c508de873b627e487fb0509d3acccbfcc63..fc9e548bf4fae02845dd9e4ccb80bf6ff9c77aa0 100644 (file)
@@ -13,7 +13,7 @@ public class ExperimentLabelDecorator extends LabelDecoratorContributor<Experime
 \r
     @Override\r
     public LabelDecorator getDecorator(ReadGraph graph, ExperimentNode experimentNode) throws DatabaseException {\r
-        if (graph.hasStatement(experimentNode.resource, SimulationResource.getInstance(graph).IsActive)) {\r
+        if (graph.hasStatement(experimentNode.data, SimulationResource.getInstance(graph).IsActive)) {\r
             return new LabelDecorator.Stub() {\r
                 @Override\r
                 public String decorateLabel(String label, String column, int itemIndex) {\r
index 7779cc8329257fb9a7b4f8921948c1695603b670..e26f807df491529db5d924f8422e1fcb5b4a53cf 100644 (file)
@@ -21,7 +21,7 @@ public class ExperimentLabeler extends LabelerContributor<ExperimentNode>{
 \r
     @Override\r
     public String getLabel(ReadGraph graph, ExperimentNode experiment) throws DatabaseException {\r
-        String name = graph.getPossibleRelatedValue(experiment.resource, graph.getBuiltins().HasLabel);\r
+        String name = graph.getPossibleRelatedValue(experiment.data, graph.getBuiltins().HasLabel);\r
         return name == null ? "Experiment (no name)" : name;\r
     }\r
 \r
index 3e042c6e194143cc2ed0fe91b613f7c63ab220b5..5e1938166bb0fd528890394e05da66cd863647aa 100644 (file)
@@ -12,7 +12,7 @@ public class InputLabeler extends LabelerContributor<InputNode>{
     @Override\r
     public String getLabel(ReadGraph graph, InputNode var) throws DatabaseException {\r
         Builtins b = graph.getBuiltins();\r
-        Resource varres = var.resource;\r
+        Resource varres = var.data;\r
         StringBuilder sb = new StringBuilder();\r
         for(Resource r : graph.getObjects(varres, b.HasName))\r
             sb.append(graph.getValue(r));\r
index 9a06d6810552fe8129f6a0360c0bf7de719e67ac..8c946d1f1226aa1c7326bf44f76dc0dc850a6ea0 100644 (file)
@@ -3,31 +3,30 @@ package org.simantics.sysdyn.ui.browser.contributions;
 import java.util.ArrayList;\r
 import java.util.Collection;\r
 \r
+import org.simantics.browsing.ui.common.node.AbstractNode;\r
 import org.simantics.browsing.ui.graph.contributor.viewpoint.ViewpointContributor;\r
 import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
 import org.simantics.db.exception.DatabaseException;\r
 import org.simantics.simulation.ontology.SimulationResource;\r
-import org.simantics.sysdyn.ui.browser.nodes.AbstractNode;\r
 import org.simantics.sysdyn.ui.browser.nodes.ConfigurationNode;\r
 import org.simantics.sysdyn.ui.browser.nodes.ExperimentsFolder;\r
 import org.simantics.sysdyn.ui.browser.nodes.ModelNode;\r
 import org.simantics.sysdyn.ui.browser.nodes.ModulesNode;\r
-import org.simantics.sysdyn.ui.browser.nodes.OperatingInterfacesFolder;\r
 \r
 public class Model  extends ViewpointContributor<ModelNode> {\r
 \r
     @Override\r
     public Collection<?> getContribution(ReadGraph graph, ModelNode model)\r
     throws DatabaseException {\r
-        ArrayList<AbstractNode> result = new ArrayList<AbstractNode>();\r
+        ArrayList<AbstractNode<Resource>> result = new ArrayList<AbstractNode<Resource>>();\r
         result.add(new ConfigurationNode(\r
                 graph.getSingleObject(\r
-                        model.resource,\r
+                        model.data,\r
                         SimulationResource.getInstance(graph).HasConfiguration))\r
         );\r
-        result.add(new ExperimentsFolder(model.resource));\r
-        result.add(new OperatingInterfacesFolder(model.resource));\r
-        result.add(new ModulesNode(model.resource));\r
+        result.add(new ExperimentsFolder(model.data));\r
+        result.add(new ModulesNode(model.data));\r
         return result;\r
     }\r
 \r
index bb53b5942deb799a6fac5b2c8b1bfddb8fe232f8..cb122ee1f673f01e35926ee8f00dd59423a54d8e 100644 (file)
@@ -9,7 +9,7 @@ public class ModelLabeler extends LabelerContributor<ModelNode>{
 \r
     @Override\r
     public String getLabel(ReadGraph graph, ModelNode model) throws DatabaseException {\r
-        String label = graph.getPossibleRelatedValue(model.resource, graph.getBuiltins().HasLabel);\r
+        String label = graph.getPossibleRelatedValue(model.data, graph.getBuiltins().HasLabel);\r
         return label == null ? "Model (no name)" : label;\r
     }\r
 }\r
index cad29d6009c0c421a225c827d0194294e39ca755..9cbfbc686d4d6ffe2a290c887c3cc137fbedbd4d 100644 (file)
@@ -3,6 +3,7 @@ package org.simantics.sysdyn.ui.browser.contributions;
 import java.util.ArrayList;\r
 import java.util.Collection;\r
 \r
+import org.simantics.browsing.ui.common.node.AbstractNode;\r
 import org.simantics.browsing.ui.graph.contributor.viewpoint.ViewpointContributor;\r
 import org.simantics.db.Builtins;\r
 import org.simantics.db.ReadGraph;\r
@@ -12,23 +13,22 @@ import org.simantics.db.exception.DatabaseException;
 import org.simantics.modeling.ModelingResources;\r
 import org.simantics.structural.stubs.StructuralResource2;\r
 import org.simantics.sysdyn.SysdynResource;\r
-import org.simantics.sysdyn.ui.browser.nodes.AbstractNode;\r
 import org.simantics.sysdyn.ui.browser.nodes.ModuleNode;\r
 \r
 public class Module extends ViewpointContributor<ModuleNode> {\r
 \r
     @Override\r
     public Collection<?> getContribution(ReadGraph graph, ModuleNode module) throws DatabaseException {\r
-        ArrayList<AbstractNode> result = new ArrayList<AbstractNode>();\r
+        ArrayList<AbstractNode<Resource>> result = new ArrayList<AbstractNode<Resource>>();\r
         Builtins b = graph.getBuiltins();\r
         SysdynResource sr = SysdynResource.getInstance(graph);\r
         StructuralResource2 str = StructuralResource2.getInstance(graph);\r
 \r
         // ModuleTypeNode extends ModuleNode, so we get the instance in two different ways\r
-        Resource instance = graph.getPossibleObject(module.resource, b.InstanceOf);\r
-        if(graph.isInheritedFrom(module.resource, sr.ModuleSymbol)) {\r
+        Resource instance = graph.getPossibleObject(module.data, b.InstanceOf);\r
+        if(graph.isInheritedFrom(module.data, sr.ModuleSymbol)) {\r
             ModelingResources mr = ModelingResources.getInstance(graph);\r
-            instance =  graph.getPossibleObject(module.resource, mr.SymbolToComponentType);\r
+            instance =  graph.getPossibleObject(module.data, mr.SymbolToComponentType);\r
         }\r
 \r
         if(instance == null) return result;\r
index 78e02ffe013dc3b3b1e6c339cc5056c03ffa8b90..b7a9925af443982e2935074d770a381e1dec9c4f 100644 (file)
@@ -23,7 +23,7 @@ public class ModuleLabeler  extends LabelerContributor<ModuleNode>{
     @Override\r
     public String getLabel(ReadGraph graph, ModuleNode module) throws DatabaseException {\r
         Builtins b = graph.getBuiltins();\r
-        Resource resource = module.resource;\r
+        Resource resource = module.data;\r
         StringBuilder sb = new StringBuilder();\r
         for(Resource r : graph.getObjects(resource, b.HasName))\r
             sb.append(graph.getValue(r));\r
index 74adf5911be27ef885c66962d69df5b76adcf7ea..2d78a549ec849583b76013e3dd85ae9aec07cd49 100644 (file)
@@ -12,7 +12,7 @@ public class ModuleTypeLabeler extends LabelerContributor<ModuleTypeNode>{
     @Override\r
     public String getLabel(ReadGraph graph, ModuleTypeNode moduleType) throws DatabaseException {\r
         ModelingResources mr = ModelingResources.getInstance(graph);\r
-        Resource typeResource =  graph.getPossibleObject(moduleType.resource, mr.SymbolToComponentType);\r
+        Resource typeResource =  graph.getPossibleObject(moduleType.data, mr.SymbolToComponentType);\r
         String label = graph.getPossibleRelatedValue(typeResource, graph.getBuiltins().HasName);\r
         return label == null ? "ModuleType (no name)" : label;\r
     }\r
index 4399de9b7a3f0861a64e250a6367f3d54e3be86c..70645d2d653ed74b34ce4e39dcbfa950fef7f028 100644 (file)
@@ -3,6 +3,7 @@ package org.simantics.sysdyn.ui.browser.contributions;
 import java.util.ArrayList;\r
 import java.util.Collection;\r
 \r
+import org.simantics.browsing.ui.common.node.AbstractNode;\r
 import org.simantics.browsing.ui.graph.contributor.viewpoint.ViewpointContributor;\r
 import org.simantics.db.Builtins;\r
 import org.simantics.db.ReadGraph;\r
@@ -11,7 +12,6 @@ import org.simantics.db.common.request.ObjectsWithType;
 import org.simantics.db.exception.DatabaseException;\r
 import org.simantics.modeling.ModelingResources;\r
 import org.simantics.structural.stubs.StructuralResource2;\r
-import org.simantics.sysdyn.ui.browser.nodes.AbstractNode;\r
 import org.simantics.sysdyn.ui.browser.nodes.ModuleTypeNode;\r
 import org.simantics.sysdyn.ui.browser.nodes.ModulesNode;\r
 \r
@@ -21,10 +21,10 @@ public class Modules extends ViewpointContributor<ModulesNode> {
     public Collection<?> getContribution(ReadGraph graph, ModulesNode model)\r
     throws DatabaseException {\r
 \r
-        ArrayList<AbstractNode> result = new ArrayList<AbstractNode>();\r
+        ArrayList<AbstractNode<Resource>> result = new ArrayList<AbstractNode<Resource>>();\r
         Builtins b = graph.getBuiltins();\r
         StructuralResource2 st = StructuralResource2.getInstance(graph);\r
-        for(Resource r : graph.syncRequest(new ObjectsWithType(model.resource, b.ConsistsOf, st.ComponentType))) {\r
+        for(Resource r : graph.syncRequest(new ObjectsWithType(model.data, b.ConsistsOf, st.ComponentType))) {\r
             Resource symbol = graph.getPossibleObject(r,ModelingResources.getInstance(graph).ComponentTypeToSymbol);\r
             result.add(new ModuleTypeNode(symbol));\r
         }\r
index 83ef90d08ee851c74b19bf22fd9b65d1f4f06df8..83acd782a7a8a1feb899f940be0601c243a6d948 100644 (file)
@@ -3,6 +3,7 @@ package org.simantics.sysdyn.ui.browser.contributions;
 import java.util.ArrayList;\r
 import java.util.Collection;\r
 \r
+import org.simantics.browsing.ui.common.node.AbstractNode;\r
 import org.simantics.browsing.ui.graph.contributor.viewpoint.ViewpointContributor;\r
 import org.simantics.db.Builtins;\r
 import org.simantics.db.ReadGraph;\r
@@ -10,7 +11,6 @@ import org.simantics.db.Resource;
 import org.simantics.db.common.request.ObjectsWithType;\r
 import org.simantics.db.exception.DatabaseException;\r
 import org.simantics.sysdyn.SysdynResource;\r
-import org.simantics.sysdyn.ui.browser.nodes.AbstractNode;\r
 \r
 public class Project extends ViewpointContributor<Resource> {\r
 \r
@@ -18,7 +18,7 @@ public class Project extends ViewpointContributor<Resource> {
     public Collection<?> getContribution(ReadGraph graph, Resource project)\r
     throws DatabaseException {\r
 \r
-        ArrayList<AbstractNode> result = new ArrayList<AbstractNode>();\r
+        ArrayList<AbstractNode<Resource>> result = new ArrayList<AbstractNode<Resource>>();\r
         Builtins b = graph.getBuiltins();\r
         SysdynResource sr = SysdynResource.getInstance(graph);\r
         for(Resource r : graph.syncRequest(new ObjectsWithType(project, b.ConsistsOf, sr.SysdynModel))) {\r
index cf5bfb1dec5dfadde99c14e98a1626a160cfe146..ecd79d25ae935219edd6cb6e1e105f2d7edbb9d1 100644 (file)
@@ -4,6 +4,7 @@ import java.io.File;
 import java.util.ArrayList;\r
 import java.util.Collection;\r
 \r
+import org.simantics.browsing.ui.common.node.AbstractNode;\r
 import org.simantics.browsing.ui.graph.contributor.viewpoint.ViewpointContributor;\r
 import org.simantics.db.ReadGraph;\r
 import org.simantics.db.Resource;\r
@@ -12,16 +13,15 @@ import org.simantics.db.common.request.ObjectsWithType;
 import org.simantics.db.common.request.WriteRequest;\r
 import org.simantics.db.exception.DatabaseException;\r
 import org.simantics.sysdyn.SysdynResource;\r
-import org.simantics.sysdyn.ui.browser.nodes.AbstractNode;\r
 import org.simantics.sysdyn.ui.browser.nodes.ExperimentNode;\r
 \r
 public class SimulationResult  extends ViewpointContributor<ExperimentNode> {\r
 \r
     @Override\r
     public Collection<?> getContribution(ReadGraph graph, ExperimentNode experiment) throws DatabaseException {\r
-        ArrayList<AbstractNode> result = new ArrayList<AbstractNode>();\r
+        ArrayList<AbstractNode<Resource>> result = new ArrayList<AbstractNode<Resource>>();\r
         SysdynResource sr = SysdynResource.getInstance(graph);\r
-        for(final Resource r : graph.syncRequest(new ObjectsWithType(experiment.resource, sr.HasResult, sr.Result))) {\r
+        for(final Resource r : graph.syncRequest(new ObjectsWithType(experiment.data, sr.HasResult, sr.Result))) {\r
             String resultPath = (String)graph.getPossibleRelatedValue(r, sr.HasResultFile);\r
             File file = new File(resultPath);\r
             if(file.exists()) {\r
index 60ea3bce8f2a93b0861895eed25c24acb0632397..62896598c824e6961bb3fb5dc2aa50e1d21891fe 100644 (file)
@@ -13,7 +13,7 @@ public class SimulationResultDecorator extends LabelDecoratorContributor<Simulat
 \r
     @Override\r
     public LabelDecorator getDecorator(ReadGraph graph, SimulationResultNode result) throws DatabaseException {\r
-        if (graph.hasStatement(result.resource, SimulationResource.getInstance(graph).IsActive)) {\r
+        if (graph.hasStatement(result.data, SimulationResource.getInstance(graph).IsActive)) {\r
             return new LabelDecorator.Stub() {\r
 \r
                 @SuppressWarnings("unchecked")\r
index de9b255462b849c70a9feeddeac8d166d1c09dee..79060a15e89cf1a3831b12397c36e15835b87919 100644 (file)
@@ -12,7 +12,7 @@ public class SimulationResultImager extends ImagerContributor<SimulationResultNo
 \r
     @Override\r
     public ImageDescriptor getDescriptor(ReadGraph graph, SimulationResultNode result) throws DatabaseException {\r
-        if(graph.hasStatement(result.resource, SimulationResource.getInstance(graph).IsActive))\r
+        if(graph.hasStatement(result.data, SimulationResource.getInstance(graph).IsActive))\r
             return ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getResource("icons/chart_bar.png"));\r
         else\r
             return ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getResource("icons/chart_bar_blackAndWhite.png"));\r
index c74bb40496d3a958106a3a28615c3f39fb12eead..84489473ece6210fa8bf23eb76794ee441744b99 100644 (file)
@@ -9,7 +9,7 @@ public class SimulationResultLabeler extends LabelerContributor<SimulationResult
 \r
     @Override\r
     public String getLabel(ReadGraph graph, SimulationResultNode result) throws DatabaseException {\r
-        String name = graph.getPossibleRelatedValue(result.resource, graph.getBuiltins().HasLabel);\r
+        String name = graph.getPossibleRelatedValue(result.data, graph.getBuiltins().HasLabel);\r
         return name == null ? "Experiment (no name)" : name;\r
     }\r
 \r
index 14b675a960fad65abdc720141a626d866ccc60b0..24d13e76aecb8e13c21e5b1fcf307eb7162db6f0 100644 (file)
@@ -23,7 +23,7 @@ public class VariableLabeler  extends LabelerContributor<VariableNode>{
     @Override\r
     public String getLabel(ReadGraph graph, VariableNode var) throws DatabaseException {\r
         Builtins b = graph.getBuiltins();\r
-        Resource varres = var.resource;\r
+        Resource varres = var.data;\r
         StringBuilder sb = new StringBuilder();\r
         for(Resource r : graph.getObjects(varres, b.HasName))\r
             sb.append(graph.getValue(r));\r
diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/AbstractNode.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/AbstractNode.java
deleted file mode 100644 (file)
index bf56020..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************\r
- * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
- * in 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.browser.nodes;\r
-\r
-import org.eclipse.core.runtime.IAdaptable;\r
-import org.simantics.db.Resource;\r
-\r
-public abstract class AbstractNode implements IAdaptable {\r
-    public final Resource resource;\r
-\r
-    public AbstractNode(Resource resource) {\r
-        assert(resource != null);\r
-        this.resource = resource;\r
-    }\r
-\r
-    @Override\r
-    public int hashCode() {\r
-        return resource.hashCode() + getClass().hashCode();\r
-    }\r
-\r
-    @Override\r
-    public boolean equals(Object obj) {\r
-        if (this == obj)\r
-            return true;\r
-        if (obj == null)\r
-            return false;\r
-        if (getClass() != obj.getClass())\r
-            return false;\r
-        AbstractNode other = (AbstractNode) obj;\r
-        return resource.equals(other.resource);\r
-    }\r
-\r
-    @SuppressWarnings("unchecked")\r
-    @Override\r
-    public Object getAdapter(Class adapter) {\r
-        if(adapter.equals(Resource.class))\r
-            return resource;\r
-        return null;\r
-    }\r
-}\r
index 1f44cfd1dba8d6598397959d0ed11ae8432a3456..cd1a43359513db1b397d660ab0c18e6329120c7b 100644 (file)
  *******************************************************************************/\r
 package org.simantics.sysdyn.ui.browser.nodes;\r
 \r
+import org.simantics.browsing.ui.common.node.AbstractNode;\r
 import org.simantics.browsing.ui.common.node.IDeletable;\r
 import org.simantics.db.Resource;\r
 \r
-public class ConfigurationNode  extends AbstractNode implements IDeletable {\r
+public class ConfigurationNode  extends AbstractNode<Resource> implements IDeletable {\r
 \r
     public ConfigurationNode(Resource resource) {\r
         super(resource);\r
index b9e2ed194b40d9a3c0088f8c3b2f60219fcf3d1c..73bce883abff9fd0215585280c1ff5b5a226697b 100644 (file)
@@ -13,6 +13,7 @@ package org.simantics.sysdyn.ui.browser.nodes;
 \r
 import java.util.Collection;\r
 \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
 import org.simantics.browsing.ui.common.node.IDoubleClickableNode;\r
@@ -33,7 +34,7 @@ import org.simantics.ui.SimanticsUI;
 import org.simantics.utils.ui.ErrorLogger;\r
 import org.simantics.utils.ui.ExceptionUtils;\r
 \r
-public class ExperimentNode extends AbstractNode implements IDoubleClickableNode, IDeletableNode, IModifiableNode{\r
+public class ExperimentNode extends AbstractNode<Resource> implements IDoubleClickableNode, IDeletableNode, IModifiableNode{\r
 \r
     public ExperimentNode(Resource resource) {\r
         super(resource);\r
@@ -41,7 +42,7 @@ public class ExperimentNode extends AbstractNode implements IDoubleClickableNode
 \r
     @Override\r
     public boolean handleDoubleClick() {\r
-        if (resource == null)\r
+        if (data == null)\r
             return false;\r
         IProject project = SimanticsUI.getProject();\r
         IExperimentManager experimentManager = project.getHint(IExperimentManager.KEY_EXPERIMENT_MANAGER);\r
@@ -49,13 +50,13 @@ public class ExperimentNode extends AbstractNode implements IDoubleClickableNode
             ErrorLogger.defaultLogWarning("Experiment manager not available.", new Exception());\r
             return false;\r
         }\r
-        SysdynExperimentActivator.scheduleActivation(SimanticsUI.getSession(), project, experimentManager, resource);\r
+        SysdynExperimentActivator.scheduleActivation(SimanticsUI.getSession(), project, experimentManager, data);\r
         return true;\r
     }\r
 \r
     @Override\r
     public Modifier getModifier(String columnId) {\r
-        LabelModifier modifier = new LabelModifier(SimanticsUI.getSession(), resource) {\r
+        LabelModifier modifier = new LabelModifier(SimanticsUI.getSession(), data) {\r
             @Override\r
             public String isValid(String label) {\r
                 if (label.isEmpty())\r
@@ -73,11 +74,11 @@ public class ExperimentNode extends AbstractNode implements IDoubleClickableNode
                 @Override\r
                 public void perform(WriteGraph graph) throws DatabaseException, CancelTransactionException {\r
                     Builtins b = graph.getBuiltins();\r
-                    Collection<Resource> results = graph.getObjects(resource, SysdynResource.getInstance(graph).HasResult);\r
+                    Collection<Resource> results = graph.getObjects(data, SysdynResource.getInstance(graph).HasResult);\r
                     if(results != null)\r
                         for(Resource result : results) \r
                             SimulationResultNode.unlinkResult(graph, result);\r
-                    graph.deny(resource, b.PartOf);                \r
+                    graph.deny(data, b.PartOf);                \r
                 }\r
             });\r
         } catch (DatabaseException e) {\r
index b68b53943a0cfca17f8e5c9f894f58980971eb86..82626d467c6326161c5ca488aa39f673539ada67 100644 (file)
  *******************************************************************************/\r
 package org.simantics.sysdyn.ui.browser.nodes;\r
 \r
+import org.simantics.browsing.ui.common.node.AbstractNode;\r
 import org.simantics.db.Resource;\r
 \r
-public class ExperimentsFolder extends AbstractNode {\r
+public class ExperimentsFolder extends AbstractNode<Resource> {\r
 \r
     public ExperimentsFolder(Resource resource) {\r
         super(resource);\r
index b0efeb7bccfb3a81637d72305ed2e3db25509ff9..82aa5cae2732c9e1d94e2e6c614095698178823b 100644 (file)
@@ -1,8 +1,9 @@
 package org.simantics.sysdyn.ui.browser.nodes;\r
 \r
+import org.simantics.browsing.ui.common.node.AbstractNode;\r
 import org.simantics.db.Resource;\r
 \r
-public class InputNode  extends AbstractNode {\r
+public class InputNode  extends AbstractNode<Resource> {\r
 \r
     public InputNode(Resource resource) {\r
         super(resource);\r
index c26a8df70838eb775d6ad4cac4a184bc5405f3a8..9801d563683f97445953c44a0de95ee14124cd2f 100644 (file)
@@ -1,5 +1,6 @@
 package org.simantics.sysdyn.ui.browser.nodes;\r
 \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
 import org.simantics.browsing.ui.common.node.IModifiableNode;\r
@@ -15,7 +16,7 @@ import org.simantics.sysdyn.SysdynResource;
 import org.simantics.ui.SimanticsUI;\r
 import org.simantics.utils.ui.ExceptionUtils;\r
 \r
-public class ModelNode extends AbstractNode implements IDeletableNode, IModifiableNode {\r
+public class ModelNode extends AbstractNode<Resource> implements IDeletableNode, IModifiableNode {\r
 \r
     public ModelNode(Resource resource) {\r
         super(resource);\r
@@ -23,7 +24,7 @@ public class ModelNode extends AbstractNode implements IDeletableNode, IModifiab
 \r
     @Override\r
     public Modifier getModifier(String columnId) {\r
-        LabelModifier modifier = new LabelModifier(SimanticsUI.getSession(), resource) {\r
+        LabelModifier modifier = new LabelModifier(SimanticsUI.getSession(), data) {\r
             @Override\r
             public String isValid(String label) {\r
                 if (label.isEmpty())\r
@@ -44,11 +45,11 @@ public class ModelNode extends AbstractNode implements IDeletableNode, IModifiab
                 public void perform(WriteGraph graph) throws DatabaseException, CancelTransactionException {\r
                     Builtins b = graph.getBuiltins();\r
 \r
-                    for(Resource r : graph.getObjects(resource, b.ConsistsOf))\r
+                    for(Resource r : graph.getObjects(data, b.ConsistsOf))\r
                         if(graph.isInstanceOf(r, SysdynResource.getInstance(graph).Result))\r
                             SimulationResultNode.deleteResultFiles(graph, r);\r
 \r
-                    graph.deny(resource, b.PartOf);\r
+                    graph.deny(data, b.PartOf);\r
                 }\r
             });\r
         } catch (DatabaseException e) {\r
index 2241a7cafe5acc25e64534e733f424599ef24d96..0a8044baf92af3162ec599c3c3adcfe48bdc4705 100644 (file)
@@ -1,8 +1,9 @@
 package org.simantics.sysdyn.ui.browser.nodes;\r
 \r
+import org.simantics.browsing.ui.common.node.AbstractNode;\r
 import org.simantics.db.Resource;\r
 \r
-public class ModuleNode extends AbstractNode {\r
+public class ModuleNode extends AbstractNode<Resource> {\r
 \r
     public ModuleNode(Resource resource) {\r
         super(resource);\r
index dacf11d90f424ab9a623a961a49dd9418046642d..6e680372455676b474cad9e1e87617c6fa075b76 100644 (file)
@@ -2,6 +2,7 @@ package org.simantics.sysdyn.ui.browser.nodes;
 \r
 import java.util.Collection;\r
 \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
 import org.simantics.browsing.ui.common.node.IModifiableNode;\r
@@ -21,8 +22,8 @@ import org.simantics.modeling.ModelingResources;
 import org.simantics.simulation.ontology.SimulationResource;\r
 import org.simantics.structural.stubs.StructuralResource2;\r
 import org.simantics.ui.SimanticsUI;\r
-\r
-public class ModuleTypeNode extends ModuleNode implements IDeletableNode, IModifiableNode {\r
+// FIXME: should extend ModuleNode\r
+public class ModuleTypeNode extends AbstractNode<Resource> implements IDeletableNode, IModifiableNode {\r
 \r
     public ModuleTypeNode(Resource resource) {\r
         super(resource);\r
@@ -38,7 +39,7 @@ public class ModuleTypeNode extends ModuleNode implements IDeletableNode, IModif
                 public Modifier perform(ReadGraph graph) throws ManyObjectsForFunctionalRelationException, ServiceException {\r
                     ModelingResources mr = ModelingResources.getInstance(graph);\r
                     Builtins b = graph.getBuiltins();\r
-                    Resource type =  graph.getPossibleObject(resource, mr.SymbolToComponentType);\r
+                    Resource type =  graph.getPossibleObject(data, mr.SymbolToComponentType);\r
 \r
                     LabelModifier modifier = new LabelModifier(SimanticsUI.getSession(), type, b.HasName) {\r
                         @Override\r
@@ -71,7 +72,7 @@ public class ModuleTypeNode extends ModuleNode implements IDeletableNode, IModif
                     StructuralResource2 st = StructuralResource2.getInstance(graph);\r
                     ModelingResources mr = ModelingResources.getInstance(graph);\r
 \r
-                    Resource type =  graph.getPossibleObject(resource, mr.SymbolToComponentType);\r
+                    Resource type =  graph.getPossibleObject(data, mr.SymbolToComponentType);\r
                     Resource model = graph.getSingleObject(type, b.PartOf);\r
                     Resource modelConfiguration = graph.getSingleObject(model, SimulationResource.getInstance(graph).HasConfiguration);\r
                     if (!graph.syncRequest(new ObjectsWithType(modelConfiguration, b.ConsistsOf, type)).isEmpty()) {\r
index 1536a4c355c96faac3bed896e1a8b30548ad98f2..4132b9214596c5a821d3c44932eabe3ee837183e 100644 (file)
  *******************************************************************************/\r
 package org.simantics.sysdyn.ui.browser.nodes;\r
 \r
+import org.simantics.browsing.ui.common.node.AbstractNode;\r
 import org.simantics.db.Resource;\r
 \r
-public class ModulesNode extends AbstractNode {\r
+public class ModulesNode extends AbstractNode<Resource> {\r
     \r
     public ModulesNode(Resource resource) {\r
         super(resource);\r
index 94ecb3f385a854bbd3c2681f95bb92acbbde7881..c9069294f2abb5e450d79386930cc0dba83d2110 100644 (file)
@@ -1,8 +1,9 @@
 package org.simantics.sysdyn.ui.browser.nodes;\r
 \r
+import org.simantics.browsing.ui.common.node.AbstractNode;\r
 import org.simantics.db.Resource;\r
 \r
-public class OperatingInterfacesFolder extends AbstractNode {\r
+public class OperatingInterfacesFolder extends AbstractNode<Resource> {\r
 \r
     public OperatingInterfacesFolder(Resource resource) {\r
         super(resource);\r
index 79dd7e69b984d7daba8fea7f3f0e2e599dede51b..316f12d827301f6ede9511a1a27936500a3dc169 100644 (file)
@@ -2,6 +2,7 @@ package org.simantics.sysdyn.ui.browser.nodes;
 \r
 import java.io.File;\r
 \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
 import org.simantics.browsing.ui.common.node.IModifiableNode;\r
@@ -17,7 +18,7 @@ import org.simantics.sysdyn.SysdynResource;
 import org.simantics.ui.SimanticsUI;\r
 import org.simantics.utils.ui.ExceptionUtils;\r
 \r
-public class SimulationResultNode  extends AbstractNode implements IDeletableNode, IModifiableNode {\r
+public class SimulationResultNode  extends AbstractNode<Resource> implements IDeletableNode, IModifiableNode {\r
 \r
     public SimulationResultNode(Resource resource) {\r
         super(resource);\r
@@ -26,7 +27,7 @@ public class SimulationResultNode  extends AbstractNode implements IDeletableNod
     \r
     @Override\r
     public Modifier getModifier(String columnId) {\r
-        LabelModifier modifier = new LabelModifier(SimanticsUI.getSession(), resource) {\r
+        LabelModifier modifier = new LabelModifier(SimanticsUI.getSession(), data) {\r
             @Override\r
             public String isValid(String label) {\r
                 if (label.isEmpty())\r
@@ -44,7 +45,7 @@ public class SimulationResultNode  extends AbstractNode implements IDeletableNod
             SimanticsUI.getSession().syncRequest(new WriteRequest() {\r
                 @Override\r
                 public void perform(WriteGraph graph) throws DatabaseException, CancelTransactionException {\r
-                    unlinkResult(graph, resource);\r
+                    unlinkResult(graph, data);\r
                 }\r
             });\r
         } catch (DatabaseException e) {\r
index 90fb5337e3976f783ff9da7b62412e7239c25483..97538123c0b1bb33d08b2d77b59c4f6c36f7386e 100644 (file)
@@ -1,9 +1,10 @@
 package org.simantics.sysdyn.ui.browser.nodes;\r
 \r
+import org.simantics.browsing.ui.common.node.AbstractNode;\r
 import org.simantics.browsing.ui.common.node.IDeletable;\r
 import org.simantics.db.Resource;\r
 \r
-public class SymbolNode extends AbstractNode implements IDeletable {\r
+public class SymbolNode extends AbstractNode<Resource> implements IDeletable {\r
 \r
     public SymbolNode(Resource resource) {\r
         super(resource);\r
index 1480bb6408d292ec8068bd82abec2b6ac8850eef..08ea8b9a56ee712c01ecbcdeff70104cc4d294c1 100644 (file)
  *******************************************************************************/\r
 package org.simantics.sysdyn.ui.browser.nodes;\r
 \r
+import org.simantics.browsing.ui.common.node.AbstractNode;\r
 import org.simantics.db.Resource;\r
 \r
-public class VariableNode extends AbstractNode {\r
+public class VariableNode extends AbstractNode<Resource> {\r
 \r
     public VariableNode(Resource resource) {\r
         super(resource);\r