Versatile Java game engine with pluggable backends (this was used in Rogue, I think)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
635 B

10 years ago
package mightypork.gamecore.gui.components.layout;
import mightypork.gamecore.gui.components.Component;
import mightypork.utils.math.constraints.rect.RectBound;
public class ColumnLayout extends GridLayout {
10 years ago
private int col = 0;
public ColumnLayout(int rows)
{
10 years ago
this(null, rows);
}
public ColumnLayout(RectBound context, int cols)
{
10 years ago
super(context, 1, cols);
}
10 years ago
public void add(final Component elem)
{
add(elem, 1);
}
10 years ago
public void add(final Component elem, int colSpan)
{
if (elem == null) return;
10 years ago
put(elem, 0, col, 1, colSpan);
col += colSpan;
}
10 years ago
public void skip(int cols)
{
col += cols;
}
}