/** * 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; } }
/** * 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 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; } }