Package pi.graphics.boxes
Class ImageBox
java.lang.Object
pi.graphics.boxes.Box
pi.graphics.boxes.LeafBox
pi.graphics.boxes.ImageBox
-
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.flippedHorizontally(boolean flippedHorizontally) flippedVertically(boolean flippedVertically) height(int height) toString()width(int width) Methods inherited from class pi.graphics.boxes.LeafBox
calculateAnchors, numberOfChildsMethods inherited from class pi.graphics.boxes.Box
anchor, debug, disable, disabled, enable, iterator, measure, measureAnchors, measureDimension, remeasure, render, toggle, toStringFormatter, 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
-
ImageBox
-
ImageBox
-
-
Method Details
-
width
-
height
-
flippedHorizontally
-
flippedHorizontally
-
flippedVertically
-
flippedVertically
-
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
-