2 package org.simantics.district.network.ui;
\r
4 import org.simantics.district.network.ui.nodes.NetworkDrawingNode;
\r
5 import org.simantics.g2d.canvas.impl.SGNodeReflection.SGInit;
\r
6 import org.simantics.g2d.diagram.IDiagram;
\r
7 import org.simantics.g2d.diagram.participant.AbstractDiagramParticipant;
\r
8 import org.simantics.scenegraph.g2d.G2DParentNode;
\r
9 import org.simantics.utils.datastructures.hints.IHintContext.Key;
\r
10 import org.simantics.utils.datastructures.hints.IHintContext.KeyOf;
\r
12 public class NetworkDrawingParticipant extends AbstractDiagramParticipant {
\r
15 * A hint key for terminal pick distance in control pixels.
\r
18 public static final Key KEY_PICK_DISTANCE = new KeyOf(Double.class, "PICK_DISTANCE");
\r
21 * Default terminal pick distance in control pixels.
\r
22 * @see #DEFAULT_PICK_DISTANCE
\r
24 public static final double PICK_DIST = 10;
\r
26 private NetworkDrawingNode node;
\r
29 public void initSG(G2DParentNode parent) {
\r
30 node = parent.addNode("networkDrawingNode", NetworkDrawingNode.class);
\r
31 node.setNetworkDrawingParticipant(this);
\r
35 protected void onDiagramSet(IDiagram newDiagram, IDiagram oldDiagram) {
\r
36 node.setDiagram(newDiagram);
\r