Newer
Older
SimpleUI / src / Widget.java
import java.util.*;

public class Widget {
	private int height;
	private boolean visible;
	private int y;
	private String text;
	private int x;
	private CurScreen curScreen;
	private int state;
	private CurScreen curScreen;
	private Widget widget;
	private ScreenTemplates screenTemplates;
	private Widget widget;
	private int width;
	public Map<String, Object> getValue() {
		Map temp_nil0 = new HashMap<>();
		temp_nil0.put("x",this.getX());
		temp_nil0.put("y",this.getY());
		temp_nil0.put("visible",this.getVisible());
		temp_nil0.put("height",this.getHeight());
		temp_nil0.put("width",this.getWidth());
		temp_nil0.put("text",this.getText());
		temp_nil0.put("state",this.getState());
		return temp_nil0;
	}
	public int getHeight() {
		return this.height;
	}
	public boolean getVisible() {
		return this.visible;
	}
	public int getY() {
		return this.y;
	}
	public void changeY(String wid, int y) {
		this.y = y;
	}
	public String getText() {
		return this.text;
	}
	public void textEvent(String wid, String nextText) {
		this.text = nextText;
	}
	public int getX() {
		return this.x;
	}
	public void changeX(String wid, int x) {
		this.x = x;
	}
	public void updateStateFromState(String self, String self2, String wid, int state, String curScreen) {
		this.state = state;
		this.state = state;
		this.curScreen.updateFromState(scId, wid, this.state);
		this.curScreen.updateFromState(scId, wid, this.state);
	}
	public int getState() {
		return this.state;
	}
	public void updateStateFromState(String self, String self2, String wid, int state, String curScreen) {
		this.state = state;
		this.state = state;
		this.curScreen.updateFromState(scId, wid, this.state);
		this.curScreen.updateFromState(scId, wid, this.state);
	}
	public void mouseEvent(String wid, int nextState) {
		this.state = nextState;
		String curScreen = this.curScreen.getValue();
		this.widget = screenTemplates.getScreenTemplate(curScreen.getValue()).getWidgets().getWidget(wid);
		this.widget.updateStateFromState(wid, wid, this.state, curScreen);
		String curScreen = this.curScreen.getValue();
		this.widget = screenTemplates.getScreenTemplate(curScreen.getValue()).getWidgets().getWidget(wid);
		this.widget.updateStateFromState(wid, wid, this.state, curScreen);
	}
	public int getWidth() {
		return this.width;
	}
	public Widget(int state, CurScreen curScreen) {
		this.state = state;
		this.curScreen = curScreen;
	}
	public Widget(boolean visible, ScreenTemplates screenTemplates, int x, int width, int y, String text, int height) {
		this.visible = visible;
		this.screenTemplates = screenTemplates;
		this.x = x;
		this.width = width;
		this.y = y;
		this.text = text;
		this.height = height;
	}
}