]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Use Consumer interface instead of deprecated Callback interface. 93/1293/1
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Thu, 7 Dec 2017 07:03:13 +0000 (09:03 +0200)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Thu, 7 Dec 2017 07:03:13 +0000 (09:03 +0200)
refs #7655

Change-Id: I1693131d49f2dbcd29da41abe2e8c66f72e2aa81

bundles/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/participant/SysdynConnectTool.java
bundles/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/LoopNode.java
bundles/org.simantics.sysdyn/src/org/simantics/sysdyn/adapter/VariableValueSubscription.java

index e08193eac62d848046d95e6d5deea115d8c55b29..f4faa9fd3b00ae7d9072e2f5fb2ba4e3159b556c 100644 (file)
@@ -56,7 +56,6 @@ import org.simantics.sysdyn.ui.elements.SysdynElementHints;
 import org.simantics.sysdyn.ui.elements.ValveFactory.ValveSceneGraph;\r
 import org.simantics.sysdyn.ui.elements.connections.ConnectionClasses;\r
 import org.simantics.ui.SimanticsUI;\r
-import org.simantics.utils.datastructures.Callback;\r
 import org.simantics.utils.datastructures.Pair;\r
 import org.simantics.utils.ui.ErrorLogger;\r
 import org.simantics.utils.ui.ExceptionUtils;\r
@@ -461,12 +460,9 @@ public class SysdynConnectTool extends ConnectTool2 {
                        public void perform(WriteGraph graph) throws DatabaseException {\r
                                builder.create(graph, judgment, controlPoints, startTerminal, endTerminal);\r
                        }\r
-               }, new Callback<DatabaseException>() {\r
-                       @Override\r
-                       public void run(DatabaseException parameter) {\r
-                               if (parameter != null)\r
-                                       ExceptionUtils.logAndShowError(parameter);\r
-                       }\r
+               }, e -> {\r
+                       if (e != null)\r
+                               ExceptionUtils.logAndShowError(e);\r
                });\r
-       }    \r
+       }\r
 }\r
index 865ddf6586ea72d528a185d6f3b065db188f6641..57289682c80328e6c70f47010dce82efc655dbe7 100644 (file)
@@ -86,7 +86,7 @@ public class LoopNode extends HoverShapeNode {
                List<Resource> loopItems = getAllLoopItems();\r
                \r
                // Get the diagram where this loop is.\r
-               RTreeNode diagramNode = (RTreeNode)NodeUtil.getNearestParentOfType(this, RTreeNode.class);\r
+               RTreeNode diagramNode = (RTreeNode)NodeUtil.getPossibleNearestParentOfType(this, RTreeNode.class);\r
                if (diagramNode == null)\r
                        return;\r
                \r
index a283e94c1d3bab2b8e35c6aee0ea124351976acb..74915babac482bed95eb89bab899195ff8aeec01 100644 (file)
@@ -24,7 +24,6 @@ import org.simantics.db.procedure.Listener;
 import org.simantics.db.request.ExternalRead;\r
 import org.simantics.db.service.QueryControl;\r
 import org.simantics.utils.ObjectUtils;\r
-import org.simantics.utils.datastructures.Callback;\r
 \r
 public class VariableValueSubscription<T> {\r
     \r
@@ -106,12 +105,9 @@ public class VariableValueSubscription<T> {
                                        requests.add(read);\r
                                graph.getService(QueryControl.class).gc(graph, requests);\r
                        }\r
-               }, new Callback<DatabaseException>() {\r
-                       @Override\r
-                       public void run(DatabaseException e) {\r
-                               if (e != null)\r
-                                       e.printStackTrace();\r
-                       }\r
+               }, e -> {\r
+                       if (e != null)\r
+                               e.printStackTrace();\r
                });\r
        }\r
 \r