/* Class410 - Decompiled by JODE
 * Visit http://jode.sourceforge.net/
 */
import java.awt.DisplayMode;
import java.awt.Frame;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.lang.reflect.Field;

public class Class410
{
    GraphicsDevice aGraphicsDevice5995;
    DisplayMode aDisplayMode5996;
    
    void method7332() {
	if (((Class410) this).aDisplayMode5996 != null) {
	    DisplayMode[] displaymodes
		= ((Class410) this).aGraphicsDevice5995.getDisplayModes();
	    boolean bool = false;
	    DisplayMode[] displaymodes_0_ = displaymodes;
	    for (int i = 0; i < displaymodes_0_.length; i++) {
		DisplayMode displaymode = displaymodes_0_[i];
		if (displaymode.equals(((Class410) this).aDisplayMode5996)) {
		    ((Class410) this).aGraphicsDevice5995
			.setDisplayMode(((Class410) this).aDisplayMode5996);
		    bool = true;
		    break;
		}
	    }
	    if (!bool) {
		try {
		    Field field = Class.forName
				      ("sun.awt.Win32GraphicsDevice")
				      .getDeclaredField("defaultDisplayMode");
		    field.setAccessible(true);
		    field.set(((Class410) this).aGraphicsDevice5995, null);
		} catch (Throwable throwable) {
		    /* empty */
		}
	    }
	    ((Class410) this).aDisplayMode5996 = null;
	}
	method7336(null, -1549172459);
    }
    
    int[] method7333(int i) {
	DisplayMode[] displaymodes
	    = ((Class410) this).aGraphicsDevice5995.getDisplayModes();
	int[] is = new int[displaymodes.length << 2];
	for (int i_1_ = 0; i_1_ < displaymodes.length; i_1_++) {
	    is[i_1_ << 2] = displaymodes[i_1_].getWidth();
	    is[(i_1_ << 2) + 1] = displaymodes[i_1_].getHeight();
	    is[2 + (i_1_ << 2)] = displaymodes[i_1_].getBitDepth();
	    is[3 + (i_1_ << 2)] = displaymodes[i_1_].getRefreshRate();
	}
	return is;
    }
    
    void method7334(Frame frame, int i, int i_2_, int i_3_, int i_4_,
		    int i_5_) {
	((Class410) this).aDisplayMode5996
	    = ((Class410) this).aGraphicsDevice5995.getDisplayMode();
	if (((Class410) this).aDisplayMode5996 == null)
	    throw new NullPointerException();
	frame.setUndecorated(true);
	frame.enableInputMethods(false);
	method7336(frame, -1549172459);
	if (i_4_ == 0) {
	    int i_6_ = ((Class410) this).aDisplayMode5996.getRefreshRate();
	    DisplayMode[] displaymodes
		= ((Class410) this).aGraphicsDevice5995.getDisplayModes();
	    boolean bool = false;
	    for (int i_7_ = 0; i_7_ < displaymodes.length; i_7_++) {
		if (displaymodes[i_7_].getWidth() == i
		    && displaymodes[i_7_].getHeight() == i_2_
		    && displaymodes[i_7_].getBitDepth() == i_3_) {
		    int i_8_ = displaymodes[i_7_].getRefreshRate();
		    if (!bool
			|| Math.abs(i_8_ - i_6_) < Math.abs(i_4_ - i_6_)) {
			i_4_ = i_8_;
			bool = true;
		    }
		}
	    }
	    if (!bool)
		i_4_ = i_6_;
	}
	((Class410) this).aGraphicsDevice5995
	    .setDisplayMode(new DisplayMode(i, i_2_, i_3_, i_4_));
    }
    
    void method7335(int i) {
	if (((Class410) this).aDisplayMode5996 != null) {
	    DisplayMode[] displaymodes
		= ((Class410) this).aGraphicsDevice5995.getDisplayModes();
	    boolean bool = false;
	    DisplayMode[] displaymodes_9_ = displaymodes;
	    for (int i_10_ = 0; i_10_ < displaymodes_9_.length; i_10_++) {
		DisplayMode displaymode = displaymodes_9_[i_10_];
		if (displaymode.equals(((Class410) this).aDisplayMode5996)) {
		    ((Class410) this).aGraphicsDevice5995
			.setDisplayMode(((Class410) this).aDisplayMode5996);
		    bool = true;
		    break;
		}
	    }
	    if (!bool) {
		try {
		    Field field = Class.forName
				      ("sun.awt.Win32GraphicsDevice")
				      .getDeclaredField("defaultDisplayMode");
		    field.setAccessible(true);
		    field.set(((Class410) this).aGraphicsDevice5995, null);
		} catch (Throwable throwable) {
		    /* empty */
		}
	    }
	    ((Class410) this).aDisplayMode5996 = null;
	}
	method7336(null, -1549172459);
    }
    
