@Override public void draw(Graphics graphics) { background.ifPresent(graphics::fillBackground); graphics.drawBorder(border); super.draw(graphics.restrict(padding.include(border).apply(graphics.getArea().getDimension()))); }
@Override public void setArea(Rectangle area) { super.setArea(padding.include(border).apply(area)); }
public Panel( final Layout<Widget> layout, final Occupation preferredWith, final Occupation preferredHeight) { this(layout, preferredWith, preferredHeight, Border.no(), Padding.no(), Optional.empty()); }