1 |
/* |
/* |
2 |
* JSampler - a java front-end for LinuxSampler |
* JSampler - a java front-end for LinuxSampler |
3 |
* |
* |
4 |
* Copyright (C) 2005-2007 Grigor Iliev <grigor@grigoriliev.com> |
* Copyright (C) 2005-2008 Grigor Iliev <grigor@grigoriliev.com> |
5 |
* |
* |
6 |
* This file is part of JSampler. |
* This file is part of JSampler. |
7 |
* |
* |
23 |
package org.jsampler.view.fantasia; |
package org.jsampler.view.fantasia; |
24 |
|
|
25 |
import java.awt.Color; |
import java.awt.Color; |
|
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 |
|
|
|
import java.net.URI; |
|
36 |
import java.net.URL; |
import java.net.URL; |
37 |
|
|
38 |
import javax.swing.BorderFactory; |
import javax.swing.BorderFactory; |
46 |
import javax.swing.JTabbedPane; |
import javax.swing.JTabbedPane; |
47 |
|
|
48 |
import net.sf.juife.InformationDialog; |
import net.sf.juife.InformationDialog; |
|
import net.sf.juife.JuifeUtils; |
|
49 |
import net.sf.juife.LinkButton; |
import net.sf.juife.LinkButton; |
50 |
|
|
51 |
import org.jsampler.HF; |
import org.jsampler.view.std.StdUtils; |
52 |
|
|
53 |
import org.jvnet.substance.SubstanceLookAndFeel; |
import org.jvnet.substance.SubstanceLookAndFeel; |
54 |
|
|
60 |
*/ |
*/ |
61 |
public class HelpAboutDlg extends InformationDialog { |
public class HelpAboutDlg extends InformationDialog { |
62 |
private JLabel lProductName = |
private JLabel lProductName = |
63 |
new JLabel("<html>\n<font size=+1>Fantasia (version 0.7a)</font>"); |
new JLabel("<html>\n<font size=+1>JSampler Fantasia (version 0.8a cvs_6)</font>"); |
64 |
|
|
65 |
private JLabel lAuthor = new JLabel(i18n.getLabel("HelpAboutDlg.lAuthor")); |
private JLabel lAuthor = new JLabel(i18n.getLabel("HelpAboutDlg.lAuthor")); |
66 |
private LinkButton btnAuthor = new Lnkbutton(i18n.getLabel("HelpAboutDlg.btnAuthor")); |
private LinkButton btnAuthor = new Lnkbutton(i18n.getLabel("HelpAboutDlg.btnAuthor")); |
114 |
btnAuthor.addActionListener(new ActionListener() { |
btnAuthor.addActionListener(new ActionListener() { |
115 |
public void |
public void |
116 |
actionPerformed(ActionEvent e) { |
actionPerformed(ActionEvent e) { |
117 |
browse("http://www.grigoriliev.com"); |
StdUtils.browse("http://www.grigoriliev.com"); |
118 |
} |
} |
119 |
}); |
}); |
120 |
|
|
210 |
btn.addActionListener(new ActionListener() { |
btn.addActionListener(new ActionListener() { |
211 |
public void |
public void |
212 |
actionPerformed(ActionEvent e) { |
actionPerformed(ActionEvent e) { |
213 |
browse("http://swingx.dev.java.net/"); |
StdUtils.browse("http://swingx.dev.java.net/"); |
214 |
} |
} |
215 |
}); |
}); |
216 |
|
|
224 |
btn.addActionListener(new ActionListener() { |
btn.addActionListener(new ActionListener() { |
225 |
public void |
public void |
226 |
actionPerformed(ActionEvent e) { |
actionPerformed(ActionEvent e) { |
227 |
browse("http://substance.dev.java.net/"); |
StdUtils.browse("http://substance.dev.java.net/"); |
228 |
} |
} |
229 |
}); |
}); |
230 |
|
|
237 |
btn.addActionListener(new ActionListener() { |
btn.addActionListener(new ActionListener() { |
238 |
public void |
public void |
239 |
actionPerformed(ActionEvent e) { |
actionPerformed(ActionEvent e) { |
240 |
browse("http://sourceforge.net/projects/jlscp/"); |
StdUtils.browse("http://sourceforge.net/projects/jlscp/"); |
241 |
} |
} |
242 |
}); |
}); |
243 |
|
|
250 |
btn.addActionListener(new ActionListener() { |
btn.addActionListener(new ActionListener() { |
251 |
public void |
public void |
252 |
actionPerformed(ActionEvent e) { |
actionPerformed(ActionEvent e) { |
253 |
browse("http://substance-swingx.dev.java.net/"); |
StdUtils.browse("http://substance-swingx.dev.java.net/"); |
254 |
} |
} |
255 |
}); |
}); |
256 |
|
|
263 |
btn.addActionListener(new ActionListener() { |
btn.addActionListener(new ActionListener() { |
264 |
public void |
public void |
265 |
actionPerformed(ActionEvent e) { |
actionPerformed(ActionEvent e) { |
266 |
browse("http://sourceforge.net/projects/juife/"); |
StdUtils.browse("http://sourceforge.net/projects/juife/"); |
267 |
} |
} |
268 |
}); |
}); |
269 |
|
|
286 |
new LicenseDlg(this, license).setVisible(true); |
new LicenseDlg(this, license).setVisible(true); |
287 |
} |
} |
288 |
|
|
|
private boolean |
|
|
checkDesktopSupported() { |
|
|
if(Desktop.isDesktopSupported()) return true; |
|
|
|
|
|
HF.showErrorMessage(i18n.getError("HelpAboutDlg.DesktopApiNotSupported"), this); |
|
|
|
|
|
return false; |
|
|
} |
|
|
|
|
|
private void |
|
|
browse(String uri) { |
|
|
if(!checkDesktopSupported()) return; |
|
|
|
|
|
try { Desktop.getDesktop().browse(new URI(uri)); } |
|
|
catch(Exception x) { x.printStackTrace(); } |
|
|
} |
|
|
|
|
|
private void |
|
|
mail(String uri) { |
|
|
if(!checkDesktopSupported()) return; |
|
|
|
|
|
Desktop desktop = Desktop.getDesktop(); |
|
|
|
|
|
try { Desktop.getDesktop().mail(new URI(uri)); } |
|
|
catch(Exception x) { x.printStackTrace(); } |
|
|
} |
|
|
|
|
289 |
class ContactInfoPane extends JPanel { |
class ContactInfoPane extends JPanel { |
290 |
private JLabel lAuthorEmail = |
private JLabel lAuthorEmail = |
291 |
new JLabel(i18n.getLabel("HelpAboutDlg.lAuthorEmail")); |
new JLabel(i18n.getLabel("HelpAboutDlg.lAuthorEmail")); |
296 |
private Lnkbutton btnLSWebsite = new Lnkbutton("www.linuxsampler.org"); |
private Lnkbutton btnLSWebsite = new Lnkbutton("www.linuxsampler.org"); |
297 |
private Lnkbutton btnJSWebsite = new Lnkbutton("sf.net/projects/jsampler"); |
private Lnkbutton btnJSWebsite = new Lnkbutton("sf.net/projects/jsampler"); |
298 |
|
|
299 |
|
private Button btnDocumentation = |
300 |
|
new Button(i18n.getButtonLabel("HelpAboutDlg.btnDocumentation")); |
301 |
|
|
302 |
|
private Button btnLSDevelopers = |
303 |
|
new Button(i18n.getButtonLabel("HelpAboutDlg.btnLSDevelopers")); |
304 |
|
|
305 |
private Button btnLSMailingList = |
private Button btnLSMailingList = |
306 |
new Button(i18n.getButtonLabel("HelpAboutDlg.btnLSMailingList")); |
new Button(i18n.getButtonLabel("HelpAboutDlg.btnLSMailingList")); |
307 |
|
|
351 |
c.gridwidth = 2; |
c.gridwidth = 2; |
352 |
c.insets = new Insets(12, 0, 0, 0); |
c.insets = new Insets(12, 0, 0, 0); |
353 |
c.anchor = GridBagConstraints.CENTER; |
c.anchor = GridBagConstraints.CENTER; |
354 |
|
gridbag.setConstraints(btnDocumentation, c); |
355 |
|
add(btnDocumentation); |
356 |
|
|
357 |
|
c.gridx = 0; |
358 |
|
c.gridy = 4; |
359 |
|
c.insets = new Insets(6, 0, 0, 0); |
360 |
|
gridbag.setConstraints(btnLSDevelopers, c); |
361 |
|
add(btnLSDevelopers); |
362 |
|
|
363 |
|
c.gridx = 0; |
364 |
|
c.gridy = 5; |
365 |
gridbag.setConstraints(btnLSMailingList, c); |
gridbag.setConstraints(btnLSMailingList, c); |
366 |
add(btnLSMailingList); |
add(btnLSMailingList); |
367 |
|
|
372 |
btnAuthorEmail.addActionListener(new ActionListener() { |
btnAuthorEmail.addActionListener(new ActionListener() { |
373 |
public void |
public void |
374 |
actionPerformed(ActionEvent e) { |
actionPerformed(ActionEvent e) { |
375 |
browse("mailto:grigor@grigoriliev.com"); |
StdUtils.browse("mailto:grigor@grigoriliev.com"); |
376 |
} |
} |
377 |
}); |
}); |
378 |
|
|
379 |
btnLSWebsite.addActionListener(new ActionListener() { |
btnLSWebsite.addActionListener(new ActionListener() { |
380 |
public void |
public void |
381 |
actionPerformed(ActionEvent e) { |
actionPerformed(ActionEvent e) { |
382 |
browse("http://www.linuxsampler.org"); |
StdUtils.browse("http://www.linuxsampler.org"); |
383 |
} |
} |
384 |
}); |
}); |
385 |
|
|
386 |
btnJSWebsite.addActionListener(new ActionListener() { |
btnJSWebsite.addActionListener(new ActionListener() { |
387 |
public void |
public void |
388 |
actionPerformed(ActionEvent e) { |
actionPerformed(ActionEvent e) { |
389 |
browse("http://sf.net/projects/jsampler/"); |
StdUtils.browse("http://sf.net/projects/jsampler/"); |
390 |
|
} |
391 |
|
}); |
392 |
|
|
393 |
|
btnDocumentation.addActionListener(new ActionListener() { |
394 |
|
public void |
395 |
|
actionPerformed(ActionEvent e) { |
396 |
|
StdUtils.browse("http://www.linuxsampler.org/documentation.html"); |
397 |
|
} |
398 |
|
}); |
399 |
|
|
400 |
|
btnLSDevelopers.addActionListener(new ActionListener() { |
401 |
|
public void |
402 |
|
actionPerformed(ActionEvent e) { |
403 |
|
StdUtils.browse("http://www.linuxsampler.org/developers.html"); |
404 |
} |
} |
405 |
}); |
}); |
406 |
|
|
407 |
btnLSMailingList.addActionListener(new ActionListener() { |
btnLSMailingList.addActionListener(new ActionListener() { |
408 |
public void |
public void |
409 |
actionPerformed(ActionEvent e) { |
actionPerformed(ActionEvent e) { |
410 |
browse("http://lists.sourceforge.net/lists/listinfo/linuxsampler-devel"); |
StdUtils.browse("http://lists.sourceforge.net/lists/listinfo/linuxsampler-devel"); |
411 |
} |
} |
412 |
}); |
}); |
413 |
} |
} |