All Downloads are FREE. Search and download functionalities are using the official Maven repository.

mmb.content.old.SideConfigCtrl Maven / Gradle / Ivy

Go to download

Dependency for the MultiMachineBuilder, a voxel game about building an industrial empire in a finite world. THIS RELEASE IS NOT PLAYABLE. To play the game, donwload from >ITCH.IO LINK HERE< or >GH releases link here<

The newest version!
/**
 * 
 */
package mmb.content.old;

import javax.swing.JPanel;

import mmb.menu.components.BoundCheckBox;

import javax.swing.BoxLayout;

/**
 * Configures sides of given side config. Remember to close, as it holds resources on given side config
 * @author oskar
 */
public class SideConfigCtrl extends JPanel implements AutoCloseable{
	private static final long serialVersionUID = 5825304896794378584L;
	public final SideConfig cfg;
	private final BoundCheckBox cU, cD, cL, cR;
	public SideConfigCtrl(SideConfig cfg) {
		this.cfg = cfg;
		BoxLayout layout = new BoxLayout(this, BoxLayout.Y_AXIS);
		setLayout(layout);
		
		cU = new BoundCheckBox("U");
		cU.setVariable(cfg.U);
		add(cU);
		
		cD = new BoundCheckBox("D");
		cD.setVariable(cfg.D);
		add(cD);
		
		cL = new BoundCheckBox("L");
		cL.setVariable(cfg.L);
		add(cL);
		
		cR = new BoundCheckBox("R");
		cR.setVariable(cfg.R);
		add(cR);
	}

	@Override
	public void close() {
		cU.setVariable(null);
		cD.setVariable(null);
		cL.setVariable(null);
		cR.setVariable(null);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy