Class TextBoxLayout

java.lang.Object
com.codename1.presentation.TextBoxLayout

public final class TextBoxLayout extends Object

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.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    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.
    final float
    Where the layout's top is in the box, in box points: the anchor's offset.
    final float
    The factor the text is drawn at, 1 unless the frame shrinks text to fit.
    final float
    The height the text uses in box points, insets included.
  • Method Summary

    Modifier and Type
    Method
    Description
    of(TextFrame frame, float width, float height, Measurer measurer)
    Lays a frame out in a box.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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: the text

      • width: the box width in points

      • height: the box height in points

      • measurer: measures text; the painter must use the same kind

      Returns

      the layout