1 |
/* |
/* |
2 |
* JSampler - a java front-end for LinuxSampler |
* JSampler - a java front-end for LinuxSampler |
3 |
* |
* |
4 |
* Copyright (C) 2005-2006 Grigor Iliev <grigor@grigoriliev.com> |
* Copyright (C) 2005-2007 Grigor Iliev <grigor@grigoriliev.com> |
5 |
* |
* |
6 |
* This file is part of JSampler. |
* This file is part of JSampler. |
7 |
* |
* |
22 |
|
|
23 |
package org.jsampler.view.classic; |
package org.jsampler.view.classic; |
24 |
|
|
25 |
|
import java.awt.Desktop; |
26 |
import java.awt.Dialog; |
import java.awt.Dialog; |
27 |
import java.awt.Dimension; |
import java.awt.Dimension; |
28 |
import java.awt.Frame; |
import java.awt.Frame; |
33 |
import java.awt.event.ActionEvent; |
import java.awt.event.ActionEvent; |
34 |
import java.awt.event.ActionListener; |
import java.awt.event.ActionListener; |
35 |
|
|
36 |
|
import java.net.URI; |
37 |
import java.net.URL; |
import java.net.URL; |
38 |
|
|
39 |
import javax.swing.BorderFactory; |
import javax.swing.BorderFactory; |
51 |
import net.sf.juife.JuifeUtils; |
import net.sf.juife.JuifeUtils; |
52 |
import net.sf.juife.LinkButton; |
import net.sf.juife.LinkButton; |
53 |
|
|
54 |
|
import org.jsampler.HF; |
55 |
|
|
56 |
import static org.jsampler.view.classic.ClassicI18n.i18n; |
import static org.jsampler.view.classic.ClassicI18n.i18n; |
57 |
|
|
58 |
|
|
62 |
*/ |
*/ |
63 |
public class HelpAboutDlg extends InformationDialog { |
public class HelpAboutDlg extends InformationDialog { |
64 |
private JLabel lProductName = |
private JLabel lProductName = |
65 |
new JLabel("<html>\n<font size=+1>JS Classic (version 0.5a)</font>"); |
new JLabel("<html>\n<font size=+1>JS Classic (version 0.6a)</font>"); |
66 |
|
|
67 |
private JLabel lAuthor = new JLabel(i18n.getLabel("HelpAboutDlg.lAuthor")); |
private JLabel lAuthor = new JLabel(i18n.getLabel("HelpAboutDlg.lAuthor")); |
68 |
private JTextField tfAuthor = new JTextField(i18n.getLabel("HelpAboutDlg.tfAuthor")); |
private JTextField tfAuthor = new JTextField(i18n.getLabel("HelpAboutDlg.tfAuthor")); |
79 |
= new LinkButton("juife - Java User Interface Framework Extensions"); |
= new LinkButton("juife - Java User Interface Framework Extensions"); |
80 |
|
|
81 |
|
|
82 |
private JLabel lCopyright = |
private JLabel lCopyright = new JLabel(i18n.getLabel("HelpAboutDlg.lCopyright")); |
|
new JLabel(i18n.getLabel("HelpAboutDlg.lCopyright")); |
|
83 |
|
|
84 |
private JPanel mainPane = new JPanel(); |
private JPanel mainPane = new JPanel(); |
85 |
|
|
232 |
private JLabel lAuthorEmail = |
private JLabel lAuthorEmail = |
233 |
new JLabel(i18n.getLabel("HelpAboutDlg.lAuthorEmail")); |
new JLabel(i18n.getLabel("HelpAboutDlg.lAuthorEmail")); |
234 |
private JLabel lLSWebsite = new JLabel(i18n.getLabel("HelpAboutDlg.lLSWebsite")); |
private JLabel lLSWebsite = new JLabel(i18n.getLabel("HelpAboutDlg.lLSWebsite")); |
235 |
private WebButton btnAuthorEmail = new WebButton("grigor@grigoriliev.com"); |
private LinkButton btnAuthorEmail = new LinkButton("grigor@grigoriliev.com"); |
236 |
private WebButton btnWebsite = new WebButton("http://www.linuxsampler.org"); |
private LinkButton btnLSWebsite = new LinkButton("www.linuxsampler.org"); |
237 |
|
|
238 |
private JLabel lLSMailingList = |
private JLabel lLSMailingList = |
239 |
new JLabel(i18n.getLabel("HelpAboutDlg.lLSMailingList")); |
new JLabel(i18n.getLabel("HelpAboutDlg.lLSMailingList")); |
240 |
|
|
241 |
private WebButton btnMailingList = new WebButton ( |
private LinkButton btnMailingList = new LinkButton ( |
242 |
"http://lists.sourceforge.net/lists/listinfo/linuxsampler-devel" |
"lists.sourceforge.net/lists/listinfo/linuxsampler-devel" |
243 |
); |
); |
244 |
|
|
245 |
ContactInfoPane() { |
ContactInfoPane() { |
275 |
|
|
276 |
c.gridx = 1; |
c.gridx = 1; |
277 |
c.gridy = 1; |
c.gridy = 1; |
278 |
gridbag.setConstraints(btnWebsite, c); |
gridbag.setConstraints(btnLSWebsite, c); |
279 |
add(btnWebsite); |
add(btnLSWebsite); |
280 |
|
|
281 |
c.gridx = 1; |
c.gridx = 1; |
282 |
c.gridy = 2; |
c.gridy = 2; |
285 |
add(btnMailingList); |
add(btnMailingList); |
286 |
|
|
287 |
setBorder(BorderFactory.createTitledBorder ( |
setBorder(BorderFactory.createTitledBorder ( |
288 |
i18n.getLabel("HelpAboutDlg.ContactInfoPane") |
i18n.getLabel("HelpAboutDlg.contactInfoPane") |
289 |
)); |
)); |
290 |
|
|
291 |
|
installListeners(); |
292 |
} |
} |
293 |
|
|
294 |
|
private void |
295 |
|
installListeners() { |
296 |
|
btnAuthorEmail.addActionListener(new ActionListener() { |
297 |
|
public void |
298 |
|
actionPerformed(ActionEvent e) { |
299 |
|
browse("mailto:grigor@grigoriliev.com"); |
300 |
|
} |
301 |
|
}); |
302 |
|
|
303 |
|
btnLSWebsite.addActionListener(new ActionListener() { |
304 |
|
public void |
305 |
|
actionPerformed(ActionEvent e) { |
306 |
|
browse("http://www.linuxsampler.org"); |
307 |
|
} |
308 |
|
}); |
309 |
|
|
310 |
|
btnMailingList.addActionListener(new ActionListener() { |
311 |
|
public void |
312 |
|
actionPerformed(ActionEvent e) { |
313 |
|
browse("http://lists.sourceforge.net/lists/listinfo/linuxsampler-devel"); |
314 |
|
} |
315 |
|
}); |
316 |
|
} |
317 |
|
} |
318 |
|
|
319 |
|
private boolean |
320 |
|
checkDesktopSupported() { |
321 |
|
if(Desktop.isDesktopSupported()) return true; |
322 |
|
|
323 |
|
HF.showErrorMessage(i18n.getError("HelpAboutDlg.DesktopApiNotSupported"), this); |
324 |
|
|
325 |
|
return false; |
326 |
|
} |
327 |
|
|
328 |
|
private void |
329 |
|
browse(String uri) { |
330 |
|
if(!checkDesktopSupported()) return; |
331 |
|
|
332 |
|
try { Desktop.getDesktop().browse(new URI(uri)); } |
333 |
|
catch(Exception x) { x.printStackTrace(); } |
334 |
|
} |
335 |
|
|
336 |
|
private void |
337 |
|
mail(String uri) { |
338 |
|
if(!checkDesktopSupported()) return; |
339 |
|
|
340 |
|
Desktop desktop = Desktop.getDesktop(); |
341 |
|
|
342 |
|
try { Desktop.getDesktop().mail(new URI(uri)); } |
343 |
|
catch(Exception x) { x.printStackTrace(); } |
344 |
} |
} |
345 |
} |
} |
346 |
|
|