aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroupAligned.java
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-10-16 15:50:41 -0400
committerGitHub <noreply@github.com>2021-10-16 15:50:41 -0400
commit7c00af18febf6c0b833c7633b4fb60a9a1bb93af (patch)
treef02de145362d6a1399651ade4a130d565d7f0ba3 /src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroupAligned.java
parentb11742988dec635b5c5da7c2363803cbfafb37b1 (diff)
downloadnotenoughupdates-7c00af18febf6c0b833c7633b4fb60a9a1bb93af.tar.gz
notenoughupdates-7c00af18febf6c0b833c7633b4fb60a9a1bb93af.tar.bz2
notenoughupdates-7c00af18febf6c0b833c7633b4fb60a9a1bb93af.zip
Code Clean Up (#2)
* intellij code clean up * optimize imports * format * intellij suggestions * fix empty catch issues
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroupAligned.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroupAligned.java24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroupAligned.java b/src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroupAligned.java
index 77a28fd5..42e18b82 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroupAligned.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroupAligned.java
@@ -8,8 +8,8 @@ import java.util.List;
public abstract class MBGuiGroupAligned extends MBGuiGroup {
//Serialized
- private List<MBGuiElement> children;
- private boolean vertical;
+ private final List<MBGuiElement> children;
+ private final boolean vertical;
public MBGuiGroupAligned(List<MBGuiElement> children, boolean vertical) {
this.children = children;
@@ -24,39 +24,39 @@ public abstract class MBGuiGroupAligned extends MBGuiGroup {
}
public void recalculate() {
- for(MBGuiElement child : children) {
+ for (MBGuiElement child : children) {
child.recalculate();
}
- if(vertical) {
+ if (vertical) {
height = 0;
- for(int i=0; i<children.size(); i++) {
+ for (int i = 0; i < children.size(); i++) {
MBGuiElement child = children.get(i);
childrenPosition.put(child, new Vector2f(0, height));
height += child.getHeight();
- if(i != children.size()-1) height += getPadding();
+ if (i != children.size() - 1) height += getPadding();
}
width = 0;
- for(MBGuiElement child : children) {
+ for (MBGuiElement child : children) {
int childWidth = child.getWidth();
- if(childWidth > width) {
+ if (childWidth > width) {
width = childWidth;
}
}
} else {
width = 0;
- for(int i=0; i<children.size(); i++) {
+ for (int i = 0; i < children.size(); i++) {
MBGuiElement child = children.get(i);
childrenPosition.put(child, new Vector2f(width, 0));
width += child.getWidth();
- if(i != children.size()-1) width += getPadding();
+ if (i != children.size() - 1) width += getPadding();
}
height = 0;
- for(MBGuiElement child : children) {
+ for (MBGuiElement child : children) {
int childHeight = child.getHeight();
- if(childHeight > height) {
+ if (childHeight > height) {
height = childHeight;
}
}