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.
42 lines
753 B
42 lines
753 B
package mightypork.gamecore.gui.renderers;
|
|
|
|
|
|
import static mightypork.utils.math.constraints.ConstraintFactory.*;
|
|
import mightypork.gamecore.AppAccess;
|
|
import mightypork.utils.math.constraints.RectConstraint;
|
|
|
|
|
|
public class ColumnHolder extends ElementHolder {
|
|
|
|
private final int cols;
|
|
private int col = 0;
|
|
|
|
|
|
public ColumnHolder(AppAccess app, RectConstraint context, int rows) {
|
|
super(app, context);
|
|
this.cols = rows;
|
|
}
|
|
|
|
|
|
public ColumnHolder(AppAccess app, int rows) {
|
|
super(app);
|
|
this.cols = rows;
|
|
}
|
|
|
|
|
|
/**
|
|
* Add a row to the holder.
|
|
*
|
|
* @param elem
|
|
*/
|
|
@Override
|
|
public void add(final PluggableRenderable elem)
|
|
{
|
|
if (elem == null) return;
|
|
|
|
elem.setContext(c_column(this, cols, col++));
|
|
|
|
attach(elem);
|
|
}
|
|
|
|
}
|
|
|