Class EdgeShape<V,​E>

  • Type Parameters:
    V - the vertex type
    E - the edge type

    public class EdgeShape<V,​E>
    extends java.lang.Object
    An interface for decorators that return a Shape for 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
      class  EdgeShape.BentLine
      An edge shape that renders as a bent-line between the vertex endpoints.
      class  EdgeShape.Box
      An edge shape that renders as a diamond with its nadir at the center of the vertex.
      class  EdgeShape.CubicCurve
      An edge shape that renders as a CubicCurve between vertex endpoints.
      class  EdgeShape.Line
      An edge shape that renders as a straight line between the vertex endpoints.
      class  EdgeShape.Loop
      An edge shape that renders as a loop with its nadir at the center of the vertex.
      class  EdgeShape.Orthogonal
      An edge shape that renders as a bent-line between the vertex endpoints.
      class  EdgeShape.QuadCurve
      An edge shape that renders as a QuadCurve between vertex endpoints.
      class  EdgeShape.SimpleLoop
      An edge shape that renders as a loop with its nadir at the center of the vertex.
      class  EdgeShape.Wedge
      An 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.GeneralPath BENT_LINE  
      private static java.awt.geom.GeneralPath bowtie  
      protected EdgeShape.Box box  
      private static java.awt.geom.Rectangle2D BOX  
      private static java.awt.geom.CubicCurve2D CUBIC_CURVE  
      private static java.awt.geom.Ellipse2D ELLIPSE  
      protected Graph<V,​E> graph  
      private static java.awt.geom.Line2D LINE  
      protected EdgeShape.Loop loop
      A 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.QuadCurve2D QUAD_CURVE  
      protected EdgeShape.SimpleLoop simpleLoop
      A convenience instance for other edge shapes to use for self-loop edges where parallel instances overlay each other.
      private static java.awt.geom.GeneralPath triangle  
    • Constructor Summary

      Constructors 
      Constructor Description
      EdgeShape​(Graph<V,​E> g)  
    • 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
      • graph

        protected final Graph<V,​E> graph
      • 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.
    • Constructor Detail

      • EdgeShape

        public EdgeShape​(Graph<V,​E> g)
    • 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)
      • buildFrame

        private java.awt.Shape buildFrame​(java.awt.geom.RectangularShape shape,
                                          int index)