From 6beeb0145d0f5ce5b6c55b2e95912f02e28191f5 Mon Sep 17 00:00:00 2001 From: lempinen Date: Wed, 28 Jul 2010 08:01:13 +0000 Subject: [PATCH] Reorganizing crowded element2 -package git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@16858 ac1ea38d-2e2b-0410-8846-a27921b304fc --- org.simantics.sysdyn.ui/adapters.xml | 2 +- .../simantics/sysdyn/ui/editor/DiagramViewer.java | 7 ++----- .../ui/editor/participant/PointerInteractor.java | 8 +++++--- .../sysdyn/ui/elements2/GraphPropertyNode.java | 2 +- .../sysdyn/ui/elements2/InputFactory.java | 10 +++++----- .../sysdyn/ui/elements2/SysdynElementFactory.java | 8 ++++++++ .../ui/elements2/{ => connections}/Arcs.java | 2 +- .../{ => connections}/ConnectionClasses.java | 2 +- .../elements2/{ => connections}/Dependencies.java | 2 +- .../DependencyConnectionFactory.java | 3 +-- .../{ => connections}/DependencyEdgeClass.java | 2 +- .../{ => connections}/DependencyEdgeFactory.java | 2 +- .../{ => connections}/DependencyNode.java | 3 ++- .../{ => connections}/FlowConnectionFactory.java | 2 +- .../{ => connections}/FlowEdgeClass.java | 3 +-- .../{ => connections}/FlowEdgeFactory.java | 2 +- .../ui/elements2/{ => connections}/FlowNode.java | 3 ++- .../elements2/{ => connections}/FlowStroke.java | 2 +- .../ui/elements2/{ => connections}/Flows.java | 2 +- .../{ => connections}/SysdynConnectionClass.java | 3 +-- .../simantics/sysdyn/ui/properties/ModuleTab.java | 15 ++++++++++++++- 21 files changed, 52 insertions(+), 33 deletions(-) rename org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/{ => connections}/Arcs.java (96%) rename org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/{ => connections}/ConnectionClasses.java (87%) rename org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/{ => connections}/Dependencies.java (95%) rename org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/{ => connections}/DependencyConnectionFactory.java (95%) rename org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/{ => connections}/DependencyEdgeClass.java (97%) rename org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/{ => connections}/DependencyEdgeFactory.java (94%) rename org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/{ => connections}/DependencyNode.java (92%) rename org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/{ => connections}/FlowConnectionFactory.java (95%) rename org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/{ => connections}/FlowEdgeClass.java (96%) rename org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/{ => connections}/FlowEdgeFactory.java (94%) rename org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/{ => connections}/FlowNode.java (92%) rename org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/{ => connections}/FlowStroke.java (84%) rename org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/{ => connections}/Flows.java (96%) rename org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/{ => connections}/SysdynConnectionClass.java (97%) diff --git a/org.simantics.sysdyn.ui/adapters.xml b/org.simantics.sysdyn.ui/adapters.xml index 339b34aa..a3dd609e 100644 --- a/org.simantics.sysdyn.ui/adapters.xml +++ b/org.simantics.sysdyn.ui/adapters.xml @@ -25,5 +25,5 @@ - none 0 fill 1 + none 0 fill 1 \ No newline at end of file diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/DiagramViewer.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/DiagramViewer.java index d9c2d89b..54c58832 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/DiagramViewer.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/DiagramViewer.java @@ -7,12 +7,10 @@ import org.eclipse.ui.IWorkbenchPartSite; import org.simantics.browsing.ui.swt.IPropertyPage; import org.simantics.db.ReadGraph; import org.simantics.db.Session; -import org.simantics.db.common.ResourceArray; import org.simantics.diagram.adapter.FlagClassFactory; import org.simantics.diagram.handler.CopyPasteHandler; import org.simantics.diagram.stubs.DiagramResource; import org.simantics.diagram.synchronization.IModifiableSynchronizationContext; -import org.simantics.g2d.canvas.ICanvasContext; import org.simantics.g2d.canvas.impl.CanvasContext; import org.simantics.g2d.connection.IConnectionAdvisor; import org.simantics.g2d.diagram.DiagramHints; @@ -22,11 +20,10 @@ import org.simantics.g2d.element.ElementClassProviders; import org.simantics.g2d.element.ElementClasses; import org.simantics.g2d.element.IElementClassProvider; import org.simantics.g2d.element.handler.impl.StaticObjectAdapter; -import org.simantics.modeling.ui.diagramEditor.handlers.WorkbenchStructuralSelectionProvider2; import org.simantics.structural2.modelingRules.IModelingRules; import org.simantics.sysdyn.SysdynResource; -import org.simantics.sysdyn.ui.elements2.ConnectionClasses; -import org.simantics.sysdyn.ui.elements2.SysdynConnectionClass; +import org.simantics.sysdyn.ui.elements2.connections.ConnectionClasses; +import org.simantics.sysdyn.ui.elements2.connections.SysdynConnectionClass; import org.simantics.sysdyn.ui.properties.SysdynPropertyPage; /** diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/participant/PointerInteractor.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/participant/PointerInteractor.java index 8bdc7864..4bbf2ebc 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/participant/PointerInteractor.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/participant/PointerInteractor.java @@ -35,11 +35,10 @@ import org.simantics.g2d.participant.KeyUtil; import org.simantics.g2d.participant.MouseUtil; import org.simantics.g2d.participant.TransformUtil; import org.simantics.g2d.routing.RouterFactory; -import org.simantics.g2d.snap.ISnapAdvisor; import org.simantics.g2d.utils.GeometryUtils; import org.simantics.sysdyn.ui.elements2.AuxiliaryFactory; import org.simantics.sysdyn.ui.elements2.CloudFactory; -import org.simantics.sysdyn.ui.elements2.ConnectionClasses; +import org.simantics.sysdyn.ui.elements2.connections.ConnectionClasses; /** * Pointer tool does the following operations with mouse: @@ -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))) { bsi = new ConnectTool(diagram, connectionClass, ti.e, ti.t, me.mouseId, curCanvasPos); } - } else { + } + /* Cannot be null + else { ISnapAdvisor snapAdvisor = getHint(DiagramHints.SNAP_ADVISOR); if(snapAdvisor != null) snapAdvisor.snap(curCanvasPos); @@ -111,6 +112,7 @@ public class PointerInteractor extends org.simantics.g2d.diagram.participant.poi // Start connection out of thin air, without a terminal. bsi = new ConnectTool(diagram, elementClassProvider.get(ConnectionClasses.DEPENDENCY), null, null, me.mouseId, curCanvasPos); } + */ if (bsi != null) { getContext().add(bsi); return true; diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/GraphPropertyNode.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/GraphPropertyNode.java index 8ea07b81..cc858c64 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/GraphPropertyNode.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/GraphPropertyNode.java @@ -19,7 +19,7 @@ abstract public class GraphPropertyNode extends G2DNode { private PropertyChangeListener fieldListener = null; - GraphPropertyNode() { + protected GraphPropertyNode() { for(Field f : getClass().getFields()) { // System.out.println("register field '" + f.getName() + "'"); fields.put(f.getName(), f); diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/InputFactory.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/InputFactory.java index 7a0b0eb1..4c0da883 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/InputFactory.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/InputFactory.java @@ -119,7 +119,6 @@ public class InputFactory extends SysdynElementFactory { module = graph.getSingleObject(moduleRepresentation, b.Represents); String parentURI = graph.getURI(parent); String modelURI = diagram.getHint((DiagramModelHints.KEY_DIAGRAM_MODEL_URI)); - System.out.println(parentURI + " < -- > " + modelURI); if(parentURI.equals(modelURI)) moduleName = ""; else { @@ -139,6 +138,10 @@ public class InputFactory extends SysdynElementFactory { } SysdynElementUtils.setInputReference(e, inputReference); + + Font font = ElementUtils.getTextFont(e); + font = font.deriveFont(font.getStyle() + Font.ITALIC); + ElementUtils.setTextFont(e, font); } @@ -159,11 +162,8 @@ public class InputFactory extends SysdynElementFactory { @Override public void init(final IElement e, G2DParentNode parent) { super.init(e, parent); - TextNode name = (TextNode) e.getHint(SG_NODE); - Font font = name.getFont().deriveFont(Font.ITALIC); - name.setFont(font); TextNode node = ElementUtils.getOrCreateNode(e, parent, INPUT_SG_NODE, "input", TextNode.class); - font = ElementUtils.getTextFont(e); + Font font = ElementUtils.getTextFont(e); font = font.deriveFont((float) 10.0); font = font.deriveFont(Font.ITALIC); Color color = new Color(150, 150, 150); diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/SysdynElementFactory.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/SysdynElementFactory.java index c3aad14d..1863fc62 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/SysdynElementFactory.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/SysdynElementFactory.java @@ -11,6 +11,7 @@ *******************************************************************************/ package org.simantics.sysdyn.ui.elements2; +import java.awt.Font; import java.awt.geom.AffineTransform; import java.util.ArrayList; import java.util.Collection; @@ -39,6 +40,7 @@ import org.simantics.g2d.element.IElement; import org.simantics.g2d.element.handler.impl.ObjectTerminal; import org.simantics.modeling.ModelingResources; import org.simantics.structural.stubs.StructuralResource2; +import org.simantics.sysdyn.SysdynResource; /** * An ElementFactory that gathers common functionality for system dynamics symbols. @@ -80,6 +82,12 @@ public abstract class SysdynElementFactory extends SyncElementFactory { ElementUtils.setTextColor(e, G2DUtils.getColor(graph, colorResource)); } + if (graph.hasStatement(component, SysdynResource.getInstance(graph).IsOutput)) { + Font font = ElementUtils.getTextFont(e); + font = font.deriveFont(Font.BOLD); + ElementUtils.setTextFont(e, font); + } + AffineTransform at = DiagramGraphUtil.getAffineTransform(graph, element); ElementUtils.setTransform(e, at); diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/Arcs.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/Arcs.java 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 98d04a60..70092ac6 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/Arcs.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/Arcs.java @@ -9,7 +9,7 @@ * Contributors: * VTT Technical Research Centre of Finland - initial API and implementation *******************************************************************************/ -package org.simantics.sysdyn.ui.elements2; +package org.simantics.sysdyn.ui.elements2.connections; import java.awt.geom.Rectangle2D; diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/ConnectionClasses.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/ConnectionClasses.java similarity index 87% rename from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/ConnectionClasses.java rename to org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/ConnectionClasses.java index 63447fd5..4d090671 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/ConnectionClasses.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/ConnectionClasses.java @@ -1,4 +1,4 @@ -package org.simantics.sysdyn.ui.elements2; +package org.simantics.sysdyn.ui.elements2.connections; public class ConnectionClasses { diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/Dependencies.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/Dependencies.java 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 0240ca8a..2fba1306 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/Dependencies.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/Dependencies.java @@ -9,7 +9,7 @@ * Contributors: * VTT Technical Research Centre of Finland - initial API and implementation *******************************************************************************/ -package org.simantics.sysdyn.ui.elements2; +package org.simantics.sysdyn.ui.elements2.connections; import java.awt.Shape; import java.awt.geom.Arc2D; diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/DependencyConnectionFactory.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/DependencyConnectionFactory.java 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 6be62fe2..403aa412 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/DependencyConnectionFactory.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/DependencyConnectionFactory.java @@ -9,7 +9,7 @@ * Contributors: * VTT Technical Research Centre of Finland - initial API and implementation *******************************************************************************/ -package org.simantics.sysdyn.ui.elements2; +package org.simantics.sysdyn.ui.elements2.connections; import java.util.HashMap; import java.util.concurrent.ConcurrentSkipListMap; @@ -18,7 +18,6 @@ import java.util.concurrent.atomic.AtomicInteger; import org.simantics.databoard.binding.java.StringBindingDefault; import org.simantics.db.AsyncReadGraph; import org.simantics.db.Resource; -import org.simantics.db.Statement; import org.simantics.db.procedure.AsyncMultiProcedure; import org.simantics.db.procedure.AsyncProcedure; import org.simantics.diagram.adapter.ElementFactoryAdapter; diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/DependencyEdgeClass.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/DependencyEdgeClass.java 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 bfc0f5a0..140bd0df 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/DependencyEdgeClass.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/DependencyEdgeClass.java @@ -9,7 +9,7 @@ * Contributors: * VTT Technical Research Centre of Finland - initial API and implementation *******************************************************************************/ -package org.simantics.sysdyn.ui.elements2; +package org.simantics.sysdyn.ui.elements2.connections; import java.awt.BasicStroke; import java.awt.Color; diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/DependencyEdgeFactory.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/DependencyEdgeFactory.java 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 7443d020..7713bdff 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/DependencyEdgeFactory.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/DependencyEdgeFactory.java @@ -9,7 +9,7 @@ * Contributors: * VTT Technical Research Centre of Finland - initial API and implementation *******************************************************************************/ -package org.simantics.sysdyn.ui.elements2; +package org.simantics.sysdyn.ui.elements2.connections; import org.simantics.db.AsyncReadGraph; import org.simantics.db.Resource; diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/DependencyNode.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/DependencyNode.java 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 a99bd6ad..a2a24a90 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/DependencyNode.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/DependencyNode.java @@ -1,4 +1,4 @@ -package org.simantics.sysdyn.ui.elements2; +package org.simantics.sysdyn.ui.elements2.connections; import java.awt.BasicStroke; import java.awt.Color; @@ -11,6 +11,7 @@ import java.awt.geom.Rectangle2D; import org.simantics.scenegraph.ISelectionPainterNode; import org.simantics.scenegraph.g2d.events.SGMouseEvent; import org.simantics.scenegraph.utils.NodeUtil; +import org.simantics.sysdyn.ui.elements2.GraphPropertyNode; import org.simantics.utils.datastructures.Pair; public class DependencyNode extends GraphPropertyNode implements ISelectionPainterNode { diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/FlowConnectionFactory.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/FlowConnectionFactory.java 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 691cf55e..57cc1fca 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/FlowConnectionFactory.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/FlowConnectionFactory.java @@ -9,7 +9,7 @@ * Contributors: * VTT Technical Research Centre of Finland - initial API and implementation *******************************************************************************/ -package org.simantics.sysdyn.ui.elements2; +package org.simantics.sysdyn.ui.elements2.connections; import org.simantics.db.AsyncReadGraph; import org.simantics.db.Resource; diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/FlowEdgeClass.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/FlowEdgeClass.java 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 dbe63010..66874597 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/FlowEdgeClass.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/FlowEdgeClass.java @@ -9,7 +9,7 @@ * Contributors: * VTT Technical Research Centre of Finland - initial API and implementation *******************************************************************************/ -package org.simantics.sysdyn.ui.elements2; +package org.simantics.sysdyn.ui.elements2.connections; import java.awt.BasicStroke; import java.awt.Color; @@ -42,7 +42,6 @@ import org.simantics.g2d.element.handler.impl.ShapePick; import org.simantics.g2d.element.handler.impl.SimpleElementLayers; import org.simantics.g2d.elementclass.connection.EdgeClass.EdgeHandler; import org.simantics.g2d.elementclass.connection.EdgeClass.FixedTransform; -import org.simantics.g2d.elementclass.valve.ValveClass.ValveHandle; import org.simantics.scenegraph.g2d.G2DParentNode; import org.simantics.sysdyn.ui.elements2.ValveFactory.ValveSceneGraph; import org.simantics.utils.datastructures.Callback; diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/FlowEdgeFactory.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/FlowEdgeFactory.java 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 7d428da9..e2926c70 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/FlowEdgeFactory.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/FlowEdgeFactory.java @@ -9,7 +9,7 @@ * Contributors: * VTT Technical Research Centre of Finland - initial API and implementation *******************************************************************************/ -package org.simantics.sysdyn.ui.elements2; +package org.simantics.sysdyn.ui.elements2.connections; import org.simantics.db.AsyncReadGraph; import org.simantics.db.Resource; diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/FlowNode.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/FlowNode.java 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 f610330d..4b307b43 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/FlowNode.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/FlowNode.java @@ -1,4 +1,4 @@ -package org.simantics.sysdyn.ui.elements2; +package org.simantics.sysdyn.ui.elements2.connections; import java.awt.BasicStroke; import java.awt.Color; @@ -10,6 +10,7 @@ import java.awt.geom.Rectangle2D; import org.simantics.scenegraph.ISelectionPainterNode; import org.simantics.scenegraph.utils.NodeUtil; +import org.simantics.sysdyn.ui.elements2.GraphPropertyNode; import org.simantics.utils.datastructures.Pair; public class FlowNode extends GraphPropertyNode implements ISelectionPainterNode { diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/FlowStroke.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/FlowStroke.java 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 76e7d4de..137d9c54 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/FlowStroke.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/FlowStroke.java @@ -1,4 +1,4 @@ -package org.simantics.sysdyn.ui.elements2; +package org.simantics.sysdyn.ui.elements2.connections; import java.awt.Shape; import java.awt.Stroke; diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/Flows.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/Flows.java 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 af6bf2dc..fc00fa7f 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/Flows.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/Flows.java @@ -9,7 +9,7 @@ * Contributors: * VTT Technical Research Centre of Finland - initial API and implementation *******************************************************************************/ -package org.simantics.sysdyn.ui.elements2; +package org.simantics.sysdyn.ui.elements2.connections; import java.awt.Shape; import java.awt.geom.Path2D; diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/SysdynConnectionClass.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/SysdynConnectionClass.java 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 c8940eaf..aad41db2 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/SysdynConnectionClass.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/SysdynConnectionClass.java @@ -9,7 +9,7 @@ * Contributors: * VTT Technical Research Centre of Finland - initial API and implementation *******************************************************************************/ -package org.simantics.sysdyn.ui.elements2; +package org.simantics.sysdyn.ui.elements2.connections; import java.awt.Composite; import java.awt.Shape; @@ -19,7 +19,6 @@ import java.awt.geom.Rectangle2D; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; -import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ModuleTab.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ModuleTab.java index 5977c09c..bcf9047f 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ModuleTab.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ModuleTab.java @@ -1,15 +1,28 @@ package org.simantics.sysdyn.ui.properties; +import org.eclipse.jface.layout.GridDataFactory; +import org.eclipse.jface.layout.GridLayoutFactory; +import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.IWorkbenchSite; import org.simantics.browsing.ui.swt.PropertyTabContributorImpl; +import org.simantics.browsing.ui.swt.widgets.StringPropertyFactory; +import org.simantics.browsing.ui.swt.widgets.StringPropertyModifier; +import org.simantics.browsing.ui.swt.widgets.TrackedText; import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport; +import org.simantics.db.Builtins; import org.simantics.db.management.ISessionContext; public class ModuleTab extends PropertyTabContributorImpl { @Override public void createControls(Composite body, IWorkbenchSite site, ISessionContext context, WidgetSupport support) { - + Composite composite = new Composite(body, SWT.NONE); + GridDataFactory.fillDefaults().grab(true, true).applyTo(composite); + GridLayoutFactory.fillDefaults().margins(3, 3).numColumns(6).applyTo(composite); + TrackedText nameText = new TrackedText(composite, support, SWT.BORDER); + nameText.setTextFactory(new StringPropertyFactory(Builtins.URIs.HasName)); + nameText.addModifyListener(new StringPropertyModifier(context, Builtins.URIs.HasName)); + GridDataFactory.fillDefaults().grab(true, false).applyTo(nameText.getWidget()); } } -- 2.47.1