Class EdgeShape<V,E>
- java.lang.Object
-
- edu.uci.ics.jung.visualization.decorators.EdgeShape<V,E>
-
- Type Parameters:
V- the vertex typeE- the edge type
public class EdgeShape<V,E> extends java.lang.ObjectAn interface for decorators that return aShapefor a specified edge. All edge shapes must be defined so that their endpoints are at (0,0) and (1,0). They will be scaled, rotated and translated into position by the PluggableRenderer.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classEdgeShape.BentLineAn edge shape that renders as a bent-line between the vertex endpoints.classEdgeShape.BoxAn edge shape that renders as a diamond with its nadir at the center of the vertex.classEdgeShape.CubicCurveAn edge shape that renders as a CubicCurve between vertex endpoints.classEdgeShape.LineAn edge shape that renders as a straight line between the vertex endpoints.classEdgeShape.LoopAn edge shape that renders as a loop with its nadir at the center of the vertex.classEdgeShape.OrthogonalAn edge shape that renders as a bent-line between the vertex endpoints.classEdgeShape.QuadCurveAn edge shape that renders as a QuadCurve between vertex endpoints.classEdgeShape.SimpleLoopAn edge shape that renders as a loop with its nadir at the center of the vertex.classEdgeShape.WedgeAn edge shape that renders as an isosceles triangle whose apex is at the destination vertex for directed edges, and as a "bowtie" shape for undirected edges.
-
Field Summary
Fields Modifier and Type Field Description private static java.awt.geom.GeneralPathBENT_LINEprivate static java.awt.geom.GeneralPathbowtieprotected EdgeShape.Boxboxprivate static java.awt.geom.Rectangle2DBOXprivate static java.awt.geom.CubicCurve2DCUBIC_CURVEprivate static java.awt.geom.Ellipse2DELLIPSEprotected Graph<V,E>graphprivate static java.awt.geom.Line2DLINEprotected EdgeShape.LooploopA convenience instance for other edge shapes to use for self-loop edges where parallel instances will not overlay each other.private static java.awt.geom.QuadCurve2DQUAD_CURVEprotected EdgeShape.SimpleLoopsimpleLoopA convenience instance for other edge shapes to use for self-loop edges where parallel instances overlay each other.private static java.awt.geom.GeneralPathtriangle
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.awt.ShapebuildFrame(java.awt.geom.RectangularShape shape, int index)static <V,E>
EdgeShape.QuadCurvecubicCurve(Graph<V,E> graph)private intgetIndex(E e, EdgeIndexFunction<V,E> edgeIndexFunction)private java.awt.ShapegetLoopOrNull(E e)private java.awt.ShapegetLoopOrNull(E e, com.google.common.base.Function<? super E,java.awt.Shape> loop)static <V,E>
EdgeShape.Lineline(Graph<V,E> graph)static <V,E>
EdgeShape.Orthogonalorthogonal(Graph<V,E> graph)static <V,E>
EdgeShape.QuadCurvequadCurve(Graph<V,E> graph)static <V,E>
EdgeShape.Wedgewedge(Graph<V,E> graph, int width)
-
-
-
Field Detail
-
LINE
private static final java.awt.geom.Line2D LINE
-
BENT_LINE
private static final java.awt.geom.GeneralPath BENT_LINE
-
QUAD_CURVE
private static final java.awt.geom.QuadCurve2D QUAD_CURVE
-
CUBIC_CURVE
private static final java.awt.geom.CubicCurve2D CUBIC_CURVE
-
ELLIPSE
private static final java.awt.geom.Ellipse2D ELLIPSE
-
BOX
private static java.awt.geom.Rectangle2D BOX
-
triangle
private static java.awt.geom.GeneralPath triangle
-
bowtie
private static java.awt.geom.GeneralPath bowtie
-
loop
protected final EdgeShape.Loop loop
A convenience instance for other edge shapes to use for self-loop edges where parallel instances will not overlay each other.
-
simpleLoop
protected final EdgeShape.SimpleLoop simpleLoop
A convenience instance for other edge shapes to use for self-loop edges where parallel instances overlay each other.
-
box
protected final EdgeShape.Box box
-
-
Method Detail
-
getLoopOrNull
private java.awt.Shape getLoopOrNull(E e)
-
getLoopOrNull
private java.awt.Shape getLoopOrNull(E e, com.google.common.base.Function<? super E,java.awt.Shape> loop)
-
line
public static <V,E> EdgeShape.Line line(Graph<V,E> graph)
-
quadCurve
public static <V,E> EdgeShape.QuadCurve quadCurve(Graph<V,E> graph)
-
cubicCurve
public static <V,E> EdgeShape.QuadCurve cubicCurve(Graph<V,E> graph)
-
orthogonal
public static <V,E> EdgeShape.Orthogonal orthogonal(Graph<V,E> graph)
-
wedge
public static <V,E> EdgeShape.Wedge wedge(Graph<V,E> graph, int width)
-
getIndex
private int getIndex(E e, EdgeIndexFunction<V,E> edgeIndexFunction)
-
buildFrame
private java.awt.Shape buildFrame(java.awt.geom.RectangularShape shape, int index)
-
-