From 871c099c9e3bd940029ab2cd9ac4565324b065ce Mon Sep 17 00:00:00 2001 From: luukkainen Date: Thu, 2 Jun 2016 15:15:31 +0000 Subject: [PATCH] refs #6520 git-svn-id: https://www.simantics.org/svn/simantics/interoperability/trunk@32834 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../interop/browsing/INodeEvaluators.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/org.simantics.interop/src/org/simantics/interop/browsing/INodeEvaluators.java b/org.simantics.interop/src/org/simantics/interop/browsing/INodeEvaluators.java index cbd6900..4c8d045 100644 --- a/org.simantics.interop/src/org/simantics/interop/browsing/INodeEvaluators.java +++ b/org.simantics.interop/src/org/simantics/interop/browsing/INodeEvaluators.java @@ -3,6 +3,8 @@ package org.simantics.interop.browsing; import java.util.Collection; import java.util.Collections; import java.util.Map; +import java.util.function.Consumer; +import java.util.function.Supplier; import org.eclipse.jface.resource.ImageDescriptor; import org.simantics.browsing.ui.BuiltinKeys; @@ -31,8 +33,6 @@ import org.simantics.db.exception.DatabaseException; import org.simantics.modeling.ui.modelBrowser.model.IChildrenCallback; import org.simantics.modeling.ui.modelBrowser.model.IDisposable; import org.simantics.modeling.ui.modelBrowser.model.IUpdateable; -import org.simantics.utils.datastructures.Callable; -import org.simantics.utils.datastructures.Callback; public class INodeEvaluators { @@ -49,7 +49,7 @@ public class INodeEvaluators { } abstract class BaseViewpointFactory implements ViewpointFactory { - protected abstract class VPB extends LazyViewpoint implements Callable, IChildrenCallback { + protected abstract class VPB extends LazyViewpoint implements Supplier, IChildrenCallback { PrimitiveQueryUpdater updater; public VPB(PrimitiveQueryUpdater updater, NodeContext context, ViewpointKey key) { @@ -71,9 +71,9 @@ abstract class BaseViewpointFactory implements ViewpointFactory { // BaseViewpointFactory unique. return BaseViewpointFactory.this.getClass(); } - + @Override - public Boolean call() { + public Boolean get() { return Boolean.valueOf(updater.isDisposed()); } @@ -158,10 +158,11 @@ class NodeImagerFactory implements ImagerFactory { DataSource source = updater.getDataSource(ReadGraph.class); - source.schedule(new Callback() { - @Override - public void run(ReadGraph g) { - try { + source.schedule(new Consumer() { + + @Override + public void accept(ReadGraph g) { + try { INode node = (INode)context.getConstant(BuiltinKeys.INPUT); ImageDescriptor descriptor = node.getImage(g); result.setImage(descriptor); -- 2.47.1