/** * Get the shape for this edge, returning either the shared instance or, in the case of * self-loop edges, the Loop shared instance. */ public Shape apply(Context<Network<N, E>, E> context) { Network graph = context.graph; E e = context.element; if (isLoop(graph, e)) { return loop.apply(context); } int index = getIndex(context, edgeIndexFunction); float controlY = control_offset_increment + control_offset_increment * index; BENT_LINE.reset(); BENT_LINE.moveTo(0.0f, 0.0f); BENT_LINE.lineTo(0.5f, controlY); BENT_LINE.lineTo(1.0f, 1.0f); return BENT_LINE; } }
boolean isLoop = endpoints.getFirst().equals(endpoints.getSecond()); if (isLoop) { return loop.transform(context);
/** * Get the shape for this edge, returning either the shared instance or, in the case of * self-loop edges, the Loop shared instance. */ public Shape apply(Context<Network<N, E>, E> context) { Network graph = context.graph; E e = context.element; if (isLoop(graph, e)) { return loop.apply(context); } int index = getIndex(context, edgeIndexFunction); float controlY = control_offset_increment + control_offset_increment * index; CUBIC_CURVE.setCurve(0.0f, 0.0f, 0.33f, 2 * controlY, .66f, -controlY, 1.0f, 0.0f); return CUBIC_CURVE; } }
/** * Get the shape for this edge, returning either the shared instance or, in the case of * self-loop edges, the Loop shared instance. */ public Shape apply(Context<Network<N, E>, E> context) { Network graph = context.graph; E e = context.element; if (isLoop(graph, e)) { return loop.apply(context); } int index = getIndex(context, edgeIndexFunction); float controlY = control_offset_increment + control_offset_increment * index; QUAD_CURVE.setCurve(0.0f, 0.0f, 0.5f, controlY, 1.0f, 0.0f); return QUAD_CURVE; } }
public void setEdgeIndexFunction(EdgeIndexFunction<N, E> edgeIndexFunction) { this.edgeIndexFunction = edgeIndexFunction; loop.setEdgeIndexFunction(edgeIndexFunction); }
public void setEdgeIndexFunction(EdgeIndexFunction<N, E> edgeIndexFunction) { this.edgeIndexFunction = edgeIndexFunction; loop.setEdgeIndexFunction(edgeIndexFunction); }
public void setEdgeIndexFunction(EdgeIndexFunction<ONDEXConcept, ONDEXRelation> parallelEdgeIndexFunction) { this.parallelEdgeIndexFunction = parallelEdgeIndexFunction; loop.setEdgeIndexFunction(parallelEdgeIndexFunction); }
@Override public AbstractEdgeShapeTransformer<AbstractType,String> getEdgeShapeTransformer() { return new EdgeShape.Loop<AbstractType,String> (); } }
@Override public void setEdgeIndexFunction(EdgeIndexFunction<N, E> parallelEdgeIndexFunction) { this.edgeIndexFunction = parallelEdgeIndexFunction; loop.setEdgeIndexFunction(parallelEdgeIndexFunction); }
public Shape apply(Context<Network<N, E>, E> context) { Network graph = context.graph; E e = context.element; if (isLoop(graph, e)) { return loop.apply(context); } return graph.isDirected() ? triangle : BOW_TIE; } }
@Override public AbstractEdgeShapeTransformer<AbstractType,String> getEdgeShapeTransformer() { return new EdgeShape.Loop<AbstractType,String> (); } }
public EdgeShape(Graph<V, E> g) { this.graph = g; this.box = new Box(); this.loop = new Loop(); this.simpleLoop = new SimpleLoop(); }