public class MenuLineLayoutOrder extends Object implements Iterable<MenuLineLayoutOrder.Item>
LayoutBlock
s should be given by a MenuLineLayout
.Modifier and Type | Class and Description |
---|---|
static class |
MenuLineLayoutOrder.Item
The various items that are used by the
MenuLineLayout . |
Constructor and Description |
---|
MenuLineLayoutOrder(MenuLineLayoutOrder.Item first,
MenuLineLayoutOrder.Item second,
MenuLineLayoutOrder.Item third)
Creates a new order.
|
Modifier and Type | Method and Description |
---|---|
float |
getAlignment(MenuLineLayoutOrder.Item item)
Gets the alignment of
item . |
float |
getFill(MenuLineLayoutOrder.Item item)
Gets the fill ratio of
item . |
MenuLineLayoutOrder.Item |
getFirst()
Gets the first item to show.
|
MenuLineLayoutOrder.Item |
getSecond()
Gets the second item to show.
|
MenuLineLayoutOrder.Item |
getThird()
Gets the third item to show.
|
float |
getWeight(MenuLineLayoutOrder.Item item)
Gets the weight of
item . |
Iterator<MenuLineLayoutOrder.Item> |
iterator() |
void |
setAlignment(MenuLineLayoutOrder.Item item,
float alignment)
Sets the alignment of
item . |
void |
setConstraints(MenuLineLayoutOrder.Item item,
float weight,
float alignment,
float fill)
A shortcut to call
setAlignment(Item, float) , setWeight(Item, float) and
setFill(Item, float) in one invocation. |
void |
setFill(MenuLineLayoutOrder.Item item,
float fill)
Sets the fill ratio of
item . |
void |
setWeight(MenuLineLayoutOrder.Item item,
float weight)
Sets the weight of
item . |
public MenuLineLayoutOrder(MenuLineLayoutOrder.Item first, MenuLineLayoutOrder.Item second, MenuLineLayoutOrder.Item third)
null
and no two arguments must be the same.first
- the first item to showsecond
- the second item to showthird
- the last item to showpublic Iterator<MenuLineLayoutOrder.Item> iterator()
iterator
in interface Iterable<MenuLineLayoutOrder.Item>
public MenuLineLayoutOrder.Item getFirst()
null
and not the same as the other two itemspublic MenuLineLayoutOrder.Item getSecond()
null
and not the same as the other two itemspublic MenuLineLayoutOrder.Item getThird()
null
and not the same as the other two itemspublic void setConstraints(MenuLineLayoutOrder.Item item, float weight, float alignment, float fill)
setAlignment(Item, float)
, setWeight(Item, float)
and
setFill(Item, float)
in one invocation.item
- the item whose constraints are setweight
- the new weight, see setWeight(Item, float)
alignment
- the new alignment, see setAlignment(Item, float)
fill
- the new fill ratio, see setFill(Item, float)
public void setAlignment(MenuLineLayoutOrder.Item item, float alignment)
item
. The alignment tells how item
reacts if there
is free space. A value of 0 means that the item clings to the left wall, a value of 1 means that the
item clings to the right wall.item
- the item whose alignment is set, not null
alignment
- the new alignment, between 0 and 1public float getAlignment(MenuLineLayoutOrder.Item item)
item
.item
- the item to searchsetAlignment(Item, float)
public void setWeight(MenuLineLayoutOrder.Item item, float weight)
item
. The weight tells how free space should be distributed, as larger the number
as more space is assigned to item
.item
- the item whose wheight is set, not null
weight
- the new weight, at least 0public float getWeight(MenuLineLayoutOrder.Item item)
item
.item
- the item to search, not null
setWeight(Item, float)
public void setFill(MenuLineLayoutOrder.Item item, float fill)
item
. The fill parameter tells how much free space is used up by item
.
A value of 0 indicates that item
does not use any free space, a value of 1 indicates that item
fills up all free space.item
- the item whose fill ratio is set, not null
fill
- the new fill ratio, between 0 and 1public float getFill(MenuLineLayoutOrder.Item item)
item
.item
- the item to searchsetFill(Item, float)