57 |
* @author grish |
* @author grish |
58 |
*/ |
*/ |
59 |
public class HelpAboutDlg extends InformationDialog { |
public class HelpAboutDlg extends InformationDialog { |
|
private final static JPanel pane = new JPanel(); |
|
|
|
|
60 |
private JLabel lProductName = |
private JLabel lProductName = |
61 |
new JLabel("<html>\n<font size=+1>JS Classic (version 0.1a)</font>"); |
new JLabel("<html>\n<font size=+1>JS Classic (version 0.2a)</font>"); |
62 |
|
|
63 |
private JLabel lAuthor = new JLabel(i18n.getLabel("HelpAboutDlg.lAuthor")); |
private JLabel lAuthor = new JLabel(i18n.getLabel("HelpAboutDlg.lAuthor")); |
64 |
private JTextField tfAuthor = new JTextField(i18n.getLabel("HelpAboutDlg.tfAuthor")); |
private JTextField tfAuthor = new JTextField(i18n.getLabel("HelpAboutDlg.tfAuthor")); |
82 |
|
|
83 |
/** Creates a new instance of HelpAboutDlg */ |
/** Creates a new instance of HelpAboutDlg */ |
84 |
public HelpAboutDlg(Frame owner) { |
public HelpAboutDlg(Frame owner) { |
85 |
super(owner, i18n.getLabel("HelpAboutDlg.title"), pane); |
super(owner, i18n.getLabel("HelpAboutDlg.title")); |
86 |
|
|
87 |
GridBagLayout gridbag = new GridBagLayout(); |
GridBagLayout gridbag = new GridBagLayout(); |
88 |
GridBagConstraints c = new GridBagConstraints(); |
GridBagConstraints c = new GridBagConstraints(); |
185 |
lCopyright.setAlignmentX(LEFT_ALIGNMENT); |
lCopyright.setAlignmentX(LEFT_ALIGNMENT); |
186 |
mainPane.add(lCopyright); |
mainPane.add(lCopyright); |
187 |
|
|
|
pane.getParent().remove(pane); |
|
188 |
setMainPane(mainPane); |
setMainPane(mainPane); |
189 |
|
|
190 |
pack(); |
pack(); |
302 |
enum License { GPL, LGPL } |
enum License { GPL, LGPL } |
303 |
|
|
304 |
class LicenseDlg extends InformationDialog { |
class LicenseDlg extends InformationDialog { |
|
private static JPanel pane = new JPanel(); |
|
|
|
|
305 |
LicenseDlg(Dialog owner, License license) { |
LicenseDlg(Dialog owner, License license) { |
306 |
super(owner, pane); |
super(owner); |
307 |
|
|
308 |
switch(license) { |
switch(license) { |
309 |
case GPL: setTitle("GNU General Public License"); break; |
case GPL: setTitle("GNU General Public License"); break; |
313 |
JScrollPane sp = new JScrollPane(new LicensePane(license)); |
JScrollPane sp = new JScrollPane(new LicensePane(license)); |
314 |
sp.setPreferredSize(new Dimension(800, 400)); |
sp.setPreferredSize(new Dimension(800, 400)); |
315 |
|
|
|
pane.getParent().remove(pane); |
|
316 |
setMainPane(sp); |
setMainPane(sp); |
317 |
} |
} |
318 |
|
|
336 |
} catch(Exception x) { |
} catch(Exception x) { |
337 |
x.printStackTrace(); |
x.printStackTrace(); |
338 |
} |
} |
339 |
|
|
340 |
|
setEditable(false); |
341 |
} |
} |
342 |
} |
} |
343 |
} |
} |
344 |
|
|
345 |
class LibraryInfoDlg extends InformationDialog { |
class LibraryInfoDlg extends InformationDialog { |
|
private final static JPanel pane = new JPanel(); |
|
|
|
|
346 |
private JLabel lAuthor = new JLabel(i18n.getLabel("LibraryInfoDlg.lAuthor")); |
private JLabel lAuthor = new JLabel(i18n.getLabel("LibraryInfoDlg.lAuthor")); |
347 |
private JTextField tfAuthor = new JTextField(i18n.getLabel("LibraryInfoDlg.tfAuthor")); |
private JTextField tfAuthor = new JTextField(i18n.getLabel("LibraryInfoDlg.tfAuthor")); |
348 |
|
|
359 |
String website, |
String website, |
360 |
final License license |
final License license |
361 |
) { |
) { |
362 |
super(owner, libName, pane); |
super(owner, libName); |
363 |
|
|
364 |
switch(license) { |
switch(license) { |
365 |
case GPL: btnLicense.setText("GNU General Public License"); break; |
case GPL: btnLicense.setText("GNU General Public License"); break; |
368 |
|
|
369 |
btnWebsite.setText(website); |
btnWebsite.setText(website); |
370 |
|
|
|
pane.getParent().remove(pane); |
|
371 |
setMainPane(new LibraryInfoPane(libName, libVersion, license)); |
setMainPane(new LibraryInfoPane(libName, libVersion, license)); |
372 |
|
|
373 |
btnLicense.addActionListener(new ActionListener() { |
btnLicense.addActionListener(new ActionListener() { |