1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package net.sf.magicproject.ui.wizard;
20
21 import java.io.InputStream;
22
23 import javax.swing.JFrame;
24 import javax.swing.JScrollPane;
25 import javax.swing.JTextArea;
26 import javax.swing.ScrollPaneConstants;
27
28 import net.sf.magicproject.deckbuilder.MdbLoader;
29 import net.sf.magicproject.tools.MToolKit;
30 import net.sf.magicproject.ui.i18n.LanguageManager;
31
32 import org.apache.commons.io.IOUtils;
33
34 /***
35 * AboutMdb.java Created on 16 févr. 2004
36 *
37 * @author <a href="mailto:fabdouglas@users.sourceforge.net">Fabrice Daugan </a>
38 * @since 0.1
39 */
40 public class AboutMdb extends Ok {
41
42 /***
43 * Creates a new instance of AboutMdb <br>
44 *
45 * @param parent
46 */
47 public AboutMdb(JFrame parent) {
48 super(LanguageManager.getString("about.tbs"), "<html><b>"
49 + LanguageManager.getString("tbsname") + ": </b>"
50 + MdbLoader.tbsFullName + "<br><b>"
51 + LanguageManager.getString("author") + ": </b>" + MdbLoader.author
52 + "<br><b>" + LanguageManager.getString("info") + ": </b>"
53 + MdbLoader.moreInfo + "<br><b>" + LanguageManager.getString("version")
54 + ": </b>" + MdbLoader.version, "mp64.gif", LanguageManager
55 .getString("close"), 420, 320);
56 JTextArea disclaimer = new JTextArea();
57 disclaimer.setEditable(false);
58 disclaimer.setLineWrap(true);
59 disclaimer.setWrapStyleWord(true);
60 disclaimer.setAutoscrolls(true);
61
62 final InputStream inGPL = MToolKit.getResourceAsStream(MToolKit.mdbFile);
63 if (inGPL != null) {
64 disclaimer.setText(MdbLoader.disclaimer.trim().replaceAll("\t", "")
65 .replaceAll("\n", ""));
66 IOUtils.closeQuietly(inGPL);
67 }
68 JScrollPane disclaimerSPanel = new JScrollPane();
69 disclaimerSPanel
70 .setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
71 MToolKit.addOverlay(disclaimerSPanel);
72 disclaimerSPanel.setViewportView(disclaimer);
73 gameParamPanel.add(disclaimerSPanel);
74 setLocation((getToolkit().getScreenSize().width - 420) / 2, (getToolkit()
75 .getScreenSize().height - 320) / 2);
76 }
77
78 }