Package org.jzy3d.plot3d.text.align
Class TextLayout
- java.lang.Object
-
- org.jzy3d.plot3d.text.align.TextLayout
-
- Direct Known Subclasses:
AWTTextLayout
public class TextLayout extends Object
A helper to process text position according to aHorizontal
,Vertical
, text height and width.- Author:
- Martin Pernollet
-
-
Constructor Summary
Constructors Constructor Description TextLayout()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.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.float
computeXAlign(float textWidth, Horizontal horizontal, Coord3d screenPosition, float x)
float
computeYAlign(float textHeight, Vertical vertical, Coord3d screenPosition, float y)
-
-
-
Method Detail
-
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
public float computeXAlign(float textWidth, Horizontal horizontal, Coord3d screenPosition, float x)
-
-