    void method7336(Frame frame, int i) {
	boolean bool = false;
	try {
	    Field field = Class.forName("sun.awt.Win32GraphicsDevice")
			      .getDeclaredField("valid");
	    field.setAccessible(true);
	    boolean bool_11_
		= ((Boolean) field.get(((Class410) this).aGraphicsDevice5995))
		      .booleanValue();
	    if (bool_11_) {
		field.set(((Class410) this).aGraphicsDevice5995,
			  Boolean.FALSE);
		bool = true;
	    }
	} catch (Throwable throwable) {
	    /* empty */
	}
	try {
	    ((Class410) this).aGraphicsDevice5995.setFullScreenWindow(frame);
	    if (bool) {
		try {
		    Field field = Class.forName
				      ("sun.awt.Win32GraphicsDevice")
				      .getDeclaredField("valid");
		    field.set(((Class410) this).aGraphicsDevice5995,
			      Boolean.TRUE);
		} catch (Throwable throwable) {
		    /* empty */
		}
	    }
	} catch (Object object) {
	    if (bool) {
		try {
		    Field field = Class.forName
				      ("sun.awt.Win32GraphicsDevice")
				      .getDeclaredField("valid");
		    field.set(((Class410) this).aGraphicsDevice5995,
			      Boolean.TRUE);
		} catch (Throwable throwable) {
		    /* empty */
		}
	    }
	    throw object;
	}
    }
    
    int[] method7337() {
	DisplayMode[] displaymodes
	    = ((Class410) this).aGraphicsDevice5995.getDisplayModes();
	int[] is = new int[displaymodes.length << 2];
	for (int i = 0; i < displaymodes.length; i++) {
	    is[i << 2] = displaymodes[i].getWidth();
	    is[(i << 2) + 1] = displaymodes[i].getHeight();
	    is[2 + (i << 2)] = displaymodes[i].getBitDepth();
	    is[3 + (i << 2)] = displaymodes[i].getRefreshRate();
	}
	return is;
    }
    
    int[] method7338() {
	DisplayMode[] displaymodes
	    = ((Class410) this).aGraphicsDevice5995.getDisplayModes();
	int[] is = new int[displaymodes.length << 2];
	for (int i = 0; i < displaymodes.length; i++) {
	    is[i << 2] = displaymodes[i].getWidth();
	    is[(i << 2) + 1] = displaymodes[i].getHeight();
	    is[2 + (i << 2)] = displaymodes[i].getBitDepth();
	    is[3 + (i << 2)] = displaymodes[i].getRefreshRate();
	}
	return is;
    }
    
    public Class410() throws Exception {
	GraphicsEnvironment graphicsenvironment
	    = GraphicsEnvironment.getLocalGraphicsEnvironment();
	((Class410) this).aGraphicsDevice5995
	    = graphicsenvironment.getDefaultScreenDevice();
	if (!((Class410) this).aGraphicsDevice5995.isFullScreenSupported()) {
	    GraphicsDevice[] graphicsdevices
		= graphicsenvironment.getScreenDevices();
	    GraphicsDevice[] graphicsdevices_12_ = graphicsdevices;
	    for (int i = 0; i < graphicsdevices_12_.length; i++) {
		GraphicsDevice graphicsdevice = graphicsdevices_12_[i];
		if (null != graphicsdevice
		    && graphicsdevice.isFullScreenSupported()) {
		    ((Class410) this).aGraphicsDevice5995 = graphicsdevice;
		    return;
		}
	    }
	    throw new Exception();
	}
    }
    
    void method7339(Frame frame, int i, int i_13_, int i_14_, int i_15_) {
	((Class410) this).aDisplayMode5996
	    = ((Class410) this).aGraphicsDevice5995.getDisplayMode();
	if (((Class410) this).aDisplayMode5996 == null)
	    throw new NullPointerException();
	frame.setUndecorated(true);
	frame.enableInputMethods(false);
	method7336(frame, -1549172459);
	if (i_15_ == 0) {
	    int i_16_ = ((Class410) this).aDisplayMode5996.getRefreshRate();
	    DisplayMode[] displaymodes
		= ((Class410) this).aGraphicsDevice5995.getDisplayModes();
	    boolean bool = false;
	    for (int i_17_ = 0; i_17_ < displaymodes.length; i_17_++) {
		if (displaymodes[i_17_].getWidth() == i
		    && displaymodes[i_17_].getHeight() == i_13_
		    && displaymodes[i_17_].getBitDepth() == i_14_) {
		    int i_18_ = displaymodes[i_17_].getRefreshRate();
		    if (!bool
			|| Math.abs(i_18_ - i_16_) < Math.abs(i_15_ - i_16_)) {
			i_15_ = i_18_;
			bool = true;
		    }
		}
	    }
	    if (!bool)
		i_15_ = i_16_;
	}
	((Class410) this).aGraphicsDevice5995
	    .setDisplayMode(new DisplayMode(i, i_13_, i_14_, i_15_));
    }
    
    void method7340() {
	if (((Class410) this).aDisplayMode5996 != null) {
	    DisplayMode[] displaymodes
		= ((Class410) this).aGraphicsDevice5995.getDisplayModes();
	    boolean bool = false;
	    DisplayMode[] displaymodes_19_ = displaymodes;
	    for (int i = 0; i < displaymodes_19_.length; i++) {
		DisplayMode displaymode = displaymodes_19_[i];
		if (displaymode.equals(((Class410) this).aDisplayMode5996)) {
		    ((Class410) this).aGraphicsDevice5995
			.setDisplayMode(((Class410) this).aDisplayMode5996);
		    bool = true;
		    break;
		}
	    }
	    if (!bool) {
		try {
		    Field field = Class.forName
				      ("sun.awt.Win32GraphicsDevice")
				      .getDeclaredField("defaultDisplayMode");
		    field.setAccessible(true);
		    field.set(((Class410) this).aGraphicsDevice5995, null);
		} catch (Throwable throwable) {
		    /* empty */
		}
	    }
	    ((Class410) this).aDisplayMode5996 = null;
	}
	method7336(null, -1549172459);
    }
    
    void method7341() {
	if (((Class410) this).aDisplayMode5996 != null) {
	    DisplayMode[] displaymodes
		= ((Class410) this).aGraphicsDevice5995.getDisplayModes();
	    boolean bool = false;
	    DisplayMode[] displaymodes_20_ = displaymodes;
	    for (int i = 0; i < displaymodes_20_.length; i++) {
		DisplayMode displaymode = displaymodes_20_[i];
		if (displaymode.equals(((Class410) this).aDisplayMode5996)) {
		    ((Class410) this).aGraphicsDevice5995
			.setDisplayMode(((Class410) this).aDisplayMode5996);
		    bool = true;
		    break;
		}
	    }
	    if (!bool) {
		try {
		    Field field = Class.forName
				      ("sun.awt.Win32GraphicsDevice")
				      .getDeclaredField("defaultDisplayMode");
		    field.setAccessible(true);
		    field.set(((Class410) this).aGraphicsDevice5995, null);
		} catch (Throwable throwable) {
		    /* empty */
		}
	    }
	    ((Class410) this).aDisplayMode5996 = null;
	}
	method7336(null, -1549172459);
    }
    
    void method7342() {
	if (((Class410) this).aDisplayMode5996 != null) {
	    DisplayMode[] displaymodes
		= ((Class410) this).aGraphicsDevice5995.getDisplayModes();
	    boolean bool = false;
	    DisplayMode[] displaymodes_21_ = displaymodes;
	    for (int i = 0; i < displaymodes_21_.length; i++) {
		DisplayMode displaymode = displaymodes_21_[i];
		if (displaymode.equals(((Class410) this).aDisplayMode5996)) {
		    ((Class410) this).aGraphicsDevice5995
			.setDisplayMode(((Class410) this).aDisplayMode5996);
		    bool = true;
		    break;
		}
	    }
	    if (!bool) {
		try {
		    Field field = Class.forName
				      ("sun.awt.Win32GraphicsDevice")
				      .getDeclaredField("defaultDisplayMode");
		    field.setAccessible(true);
		    field.set(((Class410) this).aGraphicsDevice5995, null);
		} catch (Throwable throwable) {
		    /* empty */
		}
	    }
	    ((Class410) this).aDisplayMode5996 = null;
	}
	method7336(null, -1549172459);
    }
    
