From e1e781bb2135ef78592226f1a3eaba4925702f1f Mon Sep 17 00:00:00 2001 From: Fuwn Date: Mon, 3 May 2021 16:38:41 -0700 Subject: :star: --- NET/worlds/network/NewVersionDialog.java | 141 +++++++++++++++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 NET/worlds/network/NewVersionDialog.java (limited to 'NET/worlds/network/NewVersionDialog.java') diff --git a/NET/worlds/network/NewVersionDialog.java b/NET/worlds/network/NewVersionDialog.java new file mode 100644 index 0000000..0a99b3e --- /dev/null +++ b/NET/worlds/network/NewVersionDialog.java @@ -0,0 +1,141 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.console.Console; +/* */ import NET.worlds.console.MultiLineLabel; +/* */ import NET.worlds.console.PolledDialog; +/* */ import NET.worlds.core.Std; +/* */ import java.awt.Button; +/* */ import java.awt.Event; +/* */ import java.awt.GridBagConstraints; +/* */ import java.awt.GridBagLayout; +/* */ import java.text.MessageFormat; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class NewVersionDialog +/* */ extends PolledDialog +/* */ { +/* */ private static final long serialVersionUID = -2091867202100838097L; +/* 35 */ private Button yesButton = new Button(Console.message("Yes-Restart")); +/* 36 */ private Button noButton = new Button(Console.message("No-Keep-Playing")); +/* */ +/* */ +/* */ +/* */ +/* */ +/* 42 */ Object[] arguments = { new String(Std.getProductName()) }; +/* 43 */ private String message = MessageFormat.format( +/* 44 */ Console.message("upgrade-is-now"), this.arguments); +/* */ +/* */ +/* 47 */ private static String title = Console.message("Download-Complete"); +/* */ +/* */ +/* */ +/* */ +/* */ public NewVersionDialog() +/* */ { +/* 54 */ super(Console.getFrame(), null, title, false); +/* 55 */ setAlignment(1); +/* 56 */ readySetGo(); +/* */ } +/* */ +/* */ +/* */ +/* */ protected void build() +/* */ { +/* 63 */ GridBagLayout gbag = new GridBagLayout(); +/* 64 */ setLayout(gbag); +/* 65 */ GridBagConstraints c = new GridBagConstraints(); +/* 66 */ c.anchor = 10; +/* 67 */ c.fill = 0; +/* 68 */ c.weightx = 1.0D; +/* 69 */ c.weighty = 1.0D; +/* 70 */ c.gridwidth = 0; +/* 71 */ c.gridheight = 1; +/* 72 */ add(gbag, new MultiLineLabel(this.message, 5, 5), c); +/* 73 */ c.gridwidth = 2; +/* 74 */ add(gbag, this.yesButton, c); +/* 75 */ add(gbag, this.noButton, c); +/* */ } +/* */ +/* */ +/* */ public void setVisible(boolean visible) +/* */ { +/* 81 */ super.setVisible(visible); +/* 82 */ if (visible) { +/* 83 */ this.yesButton.requestFocus(); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public synchronized boolean confirmRestart() +/* */ { +/* 92 */ while (isActive()) { +/* */ try { +/* 94 */ wait(); +/* */ } +/* */ catch (InterruptedException localInterruptedException) {} +/* */ } +/* 98 */ return getConfirmed(); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ protected synchronized boolean done(boolean confirmed) +/* */ { +/* 107 */ boolean retCode = super.done(confirmed); +/* 108 */ notify(); +/* 109 */ return retCode; +/* */ } +/* */ +/* */ +/* */ @Deprecated +/* */ public boolean action(Event event, Object what) +/* */ { +/* 116 */ if (event.target == this.yesButton) +/* 117 */ return done(true); +/* 118 */ if (event.target == this.noButton) +/* 119 */ return done(false); +/* 120 */ return false; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ @Deprecated +/* */ public boolean keyDown(Event event, int key) +/* */ { +/* 131 */ if (key == 27) +/* 132 */ return done(false); +/* 133 */ return super.keyDown(event, key); +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\NewVersionDialog.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */ \ No newline at end of file -- cgit v1.2.3