@Override protected void refreshVisuals() { Link lnk = (Link) getModel(); String dis = ""; if (lnk.getSource() instanceof TriggerInstanceTerminalNode || lnk.getTarget() instanceof TriggerInstanceTerminalNode) dis = "Period : " + lnk.getPeriod(); LabeledConnection connection = (LabeledConnection) getConnectionFigure(); connection.setDisplay(dis); connection.redraw(); List<Point> modelConstraint = ((Link) getModel()).getbPoints(); List<AbsoluteBendpoint> figureConstraint = new ArrayList<AbsoluteBendpoint>(); for (Point p : modelConstraint) { figureConstraint.add(new AbsoluteBendpoint(p)); } connection.setRoutingConstraint(figureConstraint); }
@Override protected void refreshVisuals() { EdgeFigure figure = (EdgeFigure) getFigure(); GWEdge model = (GWEdge) getModel(); figure.setName(model.getName()); Connection connection = getConnectionFigure(); List<AbsoluteBendpoint> figureConstraint = new ArrayList<AbsoluteBendpoint>(); Iterator<Point> iter = ((GWLink) getModel()).getBendpointsIterator(); while(iter.hasNext()) { Point p = iter.next(); figureConstraint.add(new AbsoluteBendpoint(p)); } connection.setRoutingConstraint(figureConstraint); figure.setTooltipText(this.getTooltipData()); figure.setBlockedOrGuarded(model.isBlocked(),model.getGuard().getSource()); figure.setActionScripted(model.getAction().getSource()); }
/** * Shows feedback when a bendpoint is being created. The original figure is used for * feedback and the original constraint is saved, so that it can be restored when feedback * is erased. * @param request the BendpointRequest */ protected void showCreateBendpointFeedback(BendpointRequest request) { Point p = new Point(request.getLocation()); List constraint; getConnection().translateToRelative(p); Bendpoint bp = new AbsoluteBendpoint(p); if (originalConstraint == null) { saveOriginalConstraint(); constraint = (List)getConnection().getRoutingConstraint(); constraint.add(request.getIndex(), bp); } else { constraint = (List)getConnection().getRoutingConstraint(); } constraint.set(request.getIndex(), bp); getConnection().setRoutingConstraint(constraint); }
/** * Shows feedback when a bendpoint is being moved. Also checks to see if the bendpoint * should be deleted and then calls {@link #showDeleteBendpointFeedback(BendpointRequest)} * if needed. The original figure is used for feedback and the original constraint is * saved, so that it can be restored when feedback is erased. * @param request the BendpointRequest */ protected void showMoveBendpointFeedback(BendpointRequest request) { Point p = new Point(request.getLocation()); if (!isDeleting) setReferencePoints(request); if (lineContainsPoint(ref1, ref2, p)) { if (!isDeleting) { isDeleting = true; eraseSourceFeedback(request); showDeleteBendpointFeedback(request); } return; } if (isDeleting) { isDeleting = false; eraseSourceFeedback(request); } if (originalConstraint == null) saveOriginalConstraint(); List constraint = (List)getConnection().getRoutingConstraint(); getConnection().translateToRelative(p); Bendpoint bp = new AbsoluteBendpoint(p); constraint.set(request.getIndex(), bp); getConnection().setRoutingConstraint(constraint); }
/** * Shows feedback when a bendpoint is being created. The original figure is * used for feedback and the original constraint is saved, so that it can be * restored when feedback is erased. * * @param request * the BendpointRequest */ protected void showCreateBendpointFeedback(BendpointRequest request) { Point p = new Point(request.getLocation()); List constraint; getConnection().translateToRelative(p); Bendpoint bp = new AbsoluteBendpoint(p); if (originalConstraint == null) { saveOriginalConstraint(); constraint = (List) getConnection().getRoutingConstraint(); constraint.add(request.getIndex(), bp); } else { constraint = (List) getConnection().getRoutingConstraint(); } constraint.set(request.getIndex(), bp); getConnection().setRoutingConstraint(constraint); }
/** * Shows feedback when a bendpoint is being moved. Also checks to see if the * bendpoint should be deleted and then calls * {@link #showDeleteBendpointFeedback(BendpointRequest)} if needed. The * original figure is used for feedback and the original constraint is * saved, so that it can be restored when feedback is erased. * * @param request * the BendpointRequest */ protected void showMoveBendpointFeedback(BendpointRequest request) { Point p = new Point(request.getLocation()); if (!isDeleting) setReferencePoints(request); if (lineContainsPoint(ref1, ref2, p)) { if (!isDeleting) { isDeleting = true; eraseSourceFeedback(request); showDeleteBendpointFeedback(request); } return; } if (isDeleting) { isDeleting = false; eraseSourceFeedback(request); } if (originalConstraint == null) saveOriginalConstraint(); List constraint = (List) getConnection().getRoutingConstraint(); getConnection().translateToRelative(p); Bendpoint bp = new AbsoluteBendpoint(p); constraint.set(request.getIndex(), bp); getConnection().setRoutingConstraint(constraint); }
@Override protected void refreshVisuals() { Connection connection = getConnectionFigure(); List<Point> modelConstraint = ((Link) getModel()).getbPoints(); List<AbsoluteBendpoint> figureConstraint = new ArrayList<AbsoluteBendpoint>(); for (Point p : modelConstraint) { figureConstraint.add(new AbsoluteBendpoint(p)); } connection.setRoutingConstraint(figureConstraint); }
@Override protected void refreshVisuals() { List<Point> modelConstraint = ((Link) getModel()).getbPoints(); LabeledConnection connection = (LabeledConnection) getConnectionFigure(); connection.setDisplay("rank : " + ((Link) getModel()).getRank()); connection.redraw(); List<AbsoluteBendpoint> figureConstraint = new ArrayList<AbsoluteBendpoint>(); for (Point p : modelConstraint) { figureConstraint.add(new AbsoluteBendpoint(p)); } connection.setRoutingConstraint(figureConstraint); }
protected List<org.eclipse.draw2d.Bendpoint> getRealBendpoint( Bendpoint bendPoint) { List<org.eclipse.draw2d.Bendpoint> constraint = new ArrayList<org.eclipse.draw2d.Bendpoint>(); constraint .add(new AbsoluteBendpoint(bendPoint.getX(), bendPoint.getY())); return constraint; }
protected void applyResults(RelationshipPart relationshipPart) { Edge e = (Edge) partToNodesMap.get(relationshipPart); if (e == null) return; NodeList nodes = e.vNodes; PolylineConnection conn = (PolylineConnection) relationshipPart .getConnectionFigure(); if (nodes != null) { List<AbsoluteBendpoint> bends = new ArrayList<AbsoluteBendpoint>(); for (int i = 0; i < nodes.size(); i++) { Node vn = nodes.getNode(i); int x = vn.x; int y = vn.y; if (e.isFeedback()) { bends.add(new AbsoluteBendpoint(x, y + vn.height)); bends.add(new AbsoluteBendpoint(x, y)); } else { bends.add(new AbsoluteBendpoint(x, y)); bends.add(new AbsoluteBendpoint(x, y + vn.height)); } } conn.setRoutingConstraint(bends); } else { conn.setRoutingConstraint(Collections.EMPTY_LIST); } }
@Override protected void refreshBendpoints() { // ベンド・ポイントの位置情報の取得 final WalkerConnection connection = (WalkerConnection) getModel(); // 実際のベンド・ポイントのリスト final List<org.eclipse.draw2d.Bendpoint> constraint = new ArrayList<>(); for (final Bendpoint bendPoint : connection.getBendpoints()) { constraint.add(new AbsoluteBendpoint(bendPoint.getX(), bendPoint.getY())); } getConnectionFigure().setRoutingConstraint(constraint); }
protected void refreshBendpoints() { List<Point> bendpoints = getTransition().getBendpoints(); List<Point> constraint = new ArrayList<Point>(); for (int i = 0; i < bendpoints.size(); i++) { constraint.add(new AbsoluteBendpoint((Point) bendpoints.get(i))); } getConnectionFigure().setRoutingConstraint(constraint); }
/** * Updates the bendpoints, based on the model. */ protected void refreshBendpoints() { EList modelConstraint = getLinkRef().getBendpoints(); List figureConstraint = new ArrayList(); for (int i = 0; i < modelConstraint.size(); i++) { LinkRefBendpoint bendpoint = (LinkRefBendpoint) modelConstraint.get(i); AbsoluteBendpoint abp = new AbsoluteBendpoint(bendpoint.getX(), bendpoint.getY()); figureConstraint.add(abp); } getConnectionFigure().setRoutingConstraint(figureConstraint); }
@Override protected void refreshVisuals() { List<AbsoluteBendpoint> points=new ArrayList<AbsoluteBendpoint>(); List<Point> bendpoints=((Transition)this.getModel()).getBendpoints(); for(Point p:bendpoints){ points.add(new AbsoluteBendpoint(p)); } getConnectionFigure().setRoutingConstraint(points); }
protected List<org.eclipse.draw2d.Bendpoint> getRealBendpoint(final Bendpoint bendPoint) { final List<org.eclipse.draw2d.Bendpoint> constraint = new ArrayList<org.eclipse.draw2d.Bendpoint>(); constraint.add(new AbsoluteBendpoint(bendPoint.getX(), bendPoint.getY())); return constraint; }