Package org.jzy3d.plot3d.text.align
Class TextLayout
java.lang.Object
org.jzy3d.plot3d.text.align.TextLayout
- Direct Known Subclasses:
AWTTextLayout
A helper to process text position according to a
Horizontal
, Vertical
, text height and
width.- Author:
- Martin Pernollet
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionalign
(float textWidth, float textHeight, Horizontal horizontal, Vertical vertical, Coord2d offset, Coord3d screen) Compute final text position on screen according to the layout parameters and initial screen position.align
(float textWidth, float textHeight, Horizontal horizontal, Vertical vertical, Coord3d screen) Compute final text position on screen according to the layout parameters and initial screen position.float
computeXAlign
(float textWidth, Horizontal horizontal, Coord3d screenPosition, float x) float
computeYAlign
(float textHeight, Vertical vertical, Coord3d screenPosition, float y)
-
Constructor Details
-
TextLayout
public TextLayout()
-
-
Method Details
-
align
public Coord3d align(float textWidth, float textHeight, Horizontal horizontal, Vertical vertical, Coord2d offset, Coord3d screen) Compute final text position on screen according to the layout parameters and initial screen position.- Parameters:
textWidth
- width of the text in pixeltextHeight
- height of the text font in pixelhorizontal
- horizontal alignmentvertical
- vertical alignmentoffset
- an (x,y) offset to apply to the base position once X and Y alignment are processedscreen
- base 2D position of the text on screen before applying layout (Z dimension is used to indicate how far is the text in the 3D scene, given as a ratio between the near and far clipping plane of the camera)
-
align
public Coord3d align(float textWidth, float textHeight, Horizontal horizontal, Vertical vertical, Coord3d screen) Compute final text position on screen according to the layout parameters and initial screen position.- Parameters:
textWidth
- width of the text in pixeltextHeight
- height of the text font in pixelhorizontal
- horizontal alignmentvertical
- vertical alignmentscreen
- base 2D position of the text on screen before applying layout (Z dimension is used to indicate how far is the text in the 3D scene, given as a ratio between the near and far clipping plane of the camera)
-
computeXAlign
-
computeYAlign
-