Module com.flexganttfx.view
Class CurvedLinkRenderer<T extends ActivityLink<?>>
- java.lang.Object
-
- com.flexganttfx.view.graphics.renderer.RendererBase
-
- com.flexganttfx.view.graphics.renderer.LinkRenderer<T>
-
- com.flexganttfx.view.graphics.renderer.CurvedLinkRenderer<T>
-
public class CurvedLinkRenderer<T extends ActivityLink<?>> extends LinkRenderer<T>
A link renderer used to draw curved link lines between activities of typeActivityLink
. It is only used by theLinksCanvas
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.flexganttfx.view.graphics.renderer.LinkRenderer
LinkRenderer.ArrowDirection, LinkRenderer.TargetLocation
-
-
Constructor Summary
Constructors Constructor Description CurvedLinkRenderer(GraphicsBase<?> graphics, String name)
Constructs a new link renderer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
drawEndToEnd(GraphicsContext gc, Rectangle2D sourceRect, Rectangle2D targetRect)
Draws a link in the given graphics context from the end of the source rectangle to the end of the target rectangle.protected void
drawEndToStart(GraphicsContext gc, Rectangle2D sourceRect, Rectangle2D targetRect)
Draws a path in the given graphics context from the end of the source rectangle to the start of the target rectangle.protected void
drawStartToEnd(GraphicsContext gc, Rectangle2D sourceRect, Rectangle2D targetRect)
Draws a path in the given graphics context from the start of the source rectangle to the end of the target rectangle.protected void
drawStartToStart(GraphicsContext gc, Rectangle2D sourceRect, Rectangle2D targetRect)
Draws a link in the given graphics context from the start of the source rectangle to the start of the target rectangle.double
getCurve()
Returns the radius of the curve.void
setCurve(double curve)
Sets the radius for the curve.-
Methods inherited from class com.flexganttfx.view.graphics.renderer.LinkRenderer
arrowHeadColorProperty, arrowSizeProperty, calculateTargetLocation, draw, drawArrowHead, gapProperty, getArrowHeadColor, getArrowSize, getGap, getOffset, getStrokeColor, getStrokeWidth, offsetProperty, setArrowHeadColor, setArrowSize, setGap, setOffset, setStrokeColor, setStrokeWidth, strokeColorProperty, strokeWidthProperty
-
Methods inherited from class com.flexganttfx.view.graphics.renderer.RendererBase
alphaProperty, disableRedrawAfterPropertyChange, enabledProperty, enableRedrawAfterPropertyChange, getAlpha, getGraphics, getLocation, getName, getTimeAt, isEnabled, isSnapToPixel, redrawObservable, setAlpha, setEnabled, setSnapToPixel, snapPositionX, snapPositionY, snapSizeX, snapSizeY, snapSpaceX, snapSpaceY, snapToPixelProperty
-
-
-
-
Constructor Detail
-
CurvedLinkRenderer
public CurvedLinkRenderer(GraphicsBase<?> graphics, String name)
Constructs a new link renderer.
-
-
Method Detail
-
drawStartToStart
protected void drawStartToStart(GraphicsContext gc, Rectangle2D sourceRect, Rectangle2D targetRect)
Draws a link in the given graphics context from the start of the source rectangle to the start of the target rectangle.- Specified by:
drawStartToStart
in classLinkRenderer<T extends ActivityLink<?>>
- Parameters:
sourceRect
- the source rectangletargetRect
- the target rectangle
-
drawEndToEnd
protected void drawEndToEnd(GraphicsContext gc, Rectangle2D sourceRect, Rectangle2D targetRect)
Draws a link in the given graphics context from the end of the source rectangle to the end of the target rectangle.- Specified by:
drawEndToEnd
in classLinkRenderer<T extends ActivityLink<?>>
- Parameters:
sourceRect
- the source rectangletargetRect
- the target rectangle
-
drawStartToEnd
protected void drawStartToEnd(GraphicsContext gc, Rectangle2D sourceRect, Rectangle2D targetRect)
Draws a path in the given graphics context from the start of the source rectangle to the end of the target rectangle.- Specified by:
drawStartToEnd
in classLinkRenderer<T extends ActivityLink<?>>
- Parameters:
sourceRect
- the source rectangletargetRect
- the target rectangle
-
drawEndToStart
protected void drawEndToStart(GraphicsContext gc, Rectangle2D sourceRect, Rectangle2D targetRect)
Draws a path in the given graphics context from the end of the source rectangle to the start of the target rectangle.- Specified by:
drawEndToStart
in classLinkRenderer<T extends ActivityLink<?>>
- Parameters:
sourceRect
- the source rectangletargetRect
- the target rectangle
-
setCurve
public final void setCurve(double curve)
Sets the radius for the curve. The radius can not be larger than the offset (seeLinkRenderer.setOffset(double)
). Setting this value to 0 results in corners instead of curves (but then you might consider using theStraightLinkRenderer
as it is more efficient).- Parameters:
curve
- the radius of the curve
-
getCurve
public final double getCurve()
Returns the radius of the curve.- Returns:
- the curve radius
-
-