From: Tuukka Lehtonen Date: Fri, 9 Sep 2016 12:46:09 +0000 (+0300) Subject: Sync git svn branch with SVN repository r33184. X-Git-Tag: v1.25.0~131^2 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=0e8cf1e1708870e179330c2f9af2d03589d553ab;p=simantics%2Fplatform.git Sync git svn branch with SVN repository r33184. refs #6621 refs #6679 refs #6682 --- diff --git a/bundles/org.simantics.diagram/src/org/simantics/diagram/participant/ConnectionBuilder.java b/bundles/org.simantics.diagram/src/org/simantics/diagram/participant/ConnectionBuilder.java index 6b78af1b8..1fcf074cd 100644 --- a/bundles/org.simantics.diagram/src/org/simantics/diagram/participant/ConnectionBuilder.java +++ b/bundles/org.simantics.diagram/src/org/simantics/diagram/participant/ConnectionBuilder.java @@ -70,6 +70,7 @@ import org.simantics.g2d.element.handler.EdgeVisuals.EdgeEnd; import org.simantics.g2d.element.impl.Element; import org.simantics.g2d.elementclass.BranchPoint; import org.simantics.g2d.elementclass.FlagClass; +import org.simantics.g2d.elementclass.FlagClass.Type; import org.simantics.layer0.Layer0; import org.simantics.modeling.ModelingResources; import org.simantics.scl.runtime.tuple.Tuple2; @@ -548,6 +549,22 @@ public class ConnectionBuilder { Resource flagConnection = ConnectionUtil.getConnection(graph, flagConnector); Collection flagRouteNodes = graph.getObjects(flagConnector, DIA.AreConnected); + Resource connectionToKeep = attachToConnection; + Resource connectionToRemove = flagConnection; + if (!connectionToKeep.equals(connectionToRemove)) { + Resource hasElementToComponent1 = graph.getPossibleObject(attachToConnection, MOD.ElementToComponent); + Resource hasElementToComponent2 = graph.getPossibleObject(flagConnection, MOD.ElementToComponent); + Type flagType = FlagUtil.getFlagType(graph, flagToRemove); + if (hasElementToComponent1 != null && hasElementToComponent2 != null) + throw new UnsupportedOperationException( + "Both attached connection " + attachToConnection + " and flag connection " + flagConnection + + " have mapped components, can't decide which connection to remove in join operation"); + if (hasElementToComponent2 != null || flagType == Type.Out) { + connectionToKeep = flagConnection; + connectionToRemove = attachToConnection; + } + } + // Remove flag and its connector. graph.deny(flagToConnector); new RemoveElement((Resource)diagram.getHint(DiagramModelHints.KEY_DIAGRAM_RESOURCE), flagToRemove).perform(graph); @@ -564,19 +581,26 @@ public class ConnectionBuilder { } } - for (Statement routeNode : graph.getStatements(flagConnection, DIA.HasInteriorRouteNode)) { - graph.deny(routeNode); - graph.claim(attachToConnection, routeNode.getPredicate(), routeNode.getObject()); - } - for (Statement connector : graph.getStatements(flagConnection, DIA.HasConnector)) { - graph.deny(connector); - graph.claim(attachToConnection, connector.getPredicate(), connector.getObject()); - } + moveStatements(graph, connectionToRemove, connectionToKeep, DIA.HasInteriorRouteNode); + moveStatements(graph, connectionToRemove, connectionToKeep, DIA.HasConnector); + + // Remove obsolete connection + if (!connectionToKeep.equals(connectionToRemove)) + cu.removeConnection(connectionToRemove); CommentMetadata cm = graph.getMetadata(CommentMetadata.class); graph.addMetadata(cm.add("Joined connection to disconnected flag")); } + private void moveStatements(WriteGraph graph, Resource source, Resource target, Resource movedRelation) throws DatabaseException { + if (!source.equals(target)) { + for (Statement s : graph.getStatements(source, movedRelation)) { + graph.deny(s); + graph.claim(target, s.getPredicate(), s.getObject()); + } + } + } + private Collection removeUntilOrientedRouteline(WriteGraph graph, boolean expectedOrientation, Resource routeNode) throws DatabaseException { List result = new ArrayList<>(2); Deque work = new ArrayDeque<>(2); diff --git a/bundles/org.simantics.document.server.io/src/org/simantics/document/server/io/IAbstractRequestInterface.java b/bundles/org.simantics.document.server.io/src/org/simantics/document/server/io/IAbstractRequestInterface.java index 5253b3ed9..041953490 100644 --- a/bundles/org.simantics.document.server.io/src/org/simantics/document/server/io/IAbstractRequestInterface.java +++ b/bundles/org.simantics.document.server.io/src/org/simantics/document/server/io/IAbstractRequestInterface.java @@ -15,4 +15,5 @@ public interface IAbstractRequestInterface { public void subscribeDocument(String document, String sessionGUID, IDocumentListener documentListener); public IJSONResult readChanges(String uri, String sessionGUID, int sequenceNumber); public void initializeDocument(String documentURI, String sessionGUID, CommandContext context); + public void onPoll(String sessionGUID); } diff --git a/bundles/org.simantics.fileimport/build.properties b/bundles/org.simantics.fileimport/build.properties index a98f3f123..a26ce7b6b 100644 --- a/bundles/org.simantics.fileimport/build.properties +++ b/bundles/org.simantics.fileimport/build.properties @@ -1,7 +1,7 @@ output.. = bin/ bin.includes = META-INF/,\ .,\ - OSGI-INF/FileReferenceFileImport.xml,\ + OSGI-INF/, OSGI-INF/FileReferenceFileImport.xml,\ OSGI-INF/LibraryFolderFileImport.xml,\ scl/ diff --git a/features/org.simantics.sdk.feature/feature.xml b/features/org.simantics.sdk.feature/feature.xml index 41c08423a..ee4a899a1 100644 --- a/features/org.simantics.sdk.feature/feature.xml +++ b/features/org.simantics.sdk.feature/feature.xml @@ -144,4 +144,18 @@ id="org.simantics.document.linking" version="0.0.0"/> + + + + diff --git a/releng/org.simantics.target/rmap/SDK.rmap b/releng/org.simantics.target/rmap/SDK.rmap index 71eeaa710..30cba0d39 100644 --- a/releng/org.simantics.target/rmap/SDK.rmap +++ b/releng/org.simantics.target/rmap/SDK.rmap @@ -1,123 +1,123 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns="http://www.eclipse.org/buckminster/RMap-1.0" + xmlns:bc="http://www.eclipse.org/buckminster/Common-1.0" + xmlns:pv="http://www.eclipse.org/buckminster/Provider-1.0"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -135,40 +135,40 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -186,8 +186,8 @@ - - + + @@ -195,31 +195,31 @@ - - - + + + - - - - + + + + - - + + - - - - - + + + + + - - - + + + @@ -271,204 +271,204 @@ - - - - - + + + + + - - - - - + + + + + - - - - + + + + - - - + + + - - - - - + + + + + - - - + + + - - - - + + + + - - - - - + + + + + - - - - - - - - + + + + + + + + - - - + + + - - - - + + + + - - - - - + + + + + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -486,56 +486,56 @@ - - - - + + + + - - - + + + - + - - - - - - - - + + + + + + + + - - - - - + + + + + - - - + + + - - - - + + + + - - - - - + + + + + - - - + + + @@ -554,156 +554,138 @@ - - - - + + + + - - - + + + - + - - - - - + + + + + - - - - - - + + + + + + + + + + --> + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -711,9 +693,9 @@ - - - + + + diff --git a/releng/org.simantics.target/rmap/Simantics.rmap b/releng/org.simantics.target/rmap/Simantics.rmap index bddbcf45a..da0e1ec2a 100644 --- a/releng/org.simantics.target/rmap/Simantics.rmap +++ b/releng/org.simantics.target/rmap/Simantics.rmap @@ -2,15 +2,6 @@ - -