public RemoteLinkage(IFigure ownerFigure, FrameElement ownerElement, GraphicalWidget<?> labelFigure) { super(); ownerFig = ownerFigure; owner = ownerElement; remoteLabelFig = labelFigure; setSourceAnchor(new EllipseAnchor(ownerFig)); setTargetAnchor(new ChopboxAnchor(remoteLabelFig)); setLineWidth(3); setLineStyle(SWT.LINE_DOT); setCursor(WindowUtil.getCursor(WindowUtil.RESIZE_ALL_CURSOR)); }
public void rotate(double angle) { // make it always point towards bottom if (Math.cos(angle)>0) angle -= Math.PI; Transform t = new Transform(); t.setRotation(angle); Point center = new Point(getPreferredSize().width / 2, getPreferredSize().height / 2); for (int j = 0; j < lines.size(); j++) { PointList points = (PointList) lines.get(j); Polyline line = (Polyline) rects.get(j); PointList newPoints = new PointList(); for (int i = 0; i < points.size(); i++) { Point newPoint = t.getTransformed(new Point(points.getPoint(i).x - center.x, points.getPoint(i).y - center.y)); //Point pt = new Point(newPoint.x - center.x, newPoint.y - center.y); newPoints.addPoint(newPoint); } newPoints.translate(center.x, center.y); line.setPoints(newPoints); } ((EllipseAnchor)outgoingAnchor).ancestorMoved(this); }
@Override protected ConnectionAnchor createDefaultAnchor() { return new EllipseAnchor((IFigure) getChildren().get(0)); }
public ConnectionAnchor getSourceConnectionAnchor() { return new EllipseAnchor(this); }
public ConnectionAnchor getTargetConnectionAnchor() { return new EllipseAnchor(this); }
/** * @see seg.jUCMNav.figures.PathNodeFigure#initAnchor() */ protected void initAnchor() { incomingAnchor = new EllipseAnchor(ellipse); outgoingAnchor = new EllipseAnchor(ellipse); }
@Override protected void initAnchor() { incomingAnchor = new EllipseAnchor(rect1); outgoingAnchor = new EllipseAnchor(rect1); }
/** * * @see seg.jUCMNav.figures.PathNodeFigure#initAnchor() */ protected void initAnchor() { incomingAnchor = new EllipseAnchor(this); outgoingAnchor = new EllipseAnchor(this); }
@Override protected void initAnchor() { incomingAnchor = new EllipseAnchor(layer); outgoingAnchor = new EllipseAnchor(layer); }