public abstract class Layout extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Layout.Weighted |
Constructor and Description |
---|
Layout() |
Modifier and Type | Method and Description |
---|---|
(package private) abstract int[] |
compute(boolean spaced,
int totalLength,
int[] actualLengths,
int[] minLengths)
Computes the list of lengths for the specifid list of cells with the following constraints:
the sum of the returned array elements must be equals to the
totalLength argument
a cell length should never be lesser than the provided minimum length
The returned array is the list of lengths from left to right, the array size may be less than the
number of cells (i.e the size of the actualLengths and minLengths arguments). |
static Layout |
flow() |
static Layout |
weighted(int... weights) |
public Layout()
public static Layout weighted(int... weights) throws NullPointerException, IllegalArgumentException
abstract int[] compute(boolean spaced, int totalLength, int[] actualLengths, int[] minLengths)
totalLength
argumentactualLengths
and minLengths
arguments). Missing
cells are just be discarded and not part of the resulting layout. Array should contain only positive values,
any zero length cell should be discarded. When cells must be discarded it must begin with the tail of the
list, i.e it is not allowed to discard a cell that does not have a successor.spaced
- true if the cells are separated by one chartotalLength
- the total length of the lineactualLengths
- the actual length : an estimation of what cell's desired lengthminLengths
- the minmum length : the length under which a cell cannot be renderedCopyright © 2015 eXo Platform SAS. All Rights Reserved.