/** * Sets the points of the specified edge * * @param edge * the edge whose points are to be set * @param points * the new list of points for the edge */ public void setPoints(Object edge, List points) { Map map = getAttributes(edge); GraphConstants.setPoints(map, points); }
public void initialiseDefaultPoints(){ List controlPoints = GraphConstants.getPoints(allAttributes); if (controlPoints == null) { controlPoints = new ArrayList(4); controlPoints.add(allAttributes.createPoint(10, 10)); controlPoints.add(allAttributes.createPoint(20, 20)); GraphConstants.setPoints(allAttributes, controlPoints); } points=controlPoints; }
/** * Resets the control points of all moveable edges in the graph. * Also set the routing on the edges to the specified value * if the parameter flag indicates to do so */ public void resetControlPoints(boolean setRouting, Edge.Routing routing) { Iterator it = getEdges().iterator(); while (it.hasNext()) { Object edge = it.next(); if (isMoveable(edge)) { Map map = getAttributes(edge); // Resets the control points by removing all but // the first and the last point from the points // list. List pts = GraphConstants.getPoints(map); if (pts != null && pts.size() > 2) { List newPoints = new ArrayList(); newPoints.add(pts.get(0)); newPoints.add(pts.get(pts.size() - 1)); GraphConstants.setPoints(map, newPoints); } if (setRouting) { GraphConstants.setRouting(map, routing); } } } }
GraphConstants.setPoints(attrMap, result);
GraphConstants.setPoints(attrMap, result);
GraphConstants.setPoints(attributes, nodeChain); CellView view = mapper.getMapping(edge, false); if (view != null)
controlPoints.add(allAttributes.createPoint(10, 10)); controlPoints.add(allAttributes.createPoint(20, 20)); GraphConstants.setPoints(allAttributes, controlPoints);
/** * Clones special object entried in the given map. */ public AttributeMap cloneEntries(AttributeMap newMap) { // Clone Bounds Rectangle2D bounds = GraphConstants.getBounds(newMap); if (bounds != null) GraphConstants.setBounds(newMap, (Rectangle2D) (bounds.clone())); // Clone List Of Points List points = GraphConstants.getPoints(newMap); if (points != null) GraphConstants.setPoints(newMap, clonePoints(points)); // Clone extra label positions Point2D[] positions = GraphConstants.getExtraLabelPositions(newMap); if (positions != null) GraphConstants.setExtraLabelPositions(newMap, clonePoints(positions)); // Clone Edge Label Point2D label = GraphConstants.getLabelPosition(newMap); if (label != null) GraphConstants.setLabelPosition(newMap, (Point2D) label.clone()); return newMap; }