Class DefaultEdgeArrowRenderingSupport<V,E>
- java.lang.Object
-
- org.jungrapht.visualization.renderers.DefaultEdgeArrowRenderingSupport<V,E>
-
- Type Parameters:
V
- vertex typeE
- edge type
- All Implemented Interfaces:
EdgeArrowRenderingSupport<V,E>
public class DefaultEdgeArrowRenderingSupport<V,E> extends Object implements EdgeArrowRenderingSupport<V,E>
-
-
Constructor Summary
Constructors Constructor Description DefaultEdgeArrowRenderingSupport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AffineTransform
getArrowTransform(RenderContext<V,E> rc, Line2D edgeShape, Shape vertexShape)
Returns a transform to position the arrowhead on this edge shape at the point where it intersects the passed vertex shape.AffineTransform
getArrowTransform(RenderContext<V,E> rc, Shape edgeShape, Shape vertexShape)
Returns a transform to position the arrowhead on this edge shape at the point where it intersects the passed vertex shape.protected Line2D
getFirstOutsideSegment(Line2D line, Shape shape)
Returns a line that intersectsshape
's boundary.protected Line2D
getLastOutsideSegment(Line2D line, Shape shape)
Returns a line that intersectsshape
's boundary.protected AffineTransform
getReverseArrowTransform(RenderContext<V,E> rc, Line2D edgeShape, Shape vertexShape)
AffineTransform
getReverseArrowTransform(RenderContext<V,E> rc, Shape edgeShape, Shape vertexShape)
Returns a transform to position the arrowhead on this edge shape at the point where it intersects the passed vertex shape.AffineTransform
getReverseArrowTransform(RenderContext<V,E> rc, Shape edgeShape, Shape vertexShape, boolean passedGo)
Returns a transform to position the arrowhead on this edge shape at the point where it intersects the passed vertex shape.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
-
-
-
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 interfaceEdgeArrowRenderingSupport<V,E>
- Parameters:
rc
- the rendering context used for rendering the arrowedgeShape
- the shape used to draw the edgevertexShape
- 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 interfaceEdgeArrowRenderingSupport<V,E>
- Parameters:
rc
- the rendering context used for rendering the arrowedgeShape
- the shape used to draw the edgevertexShape
- 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 interfaceEdgeArrowRenderingSupport<V,E>
- Parameters:
rc
- the rendering context used for rendering the arrowedgeShape
- the shape used to draw the edgevertexShape
- the shape used to draw the vertexpassedGo
- 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 interfaceEdgeArrowRenderingSupport<V,E>
- Parameters:
rc
- the rendering context used for rendering the arrowedgeShape
- the shape used to draw the edgevertexShape
- the shape used to draw the vertex- Returns:
- a transform used for positioning the arrowhead for this vertex and edge
-
getReverseArrowTransform
protected AffineTransform getReverseArrowTransform(RenderContext<V,E> rc, Line2D edgeShape, Shape vertexShape)
-
getLastOutsideSegment
protected Line2D getLastOutsideSegment(Line2D line, Shape shape)
Returns a line that intersectsshape
's boundary.- Parameters:
line
- line to subdivideshape
- 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 intersectsshape
's boundary.- Parameters:
line
- line to subdivideshape
- 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
-
-