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 |
* |
* |
32 |
import javax.swing.BorderFactory; |
import javax.swing.BorderFactory; |
33 |
import javax.swing.Box; |
import javax.swing.Box; |
34 |
import javax.swing.BoxLayout; |
import javax.swing.BoxLayout; |
|
import javax.swing.ImageIcon; |
|
35 |
import javax.swing.JLabel; |
import javax.swing.JLabel; |
36 |
import javax.swing.JPanel; |
import javax.swing.JPanel; |
37 |
import javax.swing.JTextField; |
import javax.swing.JTextField; |
38 |
|
|
|
import javax.swing.border.EtchedBorder; |
|
|
|
|
39 |
import net.sf.juife.InformationDialog; |
import net.sf.juife.InformationDialog; |
40 |
|
|
41 |
import org.jsampler.CC; |
import org.jsampler.CC; |
50 |
* @author Grigor Iliev |
* @author Grigor Iliev |
51 |
*/ |
*/ |
52 |
public class SamplerInfoDlg extends InformationDialog { |
public class SamplerInfoDlg extends InformationDialog { |
53 |
private final static ImageIcon iconLinuxSamplerLogo; |
private final JLabel lLinuxSamplerLogo = new JLabel(Res.iconLinuxSamplerLogo); |
|
|
|
|
static { |
|
|
java.net.URL url; |
|
|
url = ClassLoader.getSystemClassLoader().getResource ( |
|
|
"org/jsampler/view/classic/res/LinuxSampler-logo.png" |
|
|
); |
|
|
iconLinuxSamplerLogo = new ImageIcon(url); |
|
|
} |
|
|
|
|
|
private final JLabel lLinuxSamplerLogo = new JLabel(iconLinuxSamplerLogo); |
|
54 |
private final JLabel lDescription = new JLabel(); |
private final JLabel lDescription = new JLabel(); |
55 |
private final JLabel lVersion = new JLabel(i18n.getLabel("SamplerInfoDlg.lVersion")); |
private final JLabel lVersion = new JLabel(i18n.getLabel("SamplerInfoDlg.lVersion")); |
56 |
private final JLabel lProtocolVersion = |
private final JLabel lProtocolVersion = |
57 |
new JLabel(i18n.getLabel("SamplerInfoDlg.lProtocolVersion")); |
new JLabel(i18n.getLabel("SamplerInfoDlg.lProtocolVersion")); |
58 |
|
|
59 |
|
private final JLabel lDbSupport = new JLabel(i18n.getLabel("SamplerInfoDlg.lDbSupport")); |
60 |
private final JTextField tfVersion = new JTextField(); |
private final JTextField tfVersion = new JTextField(); |
61 |
private final JTextField tfProtocolVersion = new JTextField(); |
private final JTextField tfProtocolVersion = new JTextField(); |
62 |
|
private final JTextField tfDbSupport = new JTextField(); |
63 |
|
|
64 |
|
|
65 |
/** Creates a new instance of SamplerInfoDlg */ |
/** Creates a new instance of SamplerInfoDlg */ |
81 |
lDescription.setText(si.getDescription()); |
lDescription.setText(si.getDescription()); |
82 |
tfVersion.setText(si.getVersion()); |
tfVersion.setText(si.getVersion()); |
83 |
tfProtocolVersion.setText(si.getProtocolVersion()); |
tfProtocolVersion.setText(si.getProtocolVersion()); |
84 |
|
if(si.hasInstrumentsDbSupport()) { |
85 |
|
tfDbSupport.setText(i18n.getButtonLabel("yes")); |
86 |
|
} else { |
87 |
|
tfDbSupport.setText(i18n.getButtonLabel("no")); |
88 |
|
} |
89 |
|
|
90 |
tfVersion.setEditable(false); |
tfVersion.setEditable(false); |
91 |
|
tfVersion.setOpaque(false); |
92 |
tfVersion.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
tfVersion.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
93 |
|
|
94 |
tfProtocolVersion.setEditable(false); |
tfProtocolVersion.setEditable(false); |
95 |
|
tfProtocolVersion.setOpaque(false); |
96 |
tfProtocolVersion.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
tfProtocolVersion.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
97 |
|
|
98 |
|
tfDbSupport.setEditable(false); |
99 |
|
tfDbSupport.setOpaque(false); |
100 |
|
tfDbSupport.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
101 |
|
|
102 |
|
|
103 |
JPanel infoPane = new JPanel(); |
JPanel infoPane = new JPanel(); |
104 |
|
|
105 |
GridBagLayout gridbag = new GridBagLayout(); |
GridBagLayout gridbag = new GridBagLayout(); |
106 |
GridBagConstraints c = new GridBagConstraints(); |
GridBagConstraints c = new GridBagConstraints(); |
107 |
|
|
|
/*lText.setFont(lText.getFont().deriveFont(java.awt.Font.PLAIN)); |
|
|
|
|
|
ServerInfo si = CC.getSamplerModel().getServerInfo(); |
|
|
|
|
|
if(si == null) lText.setText( JSI18n.getLabel("SamplerInfoDlg.unavailable")); |
|
|
else lText.setText ( |
|
|
"<html>\n" + |
|
|
"<h3>" + si.getDescription() + "</h3><br>" + |
|
|
"<table border=0 align=left>" + |
|
|
"<tr> <th align=right>Version:</th> <td align=left>" + si.getVersion() + "</td> </tr>" + |
|
|
"<tr> <th align=right>Protocol Version:</th> <td align=left>" + si.getProtocolVersion()+ "</td> </tr>" + |
|
|
"</table>" |
|
|
); |
|
|
|
|
|
mainPane.add(lText); |
|
|
*/ |
|
108 |
infoPane.setLayout(gridbag); |
infoPane.setLayout(gridbag); |
109 |
|
|
110 |
c.gridx = 0; |
c.gridx = 0; |
119 |
gridbag.setConstraints(lProtocolVersion, c); |
gridbag.setConstraints(lProtocolVersion, c); |
120 |
infoPane.add(lProtocolVersion); |
infoPane.add(lProtocolVersion); |
121 |
|
|
122 |
|
c.gridx = 0; |
123 |
|
c.gridy = 2; |
124 |
|
gridbag.setConstraints(lDbSupport, c); |
125 |
|
infoPane.add(lDbSupport); |
126 |
|
|
127 |
c.gridx = 1; |
c.gridx = 1; |
128 |
c.gridy = 0; |
c.gridy = 0; |
129 |
|
c.weightx = 1.0; |
130 |
|
c.fill = GridBagConstraints.HORIZONTAL; |
131 |
c.anchor = GridBagConstraints.WEST; |
c.anchor = GridBagConstraints.WEST; |
132 |
gridbag.setConstraints(tfVersion, c); |
gridbag.setConstraints(tfVersion, c); |
133 |
infoPane.add(tfVersion); |
infoPane.add(tfVersion); |
137 |
gridbag.setConstraints(tfProtocolVersion, c); |
gridbag.setConstraints(tfProtocolVersion, c); |
138 |
infoPane.add(tfProtocolVersion); |
infoPane.add(tfProtocolVersion); |
139 |
|
|
140 |
|
c.gridx = 1; |
141 |
|
c.gridy = 2; |
142 |
|
gridbag.setConstraints(tfDbSupport, c); |
143 |
|
infoPane.add(tfDbSupport); |
144 |
|
|
145 |
//infoPane.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED)); |
//infoPane.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED)); |
146 |
infoPane.setMaximumSize(infoPane.getPreferredSize()); |
infoPane.setMaximumSize(infoPane.getPreferredSize()); |
147 |
|
|