use of org.terasology.nui.layouts.RowLayout in project Terasology by MovingBlocks.
the class RowLayoutTest method setup.
@BeforeEach
public void setup() {
rowLayout = new RowLayout();
itemAt1x1 = mock(UIWidget.class);
itemAt1x2 = mock(UIWidget.class);
itemAt1x3 = mock(UIWidget.class);
canvas = mock(Canvas.class);
// +-----------------------------------+ +---+ +-------+
// | | |1x2| | |
// | 1x1 | +---+ | |
// | | | 1x3 |
// +-----------------------------------+ | |
// | |
// +-------+
when(canvas.calculateRestrictedSize(eq(itemAt1x1), any(Vector2i.class))).thenReturn(new Vector2i(50, 10));
when(canvas.calculateRestrictedSize(eq(itemAt1x2), any(Vector2i.class))).thenReturn(new Vector2i(5, 5));
when(canvas.calculateRestrictedSize(eq(itemAt1x3), any(Vector2i.class))).thenReturn(new Vector2i(10, 15));
Vector2i availableSize = new Vector2i(CANVAS_WIDTH, CANVAS_HEIGHT);
when(canvas.size()).thenReturn(availableSize);
rowLayout.addWidget(itemAt1x1, null);
rowLayout.addWidget(itemAt1x2, null);
rowLayout.addWidget(itemAt1x3, null);
}
Aggregations