org.umber.crucible.old.layout
Class LayoutPadding

java.lang.Object
  extended byorg.umber.crucible.old.layout.LayoutArea
      extended byorg.umber.crucible.old.layout.LayoutPadding

public class LayoutPadding
extends LayoutArea

A block of whitespace used to create flexible padding between other areas. Layout areas must always be connected edge to edge, so padding is the only way to put non-Insert spacing between areas.

Author:
jsheets

Constructor Summary
LayoutPadding(AreaStyle style)
          Creates a new instance of LayoutPadding with the given AreaStyle.
 
Method Summary
static LayoutPadding createPadding(int width, int height)
          Creates a new instance of LayoutPadding with the given preferred size.
static LayoutPadding createPadding(int width, int height, int smallestWidth, int smallestHeight)
          Creates a new instance of LayoutPadding with the given preferred size.
 boolean isRenderable()
          Determines if this area has renderable content.
 java.lang.String toString()
          Converts the area object into String form.
 
Methods inherited from class org.umber.crucible.old.layout.LayoutArea
addChildren, addChildren, canBreakAt, getChildren, getChildren, getExtents, getHeight, getHint, getRenderableExtents, getStyle, getWidth, getX, getY, isBreakable, setChildren, setChildren, setExtents, setHeight, setHint, setWidth, setX, setY
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LayoutPadding

public LayoutPadding(AreaStyle style)
Creates a new instance of LayoutPadding with the given AreaStyle.

Parameters:
style - the style constraints for the area
Method Detail

createPadding

public static LayoutPadding createPadding(int width,
                                          int height)
Creates a new instance of LayoutPadding with the given preferred size. The padding can still shrink to a 1 x 1 square, and expand to infinite size if the layout engine needs it. Padding is atomic.

Parameters:
width - the preferred width
height - the preferred height
Returns:
a newly created padding area

createPadding

public static LayoutPadding createPadding(int width,
                                          int height,
                                          int smallestWidth,
                                          int smallestHeight)
Creates a new instance of LayoutPadding with the given preferred size. The padding also takes on the given smallest constraints. The largest constraints are unbounded. Padding is atomic.

Parameters:
width - the preferred width
height - the preferred height
smallestWidth - the smallest possible width
smallestHeight - the smallest possible height
Returns:
a newly created padding area

isRenderable

public boolean isRenderable()
Determines if this area has renderable content. Layout engines can use this to optimize area traversals. Areas which are not renderable should not expect to pass through to the Renderer. This implementation always returns false, since padding areas should never be passed to the renderer.

Overrides:
isRenderable in class LayoutArea
Returns:
true if this area has visible content

toString

public java.lang.String toString()
Converts the area object into String form.

Overrides:
toString in class LayoutArea
Returns:
a String representation of this object