/* */ package NET.worlds.console; /* */ /* */ import NET.worlds.core.IniFile; /* */ import NET.worlds.core.Std; /* */ import NET.worlds.network.NetUpdate; /* */ import java.awt.BorderLayout; /* */ import java.awt.Button; /* */ import java.awt.Color; /* */ import java.awt.Component; /* */ import java.awt.Event; /* */ import java.awt.Font; /* */ import java.awt.Frame; /* */ import java.awt.GridBagConstraints; /* */ import java.awt.GridBagLayout; /* */ import java.awt.Label; /* */ import java.awt.Panel; /* */ import java.awt.TextArea; /* */ import java.util.Enumeration; /* */ import java.util.Vector; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public class AboutDialog /* */ extends PolledDialog /* */ { /* */ private static final long serialVersionUID = -2810306367601133331L; /* 63 */ Button okButton = new Button(Console.message("OK")); /* */ /* 65 */ private static Font font = new Font( /* 66 */ Console.message("ConsoleFont"), 0, 12); /* 67 */ private static Font bfont = new Font( /* 68 */ Console.message("ButtonFont"), 0, 12); /* */ String apptitle; /* */ /* */ AboutDialog(String apptitle, Frame frame) /* */ { /* 73 */ super(frame, null, Console.message("About") + Std.getProductName(), true); /* 74 */ this.apptitle = apptitle; /* 75 */ ready(); /* */ } /* */ /* */ private Component setConstraints(GridBagLayout gbag, Component comp, GridBagConstraints c) /* */ { /* 80 */ gbag.setConstraints(comp, c); /* 81 */ return comp; /* */ } /* */ /* */ protected void build() /* */ { /* 86 */ setBackground(Color.white); /* */ /* 88 */ setLayout(new BorderLayout()); /* 89 */ add("North", new Filler(10, 10)); /* 90 */ add("South", new Filler(10, 10)); /* 91 */ add("East", new Filler(10, 10)); /* 92 */ add("West", new Filler(10, 10)); /* */ /* 94 */ GridBagLayout gbag = new GridBagLayout(); /* 95 */ Panel p = new Panel(gbag); /* 96 */ p.setFont(font); /* */ /* 98 */ GridBagConstraints c = new GridBagConstraints(); /* 99 */ c.fill = 0; /* 100 */ c.weightx = 1.0D; /* 101 */ c.weighty = 1.0D; /* 102 */ c.gridwidth = 0; /* 103 */ c.gridheight = 1; /* 104 */ String logo = IniFile.override().getIniString("AboutLogo", Console.message("wlogo.gif")); /* 105 */ p.add(setConstraints(gbag, new ImageCanvas(logo), c)); /* 106 */ c.weightx = 0.0D; /* 107 */ c.weighty = 0.0D; /* 108 */ p.add(setConstraints(gbag, new Label(this.apptitle), c)); /* 109 */ if (Gamma.getShaper() != null) { /* 110 */ p.add(setConstraints( /* 111 */ gbag, /* 112 */ new Label(Console.message("about-box-build-date") + /* 113 */ " " + /* 114 */ Std.getBuildInfo() + ":" + Std.getJavaVersion()), c)); /* */ } else { /* 116 */ p.add(setConstraints( /* 117 */ gbag, /* 118 */ new Label(Console.message("about-box-rev") + /* 119 */ " " + /* 120 */ Std.getVersion() + /* 121 */ " : " + Std.getJavaVersion()), c)); /* */ } /* 123 */ Vector worlds = NetUpdate.aboutWorlds(); /* 124 */ TextArea worldList = new TextArea(10, 40); /* 125 */ worldList.setEditable(false); /* */ /* 127 */ p.add(setConstraints(gbag, worldList, c)); /* */ /* 129 */ for (Enumeration e = worlds.elements(); e.hasMoreElements();) { /* 130 */ worldList.append((String)e.nextElement() + "\n"); /* */ } /* */ /* 133 */ p.add(setConstraints(gbag, /* 134 */ new Label(Console.message("about-box-1")), c)); /* 135 */ p.add(setConstraints(gbag, /* 136 */ new Label(Console.message("about-box-2")), c)); /* */ /* 138 */ this.okButton.setFont(bfont); /* 139 */ p.add(setConstraints(gbag, this.okButton, c)); /* */ /* 141 */ add("Center", p); /* */ } /* */ /* */ @Deprecated /* */ public boolean action(Event event, Object what) /* */ { /* 147 */ if (event.target == this.okButton) /* 148 */ return done(true); /* 149 */ return false; /* */ } /* */ /* */ @Deprecated /* */ public boolean keyDown(Event event, int key) /* */ { /* 155 */ if ((key == 27) || (key == 10)) /* 156 */ return done(true); /* 157 */ return super.keyDown(event, key); /* */ } /* */ /* */ /* */ /* */ public void setVisible(boolean visible) /* */ { /* 164 */ super.setVisible(visible); /* 165 */ if (visible) { /* 166 */ this.okButton.requestFocus(); /* */ } /* */ } /* */ } /* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\console\AboutDialog.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */