Java Reference
In-Depth Information
Figure 5.30
QuadCurve
Paths let you draw arbitrarily complex shapes. There are two path shapes:
Path
and
SVGPath
. Paths take a set of elements that draw the outline of a shape. The
Path
may be either open or closed. The class
javafx.scene.shape.Path
takes a
set of
PathElements
, whereas
SVGPath
is built using a standard SVG Path encoded
string as defined at
http://www.w3.org/TR/SVG/paths.html.
The following exam-
ple shows a triangular shape with a circular chunk taken out of it (see Figure 5.31).
Path {
translateX: 50
translateY: 50
fill: Color.RED
elements: [
MoveTo { x: 0 y: 0},
LineTo { x: 100 y: 0 },
ArcTo { x: 200 y: 0 radiusX: 25 radiusY: 20 },
LineTo { x: 300 y: 0 },
LineTo { x: 150 y: 100 },
ClosePath{}
]
}
Figure 5.31
Path Example
Search WWH ::
Custom Search