de.lessvoid.nifty.layout
Class LayoutPart

java.lang.Object
  extended by de.lessvoid.nifty.layout.LayoutPart

public class LayoutPart
extends Object

LayoutPart is a composition of Box and BoxConstraints.

Author:
void

Constructor Summary
LayoutPart()
          Create a new instance.
LayoutPart(Box newBox, BoxConstraints newBoxConstraints)
          Create a new LayoutPart instance.
LayoutPart(LayoutPart src)
          copy constructor.
 
Method Summary
 Box getBox()
          Get the box of this LayoutPart.
 BoxConstraints getBoxConstraints()
          Get the box constraints for this LayoutPart.
 SizeValue getMaxHeight(List<LayoutPart> children)
          Calculates the maximum height of the given child elements.
 SizeValue getMaxWidth(List<LayoutPart> children)
          Calculates the maximum width of the given child elements.
 SizeValue getSumHeight(List<LayoutPart> children)
          Calculates the sum of the height of all children.
 SizeValue getSumWidth(List<LayoutPart> children)
          Calculates the sum of the width of all children.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LayoutPart

public LayoutPart()
Create a new instance.


LayoutPart

public LayoutPart(Box newBox,
                  BoxConstraints newBoxConstraints)
Create a new LayoutPart instance.

Parameters:
newBox - the new box
newBoxConstraints - the new box constraints

LayoutPart

public LayoutPart(LayoutPart src)
copy constructor.

Parameters:
src - source
Method Detail

getBox

public final Box getBox()
Get the box of this LayoutPart.

Returns:
the box

getBoxConstraints

public final BoxConstraints getBoxConstraints()
Get the box constraints for this LayoutPart.

Returns:
the box Constraints

toString

public String toString()
Overrides:
toString in class Object

getMaxWidth

public SizeValue getMaxWidth(List<LayoutPart> children)
Calculates the maximum width of the given child elements. This takes padding of this LayoutPart as well as the margin values of the child elements into account.

Parameters:
children - List to calculate max width
Returns:
max width

getMaxHeight

public SizeValue getMaxHeight(List<LayoutPart> children)
Calculates the maximum height of the given child elements. This takes padding of this LayoutPart as well as the margin values of the child elements into account.

Parameters:
children - List to calculate max height
Returns:
max height

getSumWidth

public SizeValue getSumWidth(List<LayoutPart> children)
Calculates the sum of the width of all children. Taking padding of this and margin of child elements into account.

Parameters:
children - List to calculate width sum
Returns:
width sum

getSumHeight

public SizeValue getSumHeight(List<LayoutPart> children)
Calculates the sum of the height of all children. Taking padding of this and margin of child elements into account.

Parameters:
children - List to calculate height sum
Returns:
width sum


Copyright © 2012. All Rights Reserved.