public void SetParent (CGNode n, CGArrow a) { parent = n; arrow = a; if (arrow != null) { Rectangle pos = Bbox(); arrow.MoveHeadTo (pos.x, pos.y + pos.height/2); } }
private void Drag (MouseEvent ev) { switch (state) { case stateDrag: curnode.Move (ev.getX() - dragx, ev.getY() - dragy); dragx = ev.getX(); dragy = ev.getY(); break; case stateCreate: curarrow.MoveHeadTo (ev.getX(), ev.getY()); break; } }