Added setters for Position and Size variables to GuiElement interface and implemented them

This commit is contained in:
CrushedPixel
2015-09-05 12:19:24 +02:00
parent a56d800d43
commit 78bb48b62f
10 changed files with 157 additions and 0 deletions

View File

@@ -155,4 +155,16 @@ public class ComposedElement implements GuiElement {
public int height() {
return 0;
}
@Override
public void xPos(int x) {}
@Override
public void yPos(int y) {}
@Override
public void width(int width) {}
@Override
public void height(int height) {}
}

View File

@@ -86,4 +86,24 @@ public abstract class DelegatingElement implements GuiElement {
public int height() {
return delegate().height();
}
@Override
public void xPos(int x) {
delegate().xPos(x);
}
@Override
public void yPos(int y) {
delegate().yPos(y);
}
@Override
public void width(int width) {
delegate().width(width);
}
@Override
public void height(int height) {
delegate().height(height);
}
}

View File

@@ -141,4 +141,24 @@ public class GuiAdvancedButton extends GuiButton implements GuiElement {
public int height() {
return height;
}
@Override
public void xPos(int x) {
xPosition = x;
}
@Override
public void yPos(int y) {
yPosition = y;
}
@Override
public void width(int width) {
this.width = width;
}
@Override
public void height(int height) {
this.height = height;
}
}

View File

@@ -109,4 +109,24 @@ public class GuiAdvancedCheckBox extends GuiCheckBox implements GuiElement {
public int height() {
return height;
}
@Override
public void xPos(int x) {
xPosition = x;
}
@Override
public void yPos(int y) {
yPosition = y;
}
@Override
public void width(int width) {
this.width = width;
}
@Override
public void height(int height) {
this.height = height;
}
}

View File

@@ -138,4 +138,24 @@ public class GuiAdvancedTextField extends GuiTextField implements GuiElement, Gu
public int height() {
return height;
}
@Override
public void xPos(int x) {
xPosition = x;
}
@Override
public void yPos(int y) {
yPosition = y;
}
@Override
public void width(int width) {
this.width = width;
}
@Override
public void height(int height) {
this.height = height;
}
}

View File

@@ -17,6 +17,11 @@ public interface GuiElement {
int width();
int height();
void xPos(int x);
void yPos(int y);
void width(int width);
void height(int height);
boolean mouseClick(Minecraft mc, int mouseX, int mouseY, int button);
void mouseDrag(Minecraft mc, int mouseX, int mouseY, int button);
void mouseRelease(Minecraft mc, int mouseX, int mouseY, int button);

View File

@@ -206,4 +206,16 @@ public class GuiScrollbar extends Gui implements GuiElement {
public int height() {
return SLIDER_HEIGHT;
}
@Override
public void xPos(int x) {}
@Override
public void yPos(int y) {}
@Override
public void width(int width) {}
@Override
public void height(int height) {}
}

View File

@@ -112,4 +112,20 @@ public class GuiString extends Gui implements GuiElement {
public int height() {
return Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT;
}
@Override
public void xPos(int x) {
positionX = x;
}
@Override
public void yPos(int y) {
positionY = y;
}
@Override
public void width(int width) {}
@Override
public void height(int height) {}
}

View File

@@ -660,4 +660,24 @@ public class GuiTextArea extends Gui implements GuiElement, GuiOutsideClickableE
public int height() {
return height;
}
@Override
public void xPos(int x) {
positionX = x;
}
@Override
public void yPos(int y) {
positionY = y;
}
@Override
public void width(int width) {
this.width = width;
}
@Override
public void height(int height) {
this.height = height;
}
}

View File

@@ -359,4 +359,16 @@ public class GuiTimeline extends Gui implements GuiElement {
public int height() {
return height;
}
@Override
public void xPos(int x) {}
@Override
public void yPos(int y) {}
@Override
public void width(int width) {}
@Override
public void height(int height) {}
}