Module com.flexganttfx.view
Class LinkRenderer<T extends ActivityLink<?>>
java.lang.Object
com.flexganttfx.view.graphics.renderer.RendererBase
com.flexganttfx.view.graphics.renderer.LinkRenderer<T>
- Direct Known Subclasses:
CurvedLinkRenderer
,StraightLinkRenderer
The base class for all link renderers. It is only used by the
LinksCanvas
.- Since:
- 1.0
- See Also:
-
Property Summary
PropertiesTypePropertyDescriptionfinal ObjectProperty<Color>
final IntegerProperty
The arrow size determines how big the arrow head will be drawn.The gap determines how far the line is drawn away from the bounds of the source or target timeline object.final DoubleProperty
The offset determines the end location of the first segment of the calculated path.final ObjectProperty<Color>
final DoubleProperty
Properties inherited from class com.flexganttfx.view.graphics.renderer.RendererBase
alpha, enabled, snapToPixel
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
An enum listing the various directions the arrow can be painted.static enum
An enumerator of possible locations that the target object can have relative to the source object. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
LinkRenderer
(GraphicsBase<?> graphics, String name) Constructs a new link renderer. -
Method Summary
Modifier and TypeMethodDescriptionfinal ObjectProperty<Color>
final IntegerProperty
The arrow size determines how big the arrow head will be drawn.protected final LinkRenderer.TargetLocation
calculateTargetLocation
(double sx, double sy, double tx, double ty) void
draw
(T link, GraphicsContext gc, Rectangle2D sourceBounds, Rectangle2D targetBounds) Draws the given link between the two activity bounds into the given graphics context.protected void
drawArrowHead
(LinkRenderer.ArrowDirection direction, GraphicsContext gc, double x, double y) protected abstract void
drawEndToEnd
(GraphicsContext gc, Rectangle2D sourceRect, Rectangle2D targetRect) Draws a path in the given graphics context from the end of the source rectangle to the end of the target rectangle.protected abstract 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 abstract 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 abstract void
drawStartToStart
(GraphicsContext gc, Rectangle2D sourceRect, Rectangle2D targetRect) Draws a path in the given graphics context from the start of the source rectangle to the start of the target rectangle.The gap determines how far the line is drawn away from the bounds of the source or target timeline object.final Color
Gets the value of thearrowHeadColor
property.final int
Gets the value of thearrowSize
property.final double
getGap()
The gap determines how far the line is drawn away from the bounds of the source or target timeline object.final double
The offset determines the end location of the first segment of the calculated path.final Color
Gets the value of thestrokeColor
property.final double
Gets the value of thestrokeWidth
property.final DoubleProperty
The offset determines the end location of the first segment of the calculated path.final void
setArrowHeadColor
(Color arrowHeadColor) Sets the value of thearrowHeadColor
property.final void
setArrowSize
(int arrowSize) Sets the value of thearrowSize
property.final void
setGap
(double gap) The gap determines how far the line is drawn away from the bounds of the source or target timeline object.final void
setOffset
(double offset) The offset determines the end location of the first segment of the calculated path.final void
setStrokeColor
(Color strokeColor) Sets the value of thestrokeColor
property.final void
setStrokeWidth
(double strokeWidth) Sets the value of thestrokeWidth
property.final ObjectProperty<Color>
final DoubleProperty
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
-
Property Details
-
strokeWidth
-
strokeColor
-
arrowHeadColor
-
arrowSize
The arrow size determines how big the arrow head will be drawn. -
offset
The offset determines the end location of the first segment of the calculated path. The first segment is used to move away from the start or end bounds before continuing to draw up or down.- See Also:
-
gap
The gap determines how far the line is drawn away from the bounds of the source or target timeline object.- See Also:
-
-
Constructor Details
-
LinkRenderer
Constructs a new link renderer.- Since:
- 1.0
-
-
Method Details
-
calculateTargetLocation
protected final LinkRenderer.TargetLocation calculateTargetLocation(double sx, double sy, double tx, double ty) -
draw
Draws the given link between the two activity bounds into the given graphics context.- Parameters:
link
- the link to drawgc
- the graphics contextsourceBounds
- the bounds of the source activitytargetBounds
- the bounds of the target activity
-
drawStartToStart
protected abstract void drawStartToStart(GraphicsContext gc, Rectangle2D sourceRect, Rectangle2D targetRect) Draws a path in the given graphics context from the start of the source rectangle to the start of the target rectangle.- Parameters:
sourceRect
- the source rectangletargetRect
- the target rectangle- Since:
- 1.0
-
drawEndToEnd
protected abstract void drawEndToEnd(GraphicsContext gc, Rectangle2D sourceRect, Rectangle2D targetRect) Draws a path in the given graphics context from the end of the source rectangle to the end of the target rectangle.- Parameters:
sourceRect
- the source rectangletargetRect
- the target rectangle- Since:
- 1.0
-
drawStartToEnd
protected abstract 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.- Parameters:
sourceRect
- the source rectangletargetRect
- the target rectangle- Since:
- 1.0
-
drawEndToStart
protected abstract 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.- Parameters:
sourceRect
- the source rectangletargetRect
- the target rectangle- Since:
- 1.0
-
drawArrowHead
protected void drawArrowHead(LinkRenderer.ArrowDirection direction, GraphicsContext gc, double x, double y) -
getStrokeWidth
public final double getStrokeWidth()Gets the value of thestrokeWidth
property.- Property description:
- Returns:
- the value of the
strokeWidth
property - See Also:
-
strokeWidthProperty
- Returns:
- the
strokeWidth
property - See Also:
-
setStrokeWidth
public final void setStrokeWidth(double strokeWidth) Sets the value of thestrokeWidth
property.- Property description:
- Parameters:
strokeWidth
- the value for thestrokeWidth
property- See Also:
-
getStrokeColor
Gets the value of thestrokeColor
property.- Property description:
- Returns:
- the value of the
strokeColor
property - See Also:
-
strokeColorProperty
- Returns:
- the
strokeColor
property - See Also:
-
setStrokeColor
Sets the value of thestrokeColor
property.- Property description:
- Parameters:
strokeColor
- the value for thestrokeColor
property- See Also:
-
getArrowHeadColor
Gets the value of thearrowHeadColor
property.- Property description:
- Returns:
- the value of the
arrowHeadColor
property - See Also:
-
arrowHeadColorProperty
- Returns:
- the
arrowHeadColor
property - See Also:
-
setArrowHeadColor
Sets the value of thearrowHeadColor
property.- Property description:
- Parameters:
arrowHeadColor
- the value for thearrowHeadColor
property- See Also:
-
arrowSizeProperty
The arrow size determines how big the arrow head will be drawn.- Returns:
- the arrow head size
- See Also:
-
getArrowSize
public final int getArrowSize()Gets the value of thearrowSize
property.- Property description:
- The arrow size determines how big the arrow head will be drawn.
- Returns:
- the value of the
arrowSize
property - See Also:
-
setArrowSize
public final void setArrowSize(int arrowSize) Sets the value of thearrowSize
property.- Property description:
- The arrow size determines how big the arrow head will be drawn.
- Parameters:
arrowSize
- the value for thearrowSize
property- See Also:
-
offsetProperty
The offset determines the end location of the first segment of the calculated path. The first segment is used to move away from the start or end bounds before continuing to draw up or down.- Returns:
- the
offset
property - See Also:
-
getOffset
public final double getOffset()The offset determines the end location of the first segment of the calculated path. The first segment is used to move away from the start or end bounds before continuing to draw up or down.- Returns:
- the offset
- Since:
- 1.0
-
setOffset
public final void setOffset(double offset) The offset determines the end location of the first segment of the calculated path. The first segment is used to move away from the start or end bounds before continuing to draw up or down.- Parameters:
offset
- the offset in pixels- Since:
- 1.0
-
gapProperty
The gap determines how far the line is drawn away from the bounds of the source or target timeline object.- Returns:
- the
gap
property - See Also:
-
getGap
public final double getGap()The gap determines how far the line is drawn away from the bounds of the source or target timeline object.- Returns:
- the gap between line and timeline objects
- Since:
- 1.0
-
setGap
public final void setGap(double gap) The gap determines how far the line is drawn away from the bounds of the source or target timeline object.- Parameters:
gap
- the distance between line and timeline objects- Since:
- 1.0
-