@Test public void controlPointCreation() { Structure s = new DirectedGraph(); Vertex first = s.createVertex(); Vertex secnd = s.createVertex(); ControlPoint ctrl1, ctrl2, ctrl3; first.setCoordinates(0, 0); secnd.setCoordinates(1, 0); s.addVertex(first); s.addVertex(secnd); Edge e = s.addEdge(first, secnd, 0, null); e.edgeType = Edge.EdgeType.SHARP; ctrl1 = e.addControlPoint(new Vector2D(0, 1), new Vector2D(0.5, 0)); ctrl2 = e.addControlPoint(new Vector2D(1, 1), new Vector2D(0.5, 0.5)); ctrl3 = e.addControlPoint(new Vector2D(2, 0), new Vector2D(1, 0.5)); assertEquals(2, e.controlPoints.indexOf(ctrl3)); ctrl3 = e.addControlPoint(new Vector2D(0, 2), new Vector2D(0.5, 1)); assertEquals(1, e.controlPoints.indexOf(ctrl3)); assertEquals(2, e.controlPoints.indexOf(ctrl2)); }
public ControlPoint addControlPoint(Vector2D position, Vector2D clickPosition) { if (edgeType == EdgeType.BEZIER) { return addBezierControlPoint(position); } else { return addSharpControlPoint(position, clickPosition); } }
Edge extends XmlMarshallable implements IMovable, Serializable { public ControlPoint addControlPoint(Vector2D position, Vector2D clickPosition) { if (edgeType == EdgeType.BEZIER) { return addBezierControlPoint(position); } else { return addSharpControlPoint(position, clickPosition); } } }
Edge extends XmlMarshallable implements IMovable, Serializable { public ControlPoint addControlPoint(Vector2D position, Vector2D clickPosition) { if (edgeType == EdgeType.BEZIER) { return addBezierControlPoint(position); } else { return addSharpControlPoint(position, clickPosition); } } Edge();  Edge(Configuration config); }
Edge extends XmlMarshallable implements IMovable, Serializable { public ControlPoint addControlPoint(Vector2D position, Vector2D clickPosition) { if (edgeType == EdgeType.BEZIER) { return addBezierControlPoint(position); } else { return addSharpControlPoint(position, clickPosition); } } Edge();  Edge(Configuration config); static boolean isEdgeType(String type); void setEdgeType(EdgeType e); void setEdgeType(String e); EdgeType getEdgeType(); int getControlPointCount(); ControlPoint addControlPoint(Vector2D position, Vector2D clickPosition); int getId(); void setId(int id); ControlPoint removeControlPoint(ControlPoint c); Vertex getSource(); void setSource(Vertex source); boolean isDirected(); void setDirectedness(boolean directedness); Vertex getTarget(); void setTarget(Vertex target); boolean isLoop(); boolean isSiblingTo(Edge other); double maximumCoordinate(int dimension); @Override void move(Vector2D offset); void collapse(Structure structure); void snapToGrid(double gridSize); IMovable findObject(double x, double y); void render(GralogGraphicsContext gc, Highlights highlights); double getOffset(); boolean sameOrientationAs(Edge other); boolean containsCoordinate(double x, double y); Vector2D getStartingPointSource(); Vector2D getStartingPointTarget(); boolean containsVertex(Vertex v); double length(); Element toXml(Document doc, HashMap<Vertex, String> ids); void setLabel(String label); void fromXml(Element enode, HashMap<String, Vertex> ids); void addEdgeListener(EdgeListener listener); void removeEdgeListener(EdgeListener listener); @Override String toString(); String gralogPipify(); }
Edge extends XmlMarshallable implements IMovable, Serializable { public ControlPoint addControlPoint(Vector2D position, Vector2D clickPosition) { if (edgeType == EdgeType.BEZIER) { return addBezierControlPoint(position); } else { return addSharpControlPoint(position, clickPosition); } } Edge();  Edge(Configuration config); static boolean isEdgeType(String type); void setEdgeType(EdgeType e); void setEdgeType(String e); EdgeType getEdgeType(); int getControlPointCount(); ControlPoint addControlPoint(Vector2D position, Vector2D clickPosition); int getId(); void setId(int id); ControlPoint removeControlPoint(ControlPoint c); Vertex getSource(); void setSource(Vertex source); boolean isDirected(); void setDirectedness(boolean directedness); Vertex getTarget(); void setTarget(Vertex target); boolean isLoop(); boolean isSiblingTo(Edge other); double maximumCoordinate(int dimension); @Override void move(Vector2D offset); void collapse(Structure structure); void snapToGrid(double gridSize); IMovable findObject(double x, double y); void render(GralogGraphicsContext gc, Highlights highlights); double getOffset(); boolean sameOrientationAs(Edge other); boolean containsCoordinate(double x, double y); Vector2D getStartingPointSource(); Vector2D getStartingPointTarget(); boolean containsVertex(Vertex v); double length(); Element toXml(Document doc, HashMap<Vertex, String> ids); void setLabel(String label); void fromXml(Element enode, HashMap<String, Vertex> ids); void addEdgeListener(EdgeListener listener); void removeEdgeListener(EdgeListener listener); @Override String toString(); String gralogPipify(); static double edgeSelectionOffset; static double multiEdgeOffset; @DataField(display = true)
    public String label; @DataField(display = true)
    public Double weight; @DataField(display = true)
    public Boolean isDirected; public Arrow arrowType; public Double endPointDistance; public Double startPointDistance; public double arrowHeadLength; public double arrowHeadAngle; @DataField(display = true)
    public Double thickness; @DataField(display = true)
    public GralogColor color; @DataField(display = true)
    public GralogGraphicsContext.LineType type; @DataField(display = true)
    public EdgeType edgeType; public ArrayList<Edge> siblings; public ArrayList<EdgeIntermediatePoint> intermediatePoints; public ArrayList<ControlPoint> controlPoints; }