public abstract class PathCommand extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
PathCommand(boolean isAbsolute)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected javafx.geometry.Point2D |
addPoints(javafx.geometry.Point2D first,
javafx.geometry.Point2D second)
Combines the two given points based on hte
isAbsolute. |
abstract javafx.geometry.Point2D |
getAbsoluteEndPoint(javafx.geometry.Point2D absoluteCurrentPoint)
Gets the next possible absoluteCurrentPoint based on the internal state of the command and the provided absoluteCurrentPoint.
|
abstract Optional<javafx.scene.shape.Rectangle> |
getBoundingBox(javafx.geometry.Point2D absoluteCurrentPoint)
Gets the bounding box which would result of using the given absoluteCurrentPoint as the starting point and then applying the internal state of the command.
|
protected double |
getDistanceX(javafx.geometry.Point2D first,
javafx.geometry.Point2D second)
Returns the x distance between the two points. if one of the points is null, then then 0.0 will be returned.
|
protected double |
getDistanceY(javafx.geometry.Point2D first,
javafx.geometry.Point2D second)
Returns the y distance between the two points. if one of the points is null, then then 0.0 will be returned.
|
protected double |
getMinX(javafx.geometry.Point2D first,
javafx.geometry.Point2D second)
Returns the minimum x of the two points.
|
protected double |
getMinY(javafx.geometry.Point2D first,
javafx.geometry.Point2D second)
Returns the minimum y of the two points.
|
protected <T,R> R |
getValueOrFail(T first,
T second,
Function<T,R> valueProvider,
BiFunction<T,T,R> resolver)
Ensures to always return a value of the given values, even if either of the provided values is null.
|
boolean |
isAbsolute()
Returns
isAbsolute. |
protected PathCommand(boolean isAbsolute)
isAbsolute - determines if the command is absolute or not.public boolean isAbsolute()
isAbsolute.isAbsolute.public abstract javafx.geometry.Point2D getAbsoluteEndPoint(javafx.geometry.Point2D absoluteCurrentPoint)
throws PathException
absoluteCurrentPoint - the absoluteCurrentPoint from which to start.Point2D describing the absoluteCurrentPoint that is reached after this command has been applied.PathException - if the next absoluteCurrentPoint can not be determined.public abstract Optional<javafx.scene.shape.Rectangle> getBoundingBox(javafx.geometry.Point2D absoluteCurrentPoint) throws PathException
absoluteCurrentPoint - the absoluteCurrentPoint to be use as the starting point.Optional describing the resulting bounding box.PathException - if the bounding box can not be determined.protected javafx.geometry.Point2D addPoints(javafx.geometry.Point2D first,
javafx.geometry.Point2D second)
throws PathException
isAbsolute. If the command is absolute, the second point will be returned.
Otherwise second point will be added to the first.first - the first point to use, may be null of the command is absolute.second - the second point.PathException - if the command is not absolute the first point is null.protected double getDistanceX(javafx.geometry.Point2D first,
javafx.geometry.Point2D second)
throws PathException
first - the first point.second - the second point.PathException - if both points are null.protected double getMinX(javafx.geometry.Point2D first,
javafx.geometry.Point2D second)
throws PathException
first - the first point.second - the second point.PathException - if both points are null.protected double getDistanceY(javafx.geometry.Point2D first,
javafx.geometry.Point2D second)
throws PathException
first - the first point.second - the second point.PathException - if both points are null.protected double getMinY(javafx.geometry.Point2D first,
javafx.geometry.Point2D second)
throws PathException
first - the first point.second - the second point.PathException - if both points are null.protected <T,R> R getValueOrFail(T first,
T second,
Function<T,R> valueProvider,
BiFunction<T,T,R> resolver)
throws PathException
T - the type of the values.R - the type of the resulting value.first - the first value to use.second - the second value to use.valueProvider - the Function to be called when one of the given values was null.resolver - the BiFunction to be called when both values are not null.PathException - if both values are null.Copyright © 2017 Saxonia Systems AG. All rights reserved.