    void method7343(Frame frame, int i, int i_22_, int i_23_, int i_24_) {
	((Class410) this).aDisplayMode5996
	    = ((Class410) this).aGraphicsDevice5995.getDisplayMode();
	if (((Class410) this).aDisplayMode5996 == null)
	    throw new NullPointerException();
	frame.setUndecorated(true);
	frame.enableInputMethods(false);
	method7336(frame, -1549172459);
	if (i_24_ == 0) {
	    int i_25_ = ((Class410) this).aDisplayMode5996.getRefreshRate();
	    DisplayMode[] displaymodes
		= ((Class410) this).aGraphicsDevice5995.getDisplayModes();
	    boolean bool = false;
	    for (int i_26_ = 0; i_26_ < displaymodes.length; i_26_++) {
		if (displaymodes[i_26_].getWidth() == i
		    && displaymodes[i_26_].getHeight() == i_22_
		    && displaymodes[i_26_].getBitDepth() == i_23_) {
		    int i_27_ = displaymodes[i_26_].getRefreshRate();
		    if (!bool
			|| Math.abs(i_27_ - i_25_) < Math.abs(i_24_ - i_25_)) {
			i_24_ = i_27_;
			bool = true;
		    }
		}
	    }
	    if (!bool)
		i_24_ = i_25_;
	}
	((Class410) this).aGraphicsDevice5995
	    .setDisplayMode(new DisplayMode(i, i_22_, i_23_, i_24_));
    }
    
    public static void method7344(boolean bool, byte i) {
	do {
	    if (4 != 990760269 * client.anInt8196) {
		if (i == -1) {
		    /* empty */
		}
		if (990760269 * client.anInt8196 != 3)
		    break;
		if (i == -1)
		    return;
	    }
	    return;
	} while (false);
	if (!bool) {
	    if (i == -1) {
		/* empty */
	    }
	    if (null != Class244.aClass120Array3911) {
		if (i == -1)
		    throw new IllegalStateException();
		Class120[] class120s = Class244.aClass120Array3911;
		for (int i_28_ = 0; i_28_ < class120s.length; i_28_++) {
		    if (i == -1)
			throw new IllegalStateException();
		    Class120 class120 = class120s[i_28_];
		    class120.method3036(1869053617);
		}
	    }
	    if (Class96.anInt1081 * 815633347 != -1) {
		if (i == -1) {
		    /* empty */
		}
		Class40.aClass130_598.method3182(815633347 * Class96.anInt1081,
						 255, (byte) 39);
	    }
	}
	client.anInt8196 = -359084524;
	Class249.aClass243_Sub10_3941 = null;
	client.aBool8144 = false;
	if (-102075833 * Class96.anInt1082 > 0) {
	    if (i == -1)
		return;
	    Class81.method1840(Class621.aClass621_7979,
			       Class96.anInt1082 * -102075833, -1, 1085420044);
	}
	Class295.method5927((byte) -90);
	Class243_Sub43 class243_sub43
	    = Class529.method11818(Class326.aClass326_4950,
				   client.aClass194_8163.aClass432_2312,
				   (short) 255);
	Class243_Sub10_Sub1 class243_sub10_sub1
	    = class243_sub43.aClass243_Sub10_Sub1_9988;
	int i_29_;
	if (bool) {
	    if (i == -1) {
		/* empty */
	    }
	    i_29_ = 1;
	} else
	    i_29_ = 0;
	class243_sub10_sub1.method14800(i_29_, 397675198);
	client.aClass194_8163.method4175(class243_sub43, (byte) 103);
    }
    
    static void method7345(Class117 class117, byte i) {
	if (client.aBool8305) {
	    if (class117.anObjectArray1497 != null) {
		Class117 class117_30_
		    = Class570.method12625(Class445.anInt6228 * -272779353,
					   538726025 * client.anInt8306,
					   -1344760440);
		if (null != class117_30_) {
		    Class243_Sub15 class243_sub15 = new Class243_Sub15();
		    class243_sub15.aClass117_8718 = class117;
		    class243_sub15.aClass117_8719 = class117_30_;
		    class243_sub15.anObjectArray8720
			= class117.anObjectArray1497;
		    Class446.method7975(class243_sub15, -1520219359);
		}
	    }
	    Class243_Sub43 class243_sub43
		= Class529.method11818(Class326.aClass326_4884,
				       client.aClass194_8163.aClass432_2312,
				       (short) 255);
	    class243_sub43.aClass243_Sub10_Sub1_9988
		.method14703(client.anInt8306 * 538726025, 417038145);
	    class243_sub43.aClass243_Sub10_Sub1_9988
		.method14704(class117.anInt1374 * -870117321, (byte) 104);
	    class243_sub43.aClass243_Sub10_Sub1_9988
		.method14841(class117.anInt1407 * -1982078391, 735483131);
	    class243_sub43.aClass243_Sub10_Sub1_9988
		.method14643(client.anInt8262 * -52254039, (short) -12681);
	    class243_sub43.aClass243_Sub10_Sub1_9988
		.method14841(-272779353 * Class445.anInt6228, 735483131);
	    class243_sub43.aClass243_Sub10_Sub1_9988
		.method14704(class117.anInt1418 * -258905001, (byte) 37);
	    client.aClass194_8163.method4175(class243_sub43, (byte) 123);
	}
    }
}
