- java.lang.Object
-
- java.awt.font.LayoutPath
-
public abstract class LayoutPath extends Object
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 aPoint2D
, where x is the advance and y is the offset.- Since:
- 1.6
-
-
Constructor Summary
Constructors Constructor and Description LayoutPath()
-
Method Summary
Methods Modifier and Type Method and Description abstract void
pathToPoint(Point2D location, boolean preceding, Point2D point)
Convert a location relative to the path to a point in user coordinates.abstract boolean
pointToPath(Point2D point, Point2D location)
Convert a point in user space to a location relative to the path.
-
-
-
Method Detail
-
pointToPath
public abstract boolean pointToPath(Point2D point, Point2D 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.- Parameters:
point
- the point to convert. If it is not the same object as location, point will remain unmodified by this call.location
- aPoint2D
to 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
public abstract void pathToPoint(Point2D location, boolean preceding, Point2D point)
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
- aPoint2D
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
- aPoint2D
to hold the returned point. It can be the same object as location.- Throws:
NullPointerException
- if location or point is null- Since:
- 1.6
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
15/11/2024 08:42:46 Cette version de la page est en cache (à la date du 15/11/2024 08:42:46) afin d'accélérer le traitement. Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la dernère version de la page.Document créé le 11/06/2005, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-java/awt/font/layoutpath.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.