summaryrefslogtreecommitdiff
path: root/NET/worlds/console/InternetConnectionDialog.java
diff options
context:
space:
mode:
Diffstat (limited to 'NET/worlds/console/InternetConnectionDialog.java')
-rw-r--r--NET/worlds/console/InternetConnectionDialog.java132
1 files changed, 132 insertions, 0 deletions
diff --git a/NET/worlds/console/InternetConnectionDialog.java b/NET/worlds/console/InternetConnectionDialog.java
new file mode 100644
index 0000000..144ccdb
--- /dev/null
+++ b/NET/worlds/console/InternetConnectionDialog.java
@@ -0,0 +1,132 @@
+/* */ package NET.worlds.console;
+/* */
+/* */ import NET.worlds.network.Galaxy;
+/* */ import NET.worlds.network.VarErrorException;
+/* */ import java.awt.BorderLayout;
+/* */ import java.awt.Button;
+/* */ import java.awt.Event;
+/* */ import java.awt.Font;
+/* */ import java.awt.Panel;
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ public class InternetConnectionDialog
+/* */ extends PolledDialog
+/* */ {
+/* */ private static final long serialVersionUID = 612016940893432560L;
+/* */ private String msg;
+/* 35 */ private Button okButton = new Button(Console.message("Retry"));
+/* 36 */ private Button cancelButton = new Button(Console.message("Single-user"));
+/* */
+/* */ private static boolean firstTimeDone;
+/* */ private static boolean choseSingleUserMode;
+/* 40 */ private static Font bfont = new Font(Console.message("ButtonFont"),
+/* 41 */ 0, 12);
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ public static boolean isFirstTimeDone()
+/* */ {
+/* 50 */ return firstTimeDone;
+/* */ }
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ public static boolean choseSingleUserMode()
+/* */ {
+/* 60 */ return choseSingleUserMode;
+/* */ }
+/* */
+/* */
+/* */ public InternetConnectionDialog(Galaxy galaxy, VarErrorException ve)
+/* */ {
+/* 66 */ super(Console.getFrame(), galaxy, Console.message("Internet-Connection"), true);
+/* 67 */ setAlignment(1);
+/* 68 */ this.msg = ve.getMsg().replace('\n', ' ');
+/* 69 */ ready();
+/* */ }
+/* */
+/* */ protected boolean done(boolean confirmed)
+/* */ {
+/* 74 */ boolean ret = super.done(confirmed);
+/* 75 */ choseSingleUserMode = !confirmed;
+/* 76 */ firstTimeDone = true;
+/* 77 */ return ret;
+/* */ }
+/* */
+/* */ protected void build()
+/* */ {
+/* 82 */ setLayout(new BorderLayout());
+/* 83 */ Panel txtPanel = new Panel(new BorderLayout());
+/* 84 */ txtPanel.add("Center", new TextCanvas(this.msg, 400));
+/* 85 */ txtPanel.add("North", new Filler(10, 10));
+/* 86 */ txtPanel.add("South", new Filler(10, 10));
+/* 87 */ txtPanel.add("East", new Filler(10, 10));
+/* 88 */ txtPanel.add("West", new Filler(10, 10));
+/* */
+/* 90 */ add("Center", txtPanel);
+/* */
+/* 92 */ Panel buttons = new Panel();
+/* 93 */ this.okButton.setFont(bfont);
+/* 94 */ this.cancelButton.setFont(bfont);
+/* 95 */ buttons.add(this.okButton);
+/* 96 */ buttons.add(this.cancelButton);
+/* */
+/* 98 */ add("South", buttons);
+/* */ }
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ @Deprecated
+/* */ public boolean action(Event event, Object what)
+/* */ {
+/* 109 */ Object target = event.target;
+/* 110 */ if (target == this.okButton)
+/* 111 */ return done(true);
+/* 112 */ if (target == this.cancelButton)
+/* 113 */ return done(false);
+/* 114 */ return false;
+/* */ }
+/* */
+/* */ @Deprecated
+/* */ public boolean keyDown(Event event, int key)
+/* */ {
+/* 120 */ if (key == 27)
+/* 121 */ return done(false);
+/* 122 */ if (key == 10)
+/* 123 */ return done(true);
+/* 124 */ return super.keyDown(event, key);
+/* */ }
+/* */ }
+
+
+/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\console\InternetConnectionDialog.class
+ * Java compiler version: 6 (50.0)
+ * JD-Core Version: 0.7.1
+ */ \ No newline at end of file