import org.simantics.g2d.canvas.impl.SGNodeReflection.SGCleanup;
import org.simantics.g2d.canvas.impl.SGNodeReflection.SGInit;
import org.simantics.g2d.diagram.DiagramHints;
import org.simantics.g2d.canvas.impl.SGNodeReflection.SGCleanup;
import org.simantics.g2d.canvas.impl.SGNodeReflection.SGInit;
import org.simantics.g2d.diagram.DiagramHints;
import org.simantics.g2d.participant.TransformUtil;
import org.simantics.scenegraph.g2d.G2DParentNode;
import org.simantics.scenegraph.g2d.IG2DNode;
import org.simantics.g2d.participant.TransformUtil;
import org.simantics.scenegraph.g2d.G2DParentNode;
import org.simantics.scenegraph.g2d.IG2DNode;
import org.simantics.scenegraph.g2d.snap.ISnapAdvisor;
import org.simantics.utils.datastructures.context.IContext;
import org.simantics.utils.datastructures.context.IContextListener;
import org.simantics.scenegraph.g2d.snap.ISnapAdvisor;
import org.simantics.utils.datastructures.context.IContext;
import org.simantics.utils.datastructures.context.IContextListener;
// Priority of drag event, eats ecs key
public final static int DRAG_EVENT_PRIORITY = Integer.MAX_VALUE - 1500;
public final static int DRAG_PAINT_PRIORITY = Integer.MAX_VALUE - 1100;
// Priority of drag event, eats ecs key
public final static int DRAG_EVENT_PRIORITY = Integer.MAX_VALUE - 1500;
public final static int DRAG_PAINT_PRIORITY = Integer.MAX_VALUE - 1100;
Point2D pos = dropCtx.getItemPosition(item);
if(pos != null) { // Position can (or at least seems to be) be null on the first frame
AffineTransform subt = AffineTransform.getTranslateInstance(pos.getX(), pos.getY());
Point2D pos = dropCtx.getItemPosition(item);
if(pos != null) { // Position can (or at least seems to be) be null on the first frame
AffineTransform subt = AffineTransform.getTranslateInstance(pos.getX(), pos.getY());
IG2DNode itemHolder = node.getNode(""+item.hashCode());
if (itemHolder != null && !(itemHolder instanceof SingleElementNode)) {
IG2DNode itemHolder = node.getNode(""+item.hashCode());
if (itemHolder != null && !(itemHolder instanceof SingleElementNode)) {