]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Reorganizing crowded element2 -package
authorlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Wed, 28 Jul 2010 08:01:13 +0000 (08:01 +0000)
committerlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Wed, 28 Jul 2010 08:01:13 +0000 (08:01 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@16858 ac1ea38d-2e2b-0410-8846-a27921b304fc

21 files changed:
org.simantics.sysdyn.ui/adapters.xml
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/DiagramViewer.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/participant/PointerInteractor.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/GraphPropertyNode.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/InputFactory.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/SysdynElementFactory.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/Arcs.java [moved from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/Arcs.java with 96% similarity]
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/ConnectionClasses.java [moved from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/ConnectionClasses.java with 87% similarity]
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/Dependencies.java [moved from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/Dependencies.java with 95% similarity]
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/DependencyConnectionFactory.java [moved from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/DependencyConnectionFactory.java with 95% similarity]
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/DependencyEdgeClass.java [moved from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/DependencyEdgeClass.java with 97% similarity]
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/DependencyEdgeFactory.java [moved from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/DependencyEdgeFactory.java with 94% similarity]
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/DependencyNode.java [moved from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/DependencyNode.java with 92% similarity]
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/FlowConnectionFactory.java [moved from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/FlowConnectionFactory.java with 95% similarity]
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/FlowEdgeClass.java [moved from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/FlowEdgeClass.java with 96% similarity]
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/FlowEdgeFactory.java [moved from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/FlowEdgeFactory.java with 94% similarity]
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/FlowNode.java [moved from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/FlowNode.java with 92% similarity]
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/FlowStroke.java [moved from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/FlowStroke.java with 84% similarity]
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/Flows.java [moved from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/Flows.java with 96% similarity]
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/SysdynConnectionClass.java [moved from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/SysdynConnectionClass.java with 97% similarity]
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ModuleTab.java

index 339b34aadbeebef2d09c70ee156ba6c584cc8a7e..a3dd609e9680dd46315d8f50aae774a678536a2e 100644 (file)
@@ -25,5 +25,5 @@
                        <graph />\r
                        <this />\r
                </type>\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/Types/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.FlowEdgeFactory" />\r           <resource uri="http://www.simantics.org/Sysdyn-1.0/DependencyConnection"\r                       class="org.simantics.sysdyn.ui.elements2.DependencyEdgeFactory" />\r             <type uri="http://www.simantics.org/Sysdyn-1.0/FlowConnection"\r                 class="org.simantics.sysdyn.ui.elements2.FlowEdgeFactory" />\r           <type uri="http://www.simantics.org/Sysdyn-1.0/DependencyConnection"\r                   class="org.simantics.sysdyn.ui.elements2.DependencyEdgeFactory" />\r             <!-- : SYSDYN.Connection-->\r            <type uri="http://www.simantics.org/Sysdyn-1.0/FlowConnection"\r                 class="org.simantics.sysdyn.ui.elements2.FlowConnectionFactory" />\r             <type uri="http://www.simantics.org/Sysdyn-1.0/DependencyConnection"\r                   class="org.simantics.sysdyn.ui.elements2.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
+       </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/Types/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 d9c2d89bd75ce46a0154d2f8c03908c4ee2fdc8f..54c5883233ba630ba0c60fdc3dee340b30ffa6d7 100644 (file)
@@ -7,12 +7,10 @@ import org.eclipse.ui.IWorkbenchPartSite;
 import org.simantics.browsing.ui.swt.IPropertyPage;\r
 import org.simantics.db.ReadGraph;\r
 import org.simantics.db.Session;\r
-import org.simantics.db.common.ResourceArray;\r
 import org.simantics.diagram.adapter.FlagClassFactory;\r
 import org.simantics.diagram.handler.CopyPasteHandler;\r
 import org.simantics.diagram.stubs.DiagramResource;\r
 import org.simantics.diagram.synchronization.IModifiableSynchronizationContext;\r
-import org.simantics.g2d.canvas.ICanvasContext;\r
 import org.simantics.g2d.canvas.impl.CanvasContext;\r
 import org.simantics.g2d.connection.IConnectionAdvisor;\r
 import org.simantics.g2d.diagram.DiagramHints;\r
@@ -22,11 +20,10 @@ import org.simantics.g2d.element.ElementClassProviders;
 import org.simantics.g2d.element.ElementClasses;\r
 import org.simantics.g2d.element.IElementClassProvider;\r
 import org.simantics.g2d.element.handler.impl.StaticObjectAdapter;\r
-import org.simantics.modeling.ui.diagramEditor.handlers.WorkbenchStructuralSelectionProvider2;\r
 import org.simantics.structural2.modelingRules.IModelingRules;\r
 import org.simantics.sysdyn.SysdynResource;\r
-import org.simantics.sysdyn.ui.elements2.ConnectionClasses;\r
-import org.simantics.sysdyn.ui.elements2.SysdynConnectionClass;\r
+import org.simantics.sysdyn.ui.elements2.connections.ConnectionClasses;\r
+import org.simantics.sysdyn.ui.elements2.connections.SysdynConnectionClass;\r
 import org.simantics.sysdyn.ui.properties.SysdynPropertyPage;\r
 \r
 /**\r
index 8bdc7864f3bc027d7e281165470065ce6c578c72..4bbf2ebc455a3e3690d7a56b72e999ad049ad044 100644 (file)
@@ -35,11 +35,10 @@ import org.simantics.g2d.participant.KeyUtil;
 import org.simantics.g2d.participant.MouseUtil;\r
 import org.simantics.g2d.participant.TransformUtil;\r
 import org.simantics.g2d.routing.RouterFactory;\r
-import org.simantics.g2d.snap.ISnapAdvisor;\r
 import org.simantics.g2d.utils.GeometryUtils;\r
 import org.simantics.sysdyn.ui.elements2.AuxiliaryFactory;\r
 import org.simantics.sysdyn.ui.elements2.CloudFactory;\r
-import org.simantics.sysdyn.ui.elements2.ConnectionClasses;\r
+import org.simantics.sysdyn.ui.elements2.connections.ConnectionClasses;\r
 \r
 /**\r
  * Pointer tool does the following operations with mouse:\r
@@ -103,7 +102,9 @@ public class PointerInteractor extends org.simantics.g2d.diagram.participant.poi
                 if (advisor == null || (advisor != null && advisor.canBeginConnection(null, ti.e, ti.t))) {\r
                     bsi = new ConnectTool(diagram, connectionClass, ti.e, ti.t, me.mouseId, curCanvasPos);\r
                 }\r
-            } else {\r
+            }  \r
+            /* Cannot be null\r
+            else {\r
                 ISnapAdvisor snapAdvisor = getHint(DiagramHints.SNAP_ADVISOR);\r
                 if(snapAdvisor != null) \r
                     snapAdvisor.snap(curCanvasPos);\r
@@ -111,6 +112,7 @@ public class PointerInteractor extends org.simantics.g2d.diagram.participant.poi
                 // Start connection out of thin air, without a terminal.\r
                 bsi = new ConnectTool(diagram, elementClassProvider.get(ConnectionClasses.DEPENDENCY), null, null, me.mouseId, curCanvasPos);\r
             }\r
+            */\r
             if (bsi != null) {\r
                 getContext().add(bsi);\r
                 return true;\r
index 8ea07b810a8e128b3b50899b27ed25e9969dc7cf..cc858c648cabd3b6988cb9af568edec260f7571c 100644 (file)
@@ -19,7 +19,7 @@ abstract public class GraphPropertyNode extends G2DNode {
 \r
        private PropertyChangeListener fieldListener = null;\r
        \r
-       GraphPropertyNode() {\r
+       protected GraphPropertyNode() {\r
                for(Field f : getClass().getFields()) {\r
 //                     System.out.println("register field '" + f.getName() + "'");\r
                        fields.put(f.getName(), f);\r
index 7a0b0eb1bfe1b56843cbbcd3b0592fb0fea0b456..4c0da883ba2dc1349be6ac02a655fcbea4f72b4b 100644 (file)
@@ -119,7 +119,6 @@ public class InputFactory extends SysdynElementFactory {
                         module = graph.getSingleObject(moduleRepresentation, b.Represents);\r
                         String parentURI = graph.getURI(parent);\r
                         String modelURI =  diagram.getHint((DiagramModelHints.KEY_DIAGRAM_MODEL_URI));\r
-                        System.out.println(parentURI + " < -- > " + modelURI);\r
                         if(parentURI.equals(modelURI))\r
                             moduleName = "";\r
                         else {\r
@@ -139,6 +138,10 @@ public class InputFactory extends SysdynElementFactory {
         }\r
 \r
         SysdynElementUtils.setInputReference(e, inputReference);\r
+        \r
+        Font font = ElementUtils.getTextFont(e);\r
+        font = font.deriveFont(font.getStyle() + Font.ITALIC);\r
+        ElementUtils.setTextFont(e, font);\r
     }\r
 \r
 \r
@@ -159,11 +162,8 @@ public class InputFactory extends SysdynElementFactory {
         @Override\r
         public void init(final IElement e, G2DParentNode parent) {\r
             super.init(e, parent);\r
-            TextNode name = (TextNode) e.getHint(SG_NODE);\r
-            Font font = name.getFont().deriveFont(Font.ITALIC);\r
-            name.setFont(font);\r
             TextNode node = ElementUtils.getOrCreateNode(e, parent, INPUT_SG_NODE, "input", TextNode.class);\r
-            font = ElementUtils.getTextFont(e);\r
+            Font font = ElementUtils.getTextFont(e);\r
             font = font.deriveFont((float) 10.0);\r
             font = font.deriveFont(Font.ITALIC);\r
             Color color = new Color(150, 150, 150);\r
index c3aad14dfa34f904ab08a42896c92a318ae30094..1863fc627bf59ec155d0ab5f63fbade7eba11603 100644 (file)
@@ -11,6 +11,7 @@
  *******************************************************************************/\r
 package org.simantics.sysdyn.ui.elements2;\r
 \r
+import java.awt.Font;\r
 import java.awt.geom.AffineTransform;\r
 import java.util.ArrayList;\r
 import java.util.Collection;\r
@@ -39,6 +40,7 @@ import org.simantics.g2d.element.IElement;
 import org.simantics.g2d.element.handler.impl.ObjectTerminal;\r
 import org.simantics.modeling.ModelingResources;\r
 import org.simantics.structural.stubs.StructuralResource2;\r
+import org.simantics.sysdyn.SysdynResource;\r
 \r
 /**\r
  * An ElementFactory that gathers common functionality for system dynamics symbols.\r
@@ -80,6 +82,12 @@ public abstract class SysdynElementFactory extends SyncElementFactory {
                 ElementUtils.setTextColor(e, G2DUtils.getColor(graph, colorResource));\r
         }\r
 \r
+        if (graph.hasStatement(component, SysdynResource.getInstance(graph).IsOutput)) {\r
+            Font font = ElementUtils.getTextFont(e);\r
+            font = font.deriveFont(Font.BOLD);\r
+            ElementUtils.setTextFont(e, font);\r
+        }\r
+\r
         AffineTransform at = DiagramGraphUtil.getAffineTransform(graph, element);\r
         ElementUtils.setTransform(e, at);\r
 \r
similarity index 96%
rename from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/Arcs.java
rename to org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/Arcs.java
index 98d04a602f8b11dccaed55c18356f67372797d01..70092ac67512a4be30827ce1e2747cc6f35627a2 100644 (file)
@@ -9,7 +9,7 @@
  * Contributors:\r
  *     VTT Technical Research Centre of Finland - initial API and implementation\r
  *******************************************************************************/\r
-package org.simantics.sysdyn.ui.elements2;\r
+package org.simantics.sysdyn.ui.elements2.connections;\r
 \r
 import java.awt.geom.Rectangle2D;\r
 \r
similarity index 95%
rename from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/Dependencies.java
rename to org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/Dependencies.java
index 0240ca8a117eb204c6f6974156740682ef02cb83..2fba1306b58b2554418bf383bc422b4cc89000c5 100644 (file)
@@ -9,7 +9,7 @@
  * Contributors:\r
  *     VTT Technical Research Centre of Finland - initial API and implementation\r
  *******************************************************************************/\r
-package org.simantics.sysdyn.ui.elements2;\r
+package org.simantics.sysdyn.ui.elements2.connections;\r
 \r
 import java.awt.Shape;\r
 import java.awt.geom.Arc2D;\r
similarity index 95%
rename from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/DependencyConnectionFactory.java
rename to org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/DependencyConnectionFactory.java
index 6be62fe2faefc5f1f5e3668612c67fc003a8abc8..403aa412d9a4f912aefc862b0be3c943803b0e8f 100644 (file)
@@ -9,7 +9,7 @@
  * Contributors:\r
  *     VTT Technical Research Centre of Finland - initial API and implementation\r
  *******************************************************************************/\r
-package org.simantics.sysdyn.ui.elements2;\r
+package org.simantics.sysdyn.ui.elements2.connections;\r
 \r
 import java.util.HashMap;\r
 import java.util.concurrent.ConcurrentSkipListMap;\r
@@ -18,7 +18,6 @@ import java.util.concurrent.atomic.AtomicInteger;
 import org.simantics.databoard.binding.java.StringBindingDefault;\r
 import org.simantics.db.AsyncReadGraph;\r
 import org.simantics.db.Resource;\r
-import org.simantics.db.Statement;\r
 import org.simantics.db.procedure.AsyncMultiProcedure;\r
 import org.simantics.db.procedure.AsyncProcedure;\r
 import org.simantics.diagram.adapter.ElementFactoryAdapter;\r
similarity index 97%
rename from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/DependencyEdgeClass.java
rename to org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/DependencyEdgeClass.java
index bfc0f5a015efbe76acc3099610a1265222acf73b..140bd0df192463eacd9fb263f422f6e51de4c0b7 100644 (file)
@@ -9,7 +9,7 @@
  * Contributors:\r
  *     VTT Technical Research Centre of Finland - initial API and implementation\r
  *******************************************************************************/\r
-package org.simantics.sysdyn.ui.elements2;\r
+package org.simantics.sysdyn.ui.elements2.connections;\r
 \r
 import java.awt.BasicStroke;\r
 import java.awt.Color;\r
similarity index 94%
rename from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/DependencyEdgeFactory.java
rename to org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/DependencyEdgeFactory.java
index 7443d0207ef3dfa24d710d2afb88965d8c66b06f..7713bdff570f8beb9387641167083bca2245d853 100644 (file)
@@ -9,7 +9,7 @@
  * Contributors:\r
  *     VTT Technical Research Centre of Finland - initial API and implementation\r
  *******************************************************************************/\r
-package org.simantics.sysdyn.ui.elements2;\r
+package org.simantics.sysdyn.ui.elements2.connections;\r
 \r
 import org.simantics.db.AsyncReadGraph;\r
 import org.simantics.db.Resource;\r
similarity index 92%
rename from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/DependencyNode.java
rename to org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/DependencyNode.java
index a99bd6adee2ff9368d8c6349016703f42836e071..a2a24a90cfa2fcf5fda17be2031e2bdbdb50bd4f 100644 (file)
@@ -1,4 +1,4 @@
-package org.simantics.sysdyn.ui.elements2;\r
+package org.simantics.sysdyn.ui.elements2.connections;\r
 \r
 import java.awt.BasicStroke;\r
 import java.awt.Color;\r
@@ -11,6 +11,7 @@ import java.awt.geom.Rectangle2D;
 import org.simantics.scenegraph.ISelectionPainterNode;\r
 import org.simantics.scenegraph.g2d.events.SGMouseEvent;\r
 import org.simantics.scenegraph.utils.NodeUtil;\r
+import org.simantics.sysdyn.ui.elements2.GraphPropertyNode;\r
 import org.simantics.utils.datastructures.Pair;\r
 \r
 public class DependencyNode extends GraphPropertyNode implements ISelectionPainterNode {\r
similarity index 95%
rename from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/FlowConnectionFactory.java
rename to org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/FlowConnectionFactory.java
index 691cf55e684a3143ce114bc9d3e2b875af53171c..57cc1fca1049f4923205236693e8f0cf72d47371 100644 (file)
@@ -9,7 +9,7 @@
  * Contributors:\r
  *     VTT Technical Research Centre of Finland - initial API and implementation\r
  *******************************************************************************/\r
-package org.simantics.sysdyn.ui.elements2;\r
+package org.simantics.sysdyn.ui.elements2.connections;\r
 \r
 import org.simantics.db.AsyncReadGraph;\r
 import org.simantics.db.Resource;\r
similarity index 96%
rename from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/FlowEdgeClass.java
rename to org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/FlowEdgeClass.java
index dbe63010957125b3e804f8b99c43dfd41d875eba..66874597f488be6f07c6af661aae8231a4086687 100644 (file)
@@ -9,7 +9,7 @@
  * Contributors:\r
  *     VTT Technical Research Centre of Finland - initial API and implementation\r
  *******************************************************************************/\r
-package org.simantics.sysdyn.ui.elements2;\r
+package org.simantics.sysdyn.ui.elements2.connections;\r
 \r
 import java.awt.BasicStroke;\r
 import java.awt.Color;\r
@@ -42,7 +42,6 @@ import org.simantics.g2d.element.handler.impl.ShapePick;
 import org.simantics.g2d.element.handler.impl.SimpleElementLayers;\r
 import org.simantics.g2d.elementclass.connection.EdgeClass.EdgeHandler;\r
 import org.simantics.g2d.elementclass.connection.EdgeClass.FixedTransform;\r
-import org.simantics.g2d.elementclass.valve.ValveClass.ValveHandle;\r
 import org.simantics.scenegraph.g2d.G2DParentNode;\r
 import org.simantics.sysdyn.ui.elements2.ValveFactory.ValveSceneGraph;\r
 import org.simantics.utils.datastructures.Callback;\r
similarity index 94%
rename from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/FlowEdgeFactory.java
rename to org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/FlowEdgeFactory.java
index 7d428da972ba1257d600f8043dba64a815d530d4..e2926c70cf507e3a0f21e5f9315cd1c70e033d91 100644 (file)
@@ -9,7 +9,7 @@
  * Contributors:\r
  *     VTT Technical Research Centre of Finland - initial API and implementation\r
  *******************************************************************************/\r
-package org.simantics.sysdyn.ui.elements2;\r
+package org.simantics.sysdyn.ui.elements2.connections;\r
 \r
 import org.simantics.db.AsyncReadGraph;\r
 import org.simantics.db.Resource;\r
similarity index 92%
rename from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/FlowNode.java
rename to org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/FlowNode.java
index f610330d40f4c29b16276518feddc7b357c43f3b..4b307b43337da265b523e45ef72dca4fb4f2b817 100644 (file)
@@ -1,4 +1,4 @@
-package org.simantics.sysdyn.ui.elements2;\r
+package org.simantics.sysdyn.ui.elements2.connections;\r
 \r
 import java.awt.BasicStroke;\r
 import java.awt.Color;\r
@@ -10,6 +10,7 @@ import java.awt.geom.Rectangle2D;
 \r
 import org.simantics.scenegraph.ISelectionPainterNode;\r
 import org.simantics.scenegraph.utils.NodeUtil;\r
+import org.simantics.sysdyn.ui.elements2.GraphPropertyNode;\r
 import org.simantics.utils.datastructures.Pair;\r
 \r
 public class FlowNode extends GraphPropertyNode implements ISelectionPainterNode {\r
similarity index 84%
rename from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/FlowStroke.java
rename to org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/FlowStroke.java
index 76e7d4deb78e8e0aa6e8100ff3c0a8fbdbf27be9..137d9c547e19363be29f1413766837b93ef8b9dd 100644 (file)
@@ -1,4 +1,4 @@
-package org.simantics.sysdyn.ui.elements2;\r
+package org.simantics.sysdyn.ui.elements2.connections;\r
 \r
 import java.awt.Shape;\r
 import java.awt.Stroke;\r
similarity index 96%
rename from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/Flows.java
rename to org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/Flows.java
index af6bf2dcd1a71af81fec4fa9ed39619397110397..fc00fa7fed30d255f3cd853d2f8197fbf06ce3c9 100644 (file)
@@ -9,7 +9,7 @@
  * Contributors:\r
  *     VTT Technical Research Centre of Finland - initial API and implementation\r
  *******************************************************************************/\r
-package org.simantics.sysdyn.ui.elements2;\r
+package org.simantics.sysdyn.ui.elements2.connections;\r
 \r
 import java.awt.Shape;\r
 import java.awt.geom.Path2D;\r
similarity index 97%
rename from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/SysdynConnectionClass.java
rename to org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/SysdynConnectionClass.java
index c8940eaf7b2e2f34103a5b4ef0a2949929bfc273..aad41db232ca189c91fb19495402892a5736cb96 100644 (file)
@@ -9,7 +9,7 @@
  * Contributors:\r
  *     VTT Technical Research Centre of Finland - initial API and implementation\r
  *******************************************************************************/\r
-package org.simantics.sysdyn.ui.elements2;\r
+package org.simantics.sysdyn.ui.elements2.connections;\r
 \r
 import java.awt.Composite;\r
 import java.awt.Shape;\r
@@ -19,7 +19,6 @@ import java.awt.geom.Rectangle2D;
 import java.util.ArrayList;\r
 import java.util.Collection;\r
 import java.util.Collections;\r
-import java.util.HashMap;\r
 import java.util.HashSet;\r
 import java.util.List;\r
 import java.util.Map;\r
index 5977c09ca092547db54d20623edbf413cb65461e..bcf9047f11a61aaa8dbdf7690799770e2c8d3935 100644 (file)
@@ -1,15 +1,28 @@
 package org.simantics.sysdyn.ui.properties;\r
 \r
+import org.eclipse.jface.layout.GridDataFactory;\r
+import org.eclipse.jface.layout.GridLayoutFactory;\r
+import org.eclipse.swt.SWT;\r
 import org.eclipse.swt.widgets.Composite;\r
 import org.eclipse.ui.IWorkbenchSite;\r
 import org.simantics.browsing.ui.swt.PropertyTabContributorImpl;\r
+import org.simantics.browsing.ui.swt.widgets.StringPropertyFactory;\r
+import org.simantics.browsing.ui.swt.widgets.StringPropertyModifier;\r
+import org.simantics.browsing.ui.swt.widgets.TrackedText;\r
 import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport;\r
+import org.simantics.db.Builtins;\r
 import org.simantics.db.management.ISessionContext;\r
 \r
 public class ModuleTab extends PropertyTabContributorImpl {\r
 \r
     @Override\r
     public void createControls(Composite body, IWorkbenchSite site, ISessionContext context, WidgetSupport support) {\r
-        \r
+        Composite composite = new Composite(body, SWT.NONE);\r
+        GridDataFactory.fillDefaults().grab(true, true).applyTo(composite);\r
+        GridLayoutFactory.fillDefaults().margins(3, 3).numColumns(6).applyTo(composite);\r
+        TrackedText nameText = new TrackedText(composite, support, SWT.BORDER);\r
+        nameText.setTextFactory(new StringPropertyFactory(Builtins.URIs.HasName));\r
+        nameText.addModifyListener(new StringPropertyModifier(context, Builtins.URIs.HasName));\r
+        GridDataFactory.fillDefaults().grab(true, false).applyTo(nameText.getWidget());\r
     }\r
 }\r