package org.simantics.sysdyn.ui.elements;\r
\r
import java.awt.geom.AffineTransform;\r
+import java.util.function.Consumer;\r
+\r
import org.simantics.g2d.element.ElementUtils;\r
import org.simantics.g2d.element.IElement;\r
import org.simantics.g2d.element.SceneGraphNodeKey;\r
import org.simantics.g2d.element.handler.SceneGraph;\r
import org.simantics.scenegraph.g2d.G2DParentNode;\r
-import org.simantics.utils.datastructures.Callback;\r
import org.simantics.utils.datastructures.hints.IHintContext.Key;\r
\r
-public class BorderSceneGraph implements SceneGraph, Callback<RectangleNode> {\r
+public class BorderSceneGraph implements SceneGraph, Consumer<RectangleNode> {\r
\r
public static final BorderSceneGraph INSTANCE = new BorderSceneGraph();\r
\r
}\r
\r
@Override\r
- public void run(RectangleNode node) {\r
+ public void accept(RectangleNode node) {\r
node.setZIndex(-10);\r
}\r
\r
import java.awt.geom.Point2D;\r
import java.awt.geom.RectangularShape;\r
import java.util.Collection;\r
+import java.util.function.Consumer;\r
\r
import org.simantics.databoard.Bindings;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.sysdyn.ui.properties.LoopTab;\r
import org.simantics.sysdyn.utils.LoopUtils;\r
import org.simantics.ui.SimanticsUI;\r
-import org.simantics.utils.datastructures.Callback;\r
import org.simantics.utils.datastructures.hints.IHintContext.Key;\r
import org.simantics.utils.datastructures.hints.IHintListener;\r
import org.simantics.utils.datastructures.hints.IHintObservable;\r
}\r
\r
@Override\r
- protected <T extends SysdynTextNode> Callback<T> getCallback(final IElement e, G2DParentNode parent, Class<T> nodeClass) {\r
- return new Callback<T>() {\r
+ protected <T extends SysdynTextNode> Consumer<T> getCallback(final IElement e, G2DParentNode parent, Class<T> nodeClass) {\r
+ return new Consumer<T>() {\r
@Override\r
- public void run(T node) {\r
+ public void accept(T node) {\r
node.setTextListener(new ITextListener() {\r
\r
Resource component;\r
\r
import java.awt.Color;\r
import java.awt.geom.AffineTransform;\r
+import java.util.function.Consumer;\r
\r
import org.eclipse.swt.widgets.Control;\r
import org.eclipse.ui.IWorkbenchPage;\r
import org.simantics.sysdyn.ui.utils.SysdynWorkbenchUtils;\r
import org.simantics.sysdyn.ui.utils.VariableNameValidator;\r
import org.simantics.ui.SimanticsUI;\r
-import org.simantics.utils.datastructures.Callback;\r
import org.simantics.utils.datastructures.hints.IHintContext.Key;\r
import org.simantics.utils.datastructures.hints.IHintContext.KeyOf;\r
\r
\r
// End constructors\r
\r
- protected <T extends SysdynTextNode> Callback<T> getCallback(final IElement e, G2DParentNode parent, Class<T> nodeClass) {\r
- return new Callback<T>() {\r
+ protected <T extends SysdynTextNode> Consumer<T> getCallback(final IElement e, G2DParentNode parent, Class<T> nodeClass) {\r
+ return new Consumer<T>() {\r
@Override\r
- public void run(T node) {\r
+ public void accept(T node) {\r
node.setTextListener(new ITextListener() {\r
\r
String textBeforeEdit;\r