Package pi.graphics.boxes
Class TextBlockBox
java.lang.Object
pi.graphics.boxes.Box
pi.graphics.boxes.LeafBox
pi.graphics.boxes.TextBox
pi.graphics.boxes.TextBlockBox
Ein mehrzeiliger Textblock
- Since:
- 0.41.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
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, 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
-
TextBlockBox
Erzeugt einen mehrzeiligen Textblock.- Parameters:
content- Der Inhalt des Textblocks als Zeichenkette.- Since:
- 0.41.0
-
-
Method Details
-
hAlign
-
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
-
width
-
toString
-