Package pi.graphics.boxes
Class TextLineBox
java.lang.Object
pi.graphics.boxes.Box
pi.graphics.boxes.LeafBox
pi.graphics.boxes.TextBox
pi.graphics.boxes.TextLineBox
Eine einzeilige Textbox.
- Since:
- 0.38.0
- Author:
- Josef Friedrich
-
Field Summary
Fields inherited from class pi.graphics.boxes.Box
childs, definedHeight, definedWidth, disabled, height, measureDimensionTwice, parent, supportsDefinedDimension, width, x, y -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidBerechnet rekursiv die Abmessung (die Höhe und Breite) der eigenen Box.toString()Methods inherited from class pi.graphics.boxes.TextBox
color, color, content, font, fontSize, fontStyle, fontStyle, toStringFormatterMethods inherited from class pi.graphics.boxes.LeafBox
calculateAnchors, numberOfChildsMethods inherited from class pi.graphics.boxes.Box
anchor, debug, disable, disabled, enable, height, iterator, measure, measureAnchors, measureDimension, remeasure, render, toggle, width, x, yMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
TextLineBox
Erzeugt eine Textbox.- Parameters:
content- Der Inhalt der Textbox als Zeichenkette.- Since:
- 0.39.0
-
-
Method Details
-
calculateDimension
protected void calculateDimension()Description copied from class:BoxBerechnet rekursiv die Abmessung (die Höhe und Breite) der eigenen Box.Single-Child-Code-Beispiel
protected void calculateDimension() { width = child.width + 2 * margin; height = child.height + 2 * margin; }Multiple-Child-Code-Beispiel
protected void calculateDimension() { int maxWidth = 0; for (Box child : childs) { if (child.width > maxWidth) { maxWidth = child.width; } height += child.height; } width = maxWidth; }- Specified by:
calculateDimensionin classBox
-
toString
-