public class LinkRenderer<T extends ActivityLink<?>> extends RendererBase
ActivityLink
. It is only used by the LinksCanvas
.Modifier and Type | Class and Description |
---|---|
static class |
LinkRenderer.ArrowDirection
An enum listing the various directions the arrow can be painted.
|
static class |
LinkRenderer.TargetLocation
An enumerator of possible locations that the target object can have
relative to the source object.
|
Constructor and Description |
---|
LinkRenderer(GraphicsBase<?> graphics,
String name)
Constructs a new path calculator.
|
Modifier and Type | Method and Description |
---|---|
javafx.beans.property.ObjectProperty<javafx.scene.paint.Color> |
arrowHeadColorProperty() |
javafx.beans.property.IntegerProperty |
arrowSizeProperty()
The arrow size determines how big the arrow head will be drawn.
|
protected LinkRenderer.TargetLocation |
calculateTargetLocation(double sx,
double sy,
double tx,
double ty) |
void |
draw(T link,
javafx.scene.canvas.GraphicsContext gc,
javafx.geometry.Rectangle2D sourceBounds,
javafx.geometry.Rectangle2D targetBounds)
Draws the given link between the two activity bounds into the given graphics context.
|
protected void |
drawArrowHead(LinkRenderer.ArrowDirection direction,
javafx.scene.canvas.GraphicsContext gc,
double x,
double y) |
protected void |
drawEndToEnd(javafx.scene.canvas.GraphicsContext gc,
javafx.geometry.Rectangle2D sourceRect,
javafx.geometry.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 void |
drawEndToStart(javafx.scene.canvas.GraphicsContext gc,
javafx.geometry.Rectangle2D sourceRect,
javafx.geometry.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(javafx.scene.canvas.GraphicsContext gc,
javafx.geometry.Rectangle2D sourceRect,
javafx.geometry.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(javafx.scene.canvas.GraphicsContext gc,
javafx.geometry.Rectangle2D sourceRect,
javafx.geometry.Rectangle2D targetRect)
Draws a path in the given graphics context from the start of the source
rectangle to the start of the target rectangle.
|
javafx.beans.property.DoubleProperty |
gapProperty()
The gap determines how far the line is drawn away from the bounds of the
source or target timeline object.
|
javafx.scene.paint.Color |
getArrowHeadColor() |
int |
getArrowSize() |
double |
getCurve()
Returns the radius of the curve.
|
double |
getGap()
The gap determines how far the line is drawn away from the bounds of the
source or target timeline object.
|
double |
getOffset()
The offset determines the end location of the first segment of the
calculated path.
|
javafx.scene.paint.Color |
getStrokeColor() |
double |
getStrokeWidth() |
javafx.beans.property.DoubleProperty |
offsetProperty()
The offset determines the end location of the first segment of the
calculated path.
|
void |
setArrowHeadColor(javafx.scene.paint.Color arrowHeadColor) |
void |
setArrowSize(int arrowSize) |
void |
setCurve(double curve)
Sets the radius for the curve.
|
void |
setGap(double gap)
The gap determines how far the line is drawn away from the bounds of the
source or target timeline object.
|
void |
setOffset(double offset)
The offset determines the end location of the first segment of the
calculated path.
|
void |
setStrokeColor(javafx.scene.paint.Color strokeColor) |
void |
setStrokeWidth(double strokeWidth) |
javafx.beans.property.ObjectProperty<javafx.scene.paint.Color> |
strokeColorProperty() |
javafx.beans.property.DoubleProperty |
strokeWidthProperty() |
alphaProperty, disableRedrawAfterPropertyChange, enabledProperty, enableRedrawAfterPropertyChange, getAlpha, getGraphics, getLocation, getName, getTimeAt, isEnabled, isSnapToPixel, redrawObservable, setAlpha, setEnabled, setSnapToPixel, snapPositionX, snapPositionY, snapSizeX, snapSizeY, snapSpaceX, snapSpaceY, snapToPixelProperty
public LinkRenderer(GraphicsBase<?> graphics, String name)
protected LinkRenderer.TargetLocation calculateTargetLocation(double sx, double sy, double tx, double ty)
public void draw(T link, javafx.scene.canvas.GraphicsContext gc, javafx.geometry.Rectangle2D sourceBounds, javafx.geometry.Rectangle2D targetBounds)
link
- the link to drawgc
- the graphics contextsourceBounds
- the bounds of the source activitytargetBounds
- the bounds of the target activityprotected void drawStartToStart(javafx.scene.canvas.GraphicsContext gc, javafx.geometry.Rectangle2D sourceRect, javafx.geometry.Rectangle2D targetRect)
sourceRect
- the source rectangletargetRect
- the target rectangleprotected void drawEndToEnd(javafx.scene.canvas.GraphicsContext gc, javafx.geometry.Rectangle2D sourceRect, javafx.geometry.Rectangle2D targetRect)
sourceRect
- the source rectangletargetRect
- the target rectangleprotected void drawStartToEnd(javafx.scene.canvas.GraphicsContext gc, javafx.geometry.Rectangle2D sourceRect, javafx.geometry.Rectangle2D targetRect)
sourceRect
- the source rectangletargetRect
- the target rectangleprotected void drawEndToStart(javafx.scene.canvas.GraphicsContext gc, javafx.geometry.Rectangle2D sourceRect, javafx.geometry.Rectangle2D targetRect)
sourceRect
- the source rectangletargetRect
- the target rectangleprotected void drawArrowHead(LinkRenderer.ArrowDirection direction, javafx.scene.canvas.GraphicsContext gc, double x, double y)
public final double getStrokeWidth()
public final javafx.beans.property.DoubleProperty strokeWidthProperty()
public final void setStrokeWidth(double strokeWidth)
public final javafx.scene.paint.Color getStrokeColor()
public final javafx.beans.property.ObjectProperty<javafx.scene.paint.Color> strokeColorProperty()
public final void setStrokeColor(javafx.scene.paint.Color strokeColor)
public final javafx.scene.paint.Color getArrowHeadColor()
public final javafx.beans.property.ObjectProperty<javafx.scene.paint.Color> arrowHeadColorProperty()
public final void setArrowHeadColor(javafx.scene.paint.Color arrowHeadColor)
public final javafx.beans.property.IntegerProperty arrowSizeProperty()
public final int getArrowSize()
public final void setArrowSize(int arrowSize)
public final javafx.beans.property.DoubleProperty offsetProperty()
public final double getOffset()
public final void setOffset(double offset)
offset
- the offset in pixelspublic final void setCurve(double curve)
setOffset(double)
). Setting this value to 0 results
in corners instead of curves.curve
- the radius of the curvepublic final double getCurve()
public javafx.beans.property.DoubleProperty gapProperty()
public final double getGap()
public final void setGap(double gap)
gap
- the distance between line and timeline objectsCopyright © 2020 Dirk Lemmermann Software & Consulting. All rights reserved.