public GLink( GElement source, String sourceAnchorKey, GElement target, String targetAnchorKey, int shape, String pattern, Point mouse, double flateness) { this.source = source; this.target = target; this.sourceAnchorKey = sourceAnchorKey; this.targetAnchorKey = targetAnchorKey; this.shape = shape; this.pattern = pattern; initializeLink(flateness); setSourceTangentOffset(source.getDefaultAnchorOffset(sourceAnchorKey)); setTargetTangentOffset(target.getDefaultAnchorOffset(targetAnchorKey)); link.setDirection(Vector2D.vector(mouse).sub(target.getPosition())); }
public void setMousePosition(Point mouse) { link.setDirection(Vector2D.vector(mouse).sub(target.getPosition())); link.setMousePosition(Vector2D.vector(mouse)); }