- All Implemented Interfaces:
Shape,Serializable,Iterable<BezierNode>,ImmutableCollection<BezierNode>,ImmutableList<BezierNode>,ImmutableSequencedCollection<BezierNode>,ReadOnlyCollection<BezierNode>,ReadOnlyList<BezierNode>,ReadOnlySequencedCollection<BezierNode>
A BezierPath is defined by its nodes. Each node has three control points:
C0, C1, C2. A mask defines which control points are in use. At a node, the path
passes through C0. C1 controls the curve going towards C0. C2 controls the
curve going away from C0.
- Author:
- Werner Randelshofer
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionBezierPath(@Nullable Iterable<BezierNode> nodes) BezierPath(@Nullable Iterable<BezierNode> nodes, int windingRule) BezierPath(@Nullable Iterable<BezierNode> nodes, javafx.scene.shape.FillRule windingRule) BezierPath(PrivateData privateData, int windingRule) -
Method Summary
Modifier and TypeMethodDescriptionadd(int index, BezierNode element) add(BezierNode element) addAll(int index, Iterable<? extends BezierNode> c) addAll(Iterable<? extends BezierNode> c) addFirst(@Nullable BezierNode element) addLast(@Nullable BezierNode element) booleancontains(double x, double y) booleancontains(double x, double y, double tolerance) booleancontains(double x, double y, double w, double h) booleanbooleanempty()Evaluates the first point of the bezier path.Evaluates the reverse derivative of the last point.get(int index) @Nullable Point2DgetOutgoingTangentPoint(int index) Gets the outgoing tangent point for the bezier node at the specified index.getPathIterator(AffineTransform at, double flatness) intbooleanintersects(double x, double y, double w, double h) booleanjoin(int segment, double tolerance) protected VectorList<BezierNode> newInstance(PrivateData privateData) static BezierPathof()pathIntersection(double x, double y, double tolerance) booleanpathIntersects(double x, double y, double tolerance) readOnlySubList(int fromIndex, int toIndex) remove(BezierNode element) removeAt(int index) removeRange(int fromIndex, int toIndex) reverse()Reverses the direction of the path.set(int index, BezierNode element) setWindingRule(int newValue) setWindingRule(javafx.scene.shape.FillRule newValue) intsize()split(double x, double y, double tolerance) Methods inherited from class org.jhotdraw8.icollection.VectorList
contains, copyOf, equals, hashCode, indexOf, iterator, maxSize, of, ofIterator, ofStream, readOnlyReversed, spliterator, toMutable, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jhotdraw8.icollection.immutable.ImmutableCollection
filterMethods inherited from interface org.jhotdraw8.icollection.readonly.ReadOnlyCollection
characteristics, containsAll, isEmpty, stream, toArray, toArrayMethods inherited from interface org.jhotdraw8.icollection.readonly.ReadOnlyList
asList, getFirst, getLast, getLast, indexOf, lastIndexOf, listIterator, listIterator, peekFirst, peekLastMethods inherited from interface org.jhotdraw8.icollection.readonly.ReadOnlySequencedCollection
asCollection
-
Constructor Details
-
BezierPath
-
BezierPath
-
BezierPath
-
BezierPath
-
-
Method Details
-
contains
public boolean contains(double x, double y) -
contains
public boolean contains(double x, double y, double tolerance) -
contains
-
contains
public boolean contains(double x, double y, double w, double h) -
contains
-
getBounds
-
getBounds2D
- Specified by:
getBounds2Din interfaceShape
-
getPathIterator
- Specified by:
getPathIteratorin interfaceShape
-
getPathIterator
- Specified by:
getPathIteratorin interfaceShape
-
intersects
public boolean intersects(double x, double y, double w, double h) - Specified by:
intersectsin interfaceShape
-
intersects
- Specified by:
intersectsin interfaceShape
-
pathIntersects
public boolean pathIntersects(double x, double y, double tolerance) -
pathIntersection
-
split
-
join
-
getOutgoingTangentPoint
Gets the outgoing tangent point for the bezier node at the specified index.- Parameters:
index- point of a bezier node- Returns:
- outgoing tangent point
-
setWindingRule
-
setWindingRule
-
reverse
Reverses the direction of the path.- Specified by:
reversein interfaceImmutableList<BezierNode>- Overrides:
reversein classVectorList<BezierNode>
-
of
-
empty
- Specified by:
emptyin interfaceImmutableCollection<BezierNode>- Specified by:
emptyin interfaceImmutableList<BezierNode>- Specified by:
emptyin interfaceImmutableSequencedCollection<BezierNode>- Overrides:
emptyin classVectorList<BezierNode>
-
newInstance
- Overrides:
newInstancein classVectorList<BezierNode>
-
add
- Specified by:
addin interfaceImmutableCollection<BezierNode>- Specified by:
addin interfaceImmutableList<BezierNode>- Specified by:
addin interfaceImmutableSequencedCollection<BezierNode>- Overrides:
addin classVectorList<BezierNode>
-
add
- Specified by:
addin interfaceImmutableList<BezierNode>- Overrides:
addin classVectorList<BezierNode>
-
addAll
- Specified by:
addAllin interfaceImmutableCollection<BezierNode>- Specified by:
addAllin interfaceImmutableList<BezierNode>- Specified by:
addAllin interfaceImmutableSequencedCollection<BezierNode>- Overrides:
addAllin classVectorList<BezierNode>
-
addFirst
- Specified by:
addFirstin interfaceImmutableList<BezierNode>- Specified by:
addFirstin interfaceImmutableSequencedCollection<BezierNode>- Overrides:
addFirstin classVectorList<BezierNode>
-
addLast
- Specified by:
addLastin interfaceImmutableList<BezierNode>- Specified by:
addLastin interfaceImmutableSequencedCollection<BezierNode>- Overrides:
addLastin classVectorList<BezierNode>
-
addAll
- Specified by:
addAllin interfaceImmutableList<BezierNode>- Overrides:
addAllin classVectorList<BezierNode>
-
remove
- Specified by:
removein interfaceImmutableCollection<BezierNode>- Specified by:
removein interfaceImmutableList<BezierNode>- Specified by:
removein interfaceImmutableSequencedCollection<BezierNode>- Overrides:
removein classVectorList<BezierNode>
-
removeAt
- Specified by:
removeAtin interfaceImmutableList<BezierNode>- Overrides:
removeAtin classVectorList<BezierNode>
-
removeFirst
- Specified by:
removeFirstin interfaceImmutableList<BezierNode>- Specified by:
removeFirstin interfaceImmutableSequencedCollection<BezierNode>- Overrides:
removeFirstin classVectorList<BezierNode>
-
removeLast
- Specified by:
removeLastin interfaceImmutableList<BezierNode>- Specified by:
removeLastin interfaceImmutableSequencedCollection<BezierNode>- Overrides:
removeLastin classVectorList<BezierNode>
-
retainAll
- Specified by:
retainAllin interfaceImmutableCollection<BezierNode>- Specified by:
retainAllin interfaceImmutableList<BezierNode>- Specified by:
retainAllin interfaceImmutableSequencedCollection<BezierNode>- Overrides:
retainAllin classVectorList<BezierNode>
-
removeRange
- Specified by:
removeRangein interfaceImmutableList<BezierNode>- Overrides:
removeRangein classVectorList<BezierNode>
-
removeAll
- Specified by:
removeAllin interfaceImmutableCollection<BezierNode>- Specified by:
removeAllin interfaceImmutableList<BezierNode>- Specified by:
removeAllin interfaceImmutableSequencedCollection<BezierNode>- Overrides:
removeAllin classVectorList<BezierNode>
-
set
- Specified by:
setin interfaceImmutableList<BezierNode>- Overrides:
setin classVectorList<BezierNode>
-
get
- Specified by:
getin interfaceReadOnlyList<BezierNode>- Overrides:
getin classVectorList<BezierNode>
-
getPathMetrics
-
readOnlySubList
- Specified by:
readOnlySubListin interfaceImmutableList<BezierNode>- Specified by:
readOnlySubListin interfaceReadOnlyList<BezierNode>- Overrides:
readOnlySubListin classVectorList<BezierNode>
-
size
public int size()- Specified by:
sizein interfaceReadOnlyCollection<BezierNode>- Overrides:
sizein classVectorList<BezierNode>
-
evalFirst
Evaluates the first point of the bezier path.- Returns:
- the point and derivative of the first point in the path
- Throws:
NoSuchElementException- if the path is empty
-
evalLastInReverse
Evaluates the reverse derivative of the last point.The result is the same as reversing the path, and then evaluating its first point.
- Returns:
- the reverse derivative
- Throws:
NoSuchElementException- if the path is empty
-
getWindingRule
public int getWindingRule()
-