Class BasicEdgeArrowRenderingSupport<V,E>
- java.lang.Object
-
- edu.uci.ics.jung.visualization.renderers.BasicEdgeArrowRenderingSupport<V,E>
-
- All Implemented Interfaces:
EdgeArrowRenderingSupport<V,E>
public class BasicEdgeArrowRenderingSupport<V,E> extends java.lang.Object implements EdgeArrowRenderingSupport<V,E>
-
-
Constructor Summary
Constructors Constructor Description BasicEdgeArrowRenderingSupport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.geom.AffineTransform
getArrowTransform(RenderContext<V,E> rc, java.awt.geom.Line2D edgeShape, java.awt.Shape vertexShape)
This is used for the arrow of a directed and for one of the arrows for non-directed edges Get a transform to place the arrow shape on the passed edge at the point where it intersects the passed shapejava.awt.geom.AffineTransform
getArrowTransform(RenderContext<V,E> rc, java.awt.Shape edgeShape, java.awt.Shape vertexShape)
Returns a transform to position the arrowhead on this edge shape at the point where it intersects the passed vertex shape.protected java.awt.geom.Line2D
getFirstOutsideSegment(java.awt.geom.Line2D line, java.awt.Shape shape)
Passed Line's point1 must be inside the passed shape or an IllegalArgumentException is thrownprotected java.awt.geom.Line2D
getLastOutsideSegment(java.awt.geom.Line2D line, java.awt.Shape shape)
Passed Line's point2 must be inside the passed shape or an IllegalArgumentException is thrownprotected java.awt.geom.AffineTransform
getReverseArrowTransform(RenderContext<V,E> rc, java.awt.geom.Line2D edgeShape, java.awt.Shape vertexShape)
This is used for the reverse-arrow of a non-directed edge get a transform to place the arrow shape on the passed edge at the point where it intersects the passed shapejava.awt.geom.AffineTransform
getReverseArrowTransform(RenderContext<V,E> rc, java.awt.Shape edgeShape, java.awt.Shape vertexShape)
Returns a transform to position the arrowhead on this edge shape at the point where it intersects the passed vertex shape.java.awt.geom.AffineTransform
getReverseArrowTransform(RenderContext<V,E> rc, java.awt.Shape edgeShape, java.awt.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(java.awt.geom.Line2D src, java.awt.geom.Line2D left, java.awt.geom.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 java.awt.geom.AffineTransform getArrowTransform(RenderContext<V,E> rc, java.awt.Shape edgeShape, java.awt.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>
-
getReverseArrowTransform
public java.awt.geom.AffineTransform getReverseArrowTransform(RenderContext<V,E> rc, java.awt.Shape edgeShape, java.awt.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>
-
getReverseArrowTransform
public java.awt.geom.AffineTransform getReverseArrowTransform(RenderContext<V,E> rc, java.awt.Shape edgeShape, java.awt.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 staring point is not inside the vertex. The passedGo flag handles this case.
- Specified by:
getReverseArrowTransform
in interfaceEdgeArrowRenderingSupport<V,E>
passedGo
- - used only for Loop edges
-
getArrowTransform
public java.awt.geom.AffineTransform getArrowTransform(RenderContext<V,E> rc, java.awt.geom.Line2D edgeShape, java.awt.Shape vertexShape)
Description copied from interface:EdgeArrowRenderingSupport
This is used for the arrow of a directed and for one of the arrows for non-directed edges Get a transform to place the arrow shape on the passed edge at the point where it intersects the passed shape- Specified by:
getArrowTransform
in interfaceEdgeArrowRenderingSupport<V,E>
- Returns:
-
getReverseArrowTransform
protected java.awt.geom.AffineTransform getReverseArrowTransform(RenderContext<V,E> rc, java.awt.geom.Line2D edgeShape, java.awt.Shape vertexShape)
This is used for the reverse-arrow of a non-directed edge get a transform to place the arrow shape on the passed edge at the point where it intersects the passed shape- Parameters:
edgeShape
-vertexShape
-- Returns:
-
getLastOutsideSegment
protected java.awt.geom.Line2D getLastOutsideSegment(java.awt.geom.Line2D line, java.awt.Shape shape)
Passed Line's point2 must be inside the passed shape or an IllegalArgumentException is thrown- Parameters:
line
- line to subdivideshape
- shape to compare with line- Returns:
- a line that intersects the shape boundary
- Throws:
java.lang.IllegalArgumentException
- if the passed line's point1 is not inside the shape
-
getFirstOutsideSegment
protected java.awt.geom.Line2D getFirstOutsideSegment(java.awt.geom.Line2D line, java.awt.Shape shape)
Passed Line's point1 must be inside the passed shape or an IllegalArgumentException is thrown- Parameters:
line
- line to subdivideshape
- shape to compare with line- Returns:
- a line that intersects the shape boundary
- Throws:
java.lang.IllegalArgumentException
- if the passed line's point1 is not inside the shape
-
subdivide
protected void subdivide(java.awt.geom.Line2D src, java.awt.geom.Line2D left, java.awt.geom.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 divideleft
- the left side, or nullright
- the right side, or null
-
-