Recipe fixes, replaced spaces with tabs

This commit is contained in:
paulevsGitch 2021-12-15 13:08:15 +03:00
parent 5ca6a92dd0
commit d8de624fd1
60 changed files with 1816 additions and 1851 deletions

View file

@ -9,64 +9,64 @@ import java.util.List;
@Environment(EnvType.CLIENT)
public class GridColumn extends GridContainer {
GridColumn(double width) {
super(width);
}
GridColumn(double width) {
super(width);
}
GridColumn(double width, GridLayout.GridValueType widthType) {
super(width, widthType);
}
GridColumn(double width, GridLayout.GridValueType widthType) {
super(width, widthType);
}
public GridRow addRow() {
return addRow(VerticalAlignment.TOP);
}
public GridRow addRow() {
return addRow(VerticalAlignment.TOP);
}
public GridRow addRow(VerticalAlignment align) {
GridRow row = new GridRow(1.0, widthType==GridValueType.INHERIT?GridValueType.INHERIT:GridLayout.GridValueType.PERCENTAGE, align);
this.cells.add(row);
return row;
}
public GridRow addRow(VerticalAlignment align) {
GridRow row = new GridRow(1.0, widthType==GridValueType.INHERIT?GridValueType.INHERIT:GridLayout.GridValueType.PERCENTAGE, align);
this.cells.add(row);
return row;
}
public void addSpacerRow() {
this.addSpacerRow(4);
}
public void addSpacerRow() {
this.addSpacerRow(4);
}
public void addSpacerRow(int height) {
GridCell cell = new GridCell(1.0, height, GridValueType.PERCENTAGE, null, null);
this.cells.add(cell);
}
public void addSpacerRow(int height) {
GridCell cell = new GridCell(1.0, height, GridValueType.PERCENTAGE, null, null);
this.cells.add(cell);
}
@Override
public int calculateWidth(final int parentWidth){
if (widthType == GridValueType.INHERIT) {
return cells.stream()
.filter(row->row.widthType == GridValueType.INHERIT)
.map(row -> row.buildElement(0, 0, 1, 0, 0, null).width)
.reduce(0, (p, c) -> Math.max(p, c));
@Override
public int calculateWidth(final int parentWidth){
if (widthType == GridValueType.INHERIT) {
return cells.stream()
.filter(row->row.widthType == GridValueType.INHERIT)
.map(row -> row.buildElement(0, 0, 1, 0, 0, null).width)
.reduce(0, (p, c) -> Math.max(p, c));
} else {
return super.calculateWidth(parentWidth);
}
}
} else {
return super.calculateWidth(parentWidth);
}
}
@Override
protected GridElement buildElementAt(int left, int inTop, int width, final List<GridElement> collector) {
int height = 0;
int top = inTop;
@Override
protected GridElement buildElementAt(int left, int inTop, int width, final List<GridElement> collector) {
int height = 0;
int top = inTop;
if (widthType == GridValueType.INHERIT) {
if (widthType == GridValueType.INHERIT) {
width = calculateWidth(width);
}
for (GridCellDefinition row : cells) {
GridElement element = row.buildElement(width, 0, 1, left, top, collector);
top += element.height;
height += element.height;
}
for (GridCellDefinition row : cells) {
GridElement element = row.buildElement(width, 0, 1, left, top, collector);
top += element.height;
height += element.height;
}
return new GridElement(left, inTop, width, height);
}
return new GridElement(left, inTop, width, height);
}
}