java.lang.Object | |
↳ | sun.font.LayoutPathImpl.SegmentPathBuilder |
Use to build a SegmentPath. This takes the data and preanalyzes it for information that the SegmentPath needs, then constructs a SegmentPath from that. Mainly, this lets SegmentPath cache the lengths along the path to each line segment, and so avoid calculating them over and over.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Construct a SegmentPathBuilder.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Automatically build from a list of points represented by pairs of
doubles.
| |||||||||||
Complete building a SegmentPath.
| |||||||||||
Connect to a new point.
| |||||||||||
Move to a new point.
| |||||||||||
Reset the builder for a new path.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Construct a SegmentPathBuilder.
Automatically build from a list of points represented by pairs of doubles. Initial advance is zero.
Complete building a SegmentPath. Once this is called, the builder is restored to its initial state and information about the previous path is released. The end type indicates whether to treat the path as closed, extended, or pinned.
Connect to a new point. If there is no data, the previous point is presumed to be 0, 0. This point is checked against the previous point, and if different, this point is added to the path and the advance extended. If this point is the same as the previous point, the path remains unchanged.
Move to a new point. If there is no data, this will become the first point. If there is data, and the previous call was a lineTo, this point is checked against the previous point, and if different, this starts a new segment at the same advance as the end of the last segment. If there is data, and the previous call was a moveTo, this replaces the point used for that previous call. Calling this is optional, lineTo will suffice and the initial point will be set to 0, 0.
Reset the builder for a new path. Datalen is a hint of how many points will be in the path, and the working buffer will be sized to accomodate at least this number of points. If datalen is zero, the working buffer is freed (it will be allocated on first use).