mmb.engine.window.MMBFrame Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of multimachinebuilder Show documentation
Show all versions of multimachinebuilder Show documentation
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<
/**
*
*/
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();
}