Class LayoutPath
java.lang.Object
java.awt.font.LayoutPath
LayoutPath provides a mapping between locations relative to the
baseline and points in user space. Locations consist of an advance
along the baseline, and an offset perpendicular to the baseline at
the advance. Positive values along the perpendicular are in the
direction that is 90 degrees clockwise from the baseline vector.
Locations are represented as a
Point2D, where x is the advance and
y is the offset.- Since:
- 1.6
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidpathToPoint(Point2D location, boolean preceding, Point2D point) Convert a location relative to the path to a point in user coordinates.abstract booleanpointToPath(Point2D point, Point2D location) Convert a point in user space to a location relative to the path.Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.booleanCompares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.protected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.May cause performance issues, deadlocks and hangs.getClass()Answers the unique instance of java.lang.Class which represents the class of the receiver.inthashCode()Answers an integer hash code for the receiver.final voidnotify()Causes one thread which iswaiting on the receiver to be made ready to run.final voidCauses all threads which arewaiting on the receiver to be made ready to run.toString()Answers a string containing a concise, human-readable description of the receiver.final voidwait()Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated bynotifyornotifyAll).final voidwait(long time) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.final voidwait(long time, int frac) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.
-
Constructor Details
-
LayoutPath
protected LayoutPath()Constructor for subclasses to call.
-
-
Method Details
-
pointToPath
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.- Parameters:
point- the point to convert. If it is not the same object as location, point will remain unmodified by this call.location- aPoint2Dto hold the returned location. It can be the same object as point.- Returns:
- true if the point is associated with the portion of the path preceding the location, false if it is associated with the portion following. The default, if the location is not at a break or sharp bend in the path, is to return true.
- Throws:
NullPointerException- if point or location is null- Since:
- 1.6
-
pathToPoint
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.- Parameters:
location- aPoint2Drepresenting 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- aPoint2Dto hold the returned point. It can be the same object as location.- Throws:
NullPointerException- if location or point is null- Since:
- 1.6
-