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

mmb.engine.window.MMBFrame 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<

There is a newer version: 0.6
Show newest version
/**
 * 
 */
package mmb.engine.window;

import javax.swing.JFrame;

/**
 * @author oskar
 * An auxiliary frame class, which supports full screen control
 */
@SuppressWarnings("serial")
public abstract class MMBFrame extends JFrame {
	
	boolean undergoingScreenTransform = false;
	/**
	 * Check if the screen is currently undergoing a full-screen transform. It serves to disable destroy() method when using dispose();
	 * @return the undergoingScreenTransform
	 */
	public boolean isUndergoingScreenTransform() {
		return undergoingScreenTransform;
	}
	boolean isDisposing;
	@Override
	public synchronized void dispose() {
		if(isDisposing) return;
		try {
			isDisposing = true;
			if(!undergoingScreenTransform) destroy();
			super.dispose();
		}finally {
			isDisposing = false;
		}
		
	}
	/**
	 * Destroy any involved data, resetting for next set-up
	 */
	public abstract void destroy();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy