Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.

public final class TextBoxLayout

  1. Object
  2. TextBoxLayout

The text of a shape laid out in its box: the word processing layout, where its first line starts, and how much it was shrunk to fit.

SlideRenderer paints from this, and a SlideView editing the text in place uses it to put its editor exactly over the painted words.

Fields

public final DocumentLayout layoutThe layout, in points, of a page as wide as the box less nothing (the insets are the page margins); multiply by shrink to get box points.
public final float offsetYWhere the layout’s top is in the box, in box points: the anchor’s offset.
public final float shrinkThe factor the text is drawn at, 1 unless the frame shrinks text to fit.
public final float usedHeightThe height the text uses in box points, insets included.

Methods

public static TextBoxLayout of(TextFrame frame, float width, float height, Measurer measurer)Lays a frame out in a box.

Inherited methods

Field details

layout

public final DocumentLayout layout
The layout, in points, of a page as wide as the box less nothing (the insets are the page margins); multiply by shrink to get box points.

offsetY

public final float offsetY
Where the layout’s top is in the box, in box points: the anchor’s offset.

shrink

public final float shrink
The factor the text is drawn at, 1 unless the frame shrinks text to fit.

usedHeight

public final float usedHeight
The height the text uses in box points, insets included.

Method details

of

public static TextBoxLayout of(TextFrame frame, float width, float height, Measurer measurer)
Lays a frame out in a box.

Parameters

frame TextFrame
the text
width float
the box width in points
height float
the box height in points
measurer Measurer
measures text; the painter must use the same kind

Returns

the layout