Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public final class LayoutItem
- Object
- LayoutItem
One thing drawn on a laid out page: a piece of text, a filled or stroked rectangle, a line,
a picture or the box of an embedded component. Coordinates are in points from the page’s top
left corner.
Fields
public static final int TEXT = 0 | A piece of text: text drawn in style on baseline. |
public static final int FILL = 1 | A filled rectangle in color. |
public static final int LINE = 2 | A straight line from (x, y) to (x + width, y + height) in color. |
public static final int PICTURE = 3 | A picture filling the item’s box. |
public static final int COMPONENT = 4 | The box an embedded component occupies. |
public final int kind | What this item is: TEXT, FILL, LINE, PICTURE or COMPONENT. |
public final float x | The left edge. |
public final float y | The top edge; for text, the top of its line. |
public final float width | The width. |
public final float height | The height; for text, the height of its line. |
public final float baseline | For text, the y of the baseline it is drawn on. |
public final String text | For text, what is drawn; may be empty. |
public final TextStyle style | For text, its style; otherwise null. |
public final String paragraphId | For text, the id of the paragraph it belongs to, or null for generated text such as a list marker. |
public final int start | For text, the offset of its first character in the paragraph’s text. |
public final Picture picture | For a picture, the picture. |
public final EmbeddedComponent component | For a component, the component. |
public final int color | For a fill or a line, its RGB color. |
Inherited methods
Field details
TEXT
public static final int TEXT = 0A piece of text:
text drawn in style on baseline.FILL
public static final int FILL = 1A filled rectangle in
color.LINE
public static final int LINE = 2A straight line from (
x, y) to (x + width, y + height) in color.PICTURE
public static final int PICTURE = 3A picture filling the item’s box.
COMPONENT
public static final int COMPONENT = 4The box an embedded component occupies.
kind
public final int kindWhat this item is:
TEXT, FILL, LINE, PICTURE or COMPONENT.x
public final float xThe left edge.
y
public final float yThe top edge; for text, the top of its line.
width
public final float widthThe width.
height
public final float heightThe height; for text, the height of its line.
baseline
public final float baselineFor text, the y of the baseline it is drawn on.
text
public final String textFor text, what is drawn; may be empty.
style
public final TextStyle styleFor text, its style; otherwise null.
paragraphId
public final String paragraphIdFor text, the id of the paragraph it belongs to, or null for generated text such as a
list marker.
start
public final int startFor text, the offset of its first character in the paragraph’s text.
picture
public final Picture pictureFor a picture, the picture.
component
public final EmbeddedComponent componentFor a component, the component.
color
public final int colorFor a fill or a line, its RGB color.