java.lang.Object | |||
↳ | java.awt.font.LayoutPath | ||
↳ | sun.font.LayoutPathImpl | ||
↳ | sun.font.LayoutPathImpl.SegmentPath |
Represents a path built from segments. Each segment is represented by a triple: x, y, and cumulative advance. These represent the end point of the segment. The start point of the first segment is represented by the triple at position 0. The path might have breaks in it, e.g. it is not connected. These will be represented by pairs of triplets that share the same advance. The path might be extended, pinned, or closed. If extended, the initial and final segments are considered to extend 'indefinitely' past the bounds of the advance. If pinned, they end at the bounds of the advance. If closed, advances before the start or after the end 'wrap around' the path. The start of the path is the initial triple. This provides the nominal advance at the given x, y position (typically zero). The end of the path is the final triple. This provides the advance at the end, the total length of the path is thus the ending advance minus the starting advance. Note: We might want to cache more auxiliary data than the advance, but this seems adequate for now.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Convert a location relative to the path to a point in user
coordinates.
| |||||||||||
Convert a point in user space to a location relative to the
path.
| |||||||||||
Returns a string representation of the object.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
Convert a location relative to the path to a point in user coordinates. The path might bend abruptly or be disjoint at the location's advance. If this is the case, the value of 'preceding' is used to disambiguate the portion of the path whose location and slope is to be used to interpret the offset.
location | a Point2D representing the advance (in x) and
offset (in y) of a location relative to the path. If location
is not the same object as point, location will remain
unmodified by this call. |
---|---|
preceding | if true, the portion preceding the advance should be used, if false the portion after should be used. This has no effect if the path does not break or bend sharply at the advance. |
point | a Point2D to hold the returned point. It can be
the same object as location. |
Convert a point in user space to a location relative to the path. The location is chosen so as to minimize the distance from the point to the path (e.g., the magnitude of the offset will be smallest). If there is more than one such location, the location with the smallest advance is chosen.
pt | the point to convert. If it is not the same object as location, point will remain unmodified by this call. |
---|---|
result | a Point2D to hold the returned location.
It can be the same object as point. |
Returns a string representation of the object. In general, the
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())