public Anchor.Result compute (Anchor.Entry entry) { return anchors[index].compute (entry); }
public Anchor.Result compute (Anchor.Entry entry) { return anchors[index].compute (entry); }
public List<Point> routeConnection (ConnectionWidget widget) { ArrayList<Point> list = new ArrayList<Point> (); Anchor sourceAnchor = widget.getSourceAnchor (); Anchor targetAnchor = widget.getTargetAnchor (); if (sourceAnchor != null && targetAnchor != null) { list.add (sourceAnchor.compute(widget.getSourceAnchorEntry ()).getAnchorSceneLocation()); list.add (targetAnchor.compute(widget.getTargetAnchorEntry ()).getAnchorSceneLocation()); } return list; }
public List<Point> locationSuggested(ConnectionWidget connectionWidget, int index, Point suggestedLocation) { List<Point> controlPoints = connectionWidget.getControlPoints(); int cpSize=controlPoints.size()-1; ArrayList<Point> list = new ArrayList<Point> (controlPoints); if (index <= 0 || index >= cpSize)return null; if(index==1)list.set(0,connectionWidget.getSourceAnchor().compute(connectionWidget.getSourceAnchorEntry()).getAnchorSceneLocation()); if(index==cpSize - 1) list.set(cpSize,connectionWidget.getTargetAnchor().compute(connectionWidget.getTargetAnchorEntry()).getAnchorSceneLocation()); list.set(index, suggestedLocation); return list; }
public List<Point> locationSuggested(ConnectionWidget connectionWidget, int index, Point suggestedLocation) { List<Point> controlPoints = connectionWidget.getControlPoints(); int cpSize=controlPoints.size()-1; ArrayList<Point> list = new ArrayList<Point> (controlPoints); if (index <= 0 || index >= cpSize)return null; if(index==1)list.set(0,connectionWidget.getSourceAnchor().compute(connectionWidget.getSourceAnchorEntry()).getAnchorSceneLocation()); if(index==cpSize - 1) list.set(cpSize,connectionWidget.getTargetAnchor().compute(connectionWidget.getTargetAnchorEntry()).getAnchorSceneLocation()); list.set(index, suggestedLocation); return list; }
public List<Point> routeConnection (ConnectionWidget widget) { ArrayList<Point> list = new ArrayList<Point> (); Anchor sourceAnchor = widget.getSourceAnchor (); Anchor targetAnchor = widget.getTargetAnchor (); if (sourceAnchor != null && targetAnchor != null) { list.add (sourceAnchor.compute(widget.getSourceAnchorEntry ()).getAnchorSceneLocation()); list.add (targetAnchor.compute(widget.getTargetAnchorEntry ()).getAnchorSceneLocation()); } return list; }
public List<Point> routeConnection(ConnectionWidget widget) { ArrayList<Point> list = new ArrayList<Point> (); Anchor sourceAnchor = widget.getSourceAnchor(); Anchor targetAnchor = widget.getTargetAnchor(); if (sourceAnchor == null || targetAnchor == null) return Collections.emptyList(); list.add(sourceAnchor.compute(widget.getSourceAnchorEntry()).getAnchorSceneLocation()); List<Point> oldControlPoints = widget.getControlPoints (); if(oldControlPoints !=null) { ArrayList<Point> oldList = new ArrayList<Point> (oldControlPoints); oldList.remove(widget.getFirstControlPoint()); oldList.remove(widget.getLastControlPoint()); list.addAll(oldList); } list.add(targetAnchor.compute(widget.getTargetAnchorEntry()).getAnchorSceneLocation()); return list; }
public List<Point> routeConnection(ConnectionWidget widget) { ArrayList<Point> list = new ArrayList<Point> (); Anchor sourceAnchor = widget.getSourceAnchor(); Anchor targetAnchor = widget.getTargetAnchor(); if (sourceAnchor == null || targetAnchor == null) return Collections.emptyList(); list.add(sourceAnchor.compute(widget.getSourceAnchorEntry()).getAnchorSceneLocation()); List<Point> oldControlPoints = widget.getControlPoints (); if(oldControlPoints !=null) { ArrayList<Point> oldList = new ArrayList<Point> (oldControlPoints); oldList.remove(widget.getFirstControlPoint()); oldList.remove(widget.getLastControlPoint()); list.addAll(oldList); } list.add(targetAnchor.compute(widget.getTargetAnchorEntry()).getAnchorSceneLocation()); return list; }
break; case UPDATE_END_POINTS_ONLY: { Point sourcePoint = sourceAnchor != null ? sourceAnchor.compute (sourceEntry).getAnchorSceneLocation () : null; Point targetPoint = targetAnchor != null ? targetAnchor.compute (targetEntry).getAnchorSceneLocation () : null; if (sourcePoint == null || targetPoint == null) { controlPoints.clear (); } break; case DISABLE_ROUTING_UNTIL_END_POINT_IS_MOVED: { Point sourcePoint = sourceAnchor != null ? sourceAnchor.compute (sourceEntry).getAnchorSceneLocation () : null; Point firstPoint = getFirstControlPoint (); if (firstPoint != null) firstPoint = convertLocalToScene (firstPoint); if (sourcePoint == null ? firstPoint == null : sourcePoint.equals (firstPoint)) { Point targetPoint = targetAnchor != null ? targetAnchor.compute (targetEntry).getAnchorSceneLocation () : null; Point lastPoint = getLastControlPoint (); if (lastPoint != null)
break; case UPDATE_END_POINTS_ONLY: { Point sourcePoint = sourceAnchor != null ? sourceAnchor.compute (sourceEntry).getAnchorSceneLocation () : null; Point targetPoint = targetAnchor != null ? targetAnchor.compute (targetEntry).getAnchorSceneLocation () : null; if (sourcePoint == null || targetPoint == null) { controlPoints.clear (); } break; case DISABLE_ROUTING_UNTIL_END_POINT_IS_MOVED: { Point sourcePoint = sourceAnchor != null ? sourceAnchor.compute (sourceEntry).getAnchorSceneLocation () : null; Point firstPoint = getFirstControlPoint (); if (firstPoint != null) firstPoint = convertLocalToScene (firstPoint); if (sourcePoint == null ? firstPoint == null : sourcePoint.equals (firstPoint)) { Point targetPoint = targetAnchor != null ? targetAnchor.compute (targetEntry).getAnchorSceneLocation () : null; Point lastPoint = getLastControlPoint (); if (lastPoint != null)
EnumSet<Anchor.Direction> directions = sourceAnchor.compute(sourceAnchorEntry).getDirections(); if (directions.contains(Anchor.Direction.TOP)) { label.setOrientation(LabelWidget.Orientation.ROTATE_90);
Result sourceResult = sourceAnchor.compute(widget.getSourceAnchorEntry()); sourceDirections = sourceResult.getDirections(); sourcePoint = sourceResult.getAnchorSceneLocation(); Result targetResult = targetAnchor.compute(widget.getTargetAnchorEntry()); targetDirections = targetResult.getDirections(); targetPoint = targetResult.getAnchorSceneLocation(); bestPoints = sourceAnchor.compute(bestListOfPoints); bestPoints = targetAnchor.compute(bestPoints);
Result sourceResult = sourceAnchor.compute(widget.getSourceAnchorEntry()); sourceDirections = sourceResult.getDirections(); sourcePoint = sourceResult.getAnchorSceneLocation(); Result targetResult = targetAnchor.compute(widget.getTargetAnchorEntry()); targetDirections = targetResult.getDirections(); targetPoint = targetResult.getAnchorSceneLocation(); bestPoints = sourceAnchor.compute(bestListOfPoints); bestPoints = targetAnchor.compute(bestPoints);