Class DefaultEdgeArrowRenderingSupport<V,​E>

    • Constructor Detail

      • DefaultEdgeArrowRenderingSupport

        public DefaultEdgeArrowRenderingSupport()
    • Method Detail

      • getArrowTransform

        public AffineTransform getArrowTransform​(RenderContext<V,​E> rc,
                                                 Shape edgeShape,
                                                 Shape vertexShape)
        Description copied from interface: EdgeArrowRenderingSupport
        Returns a transform to position the arrowhead on this edge shape at the point where it intersects the passed vertex shape.
        Specified by:
        getArrowTransform in interface EdgeArrowRenderingSupport<V,​E>
        Parameters:
        rc - the rendering context used for rendering the arrow
        edgeShape - the shape used to draw the edge
        vertexShape - the shape used to draw the vertex
        Returns:
        a transform used for positioning the arrowhead for this vertex and edge
      • getReverseArrowTransform

        public AffineTransform getReverseArrowTransform​(RenderContext<V,​E> rc,
                                                        Shape edgeShape,
                                                        Shape vertexShape)
        Description copied from interface: EdgeArrowRenderingSupport
        Returns a transform to position the arrowhead on this edge shape at the point where it intersects the passed vertex shape.
        Specified by:
        getReverseArrowTransform in interface EdgeArrowRenderingSupport<V,​E>
        Parameters:
        rc - the rendering context used for rendering the arrow
        edgeShape - the shape used to draw the edge
        vertexShape - the shape used to draw the vertex
        Returns:
        a transform used for positioning the arrowhead for this vertex and edge
      • getReverseArrowTransform

        public AffineTransform getReverseArrowTransform​(RenderContext<V,​E> rc,
                                                        Shape edgeShape,
                                                        Shape vertexShape,
                                                        boolean passedGo)
        Description copied from interface: EdgeArrowRenderingSupport
        Returns a transform to position the arrowhead on this edge shape at the point where it intersects the passed vertex shape.

        The Loop edge is a special case because its starting point is not inside the vertex. The passedGo flag handles this case.

        Specified by:
        getReverseArrowTransform in interface EdgeArrowRenderingSupport<V,​E>
        Parameters:
        rc - the rendering context used for rendering the arrow
        edgeShape - the shape used to draw the edge
        vertexShape - the shape used to draw the vertex
        passedGo - used for rendering loop edges
        Returns:
        a transform used for positioning the arrowhead for this vertex and edge
      • getArrowTransform

        public AffineTransform getArrowTransform​(RenderContext<V,​E> rc,
                                                 Line2D edgeShape,
                                                 Shape vertexShape)
        Description copied from interface: EdgeArrowRenderingSupport
        Returns a transform to position the arrowhead on this edge shape at the point where it intersects the passed vertex shape.
        Specified by:
        getArrowTransform in interface EdgeArrowRenderingSupport<V,​E>
        Parameters:
        rc - the rendering context used for rendering the arrow
        edgeShape - the shape used to draw the edge
        vertexShape - the shape used to draw the vertex
        Returns:
        a transform used for positioning the arrowhead for this vertex and edge
      • getLastOutsideSegment

        protected Line2D getLastOutsideSegment​(Line2D line,
                                               Shape shape)
        Returns a line that intersects shape's boundary.
        Parameters:
        line - line to subdivide
        shape - shape to compare with line
        Returns:
        a line that intersects the shape boundary
        Throws:
        IllegalArgumentException - if the passed line's point2 is not inside the shape
      • getFirstOutsideSegment

        protected Line2D getFirstOutsideSegment​(Line2D line,
                                                Shape shape)
        Returns a line that intersects shape's boundary.
        Parameters:
        line - line to subdivide
        shape - shape to compare with line
        Returns:
        a line that intersects the shape boundary
        Throws:
        IllegalArgumentException - if the passed line's point1 is not inside the shape
      • subdivide

        protected void subdivide​(Line2D src,
                                 Line2D left,
                                 Line2D right)
        divide a Line2D into 2 new Line2Ds that are returned in the passed left and right instances, if non-null
        Parameters:
        src - the line to divide
        left - the left side, or null
        right - the right side, or null