Class ImageBox

All Implemented Interfaces:
Iterable<Box>

public class ImageBox extends LeafBox
  • Constructor Details

  • Method Details

    • width

      public ImageBox width(int width)
      Overrides:
      width in class Box
    • height

      public ImageBox height(int height)
      Overrides:
      height in class Box
    • flippedHorizontally

      public ImageBox flippedHorizontally(boolean flippedHorizontally)
    • flippedHorizontally

      public ImageBox flippedHorizontally()
    • flippedVertically

      public ImageBox flippedVertically(boolean flippedVertically)
    • flippedVertically

      public ImageBox flippedVertically()
    • calculateDimension

      protected void calculateDimension()
      Description copied from class: Box
      Berechnet 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:
      calculateDimension in class Box
    • toString

      public String toString()
      Overrides:
      toString in class Object