31 |
import java.awt.event.HierarchyListener; |
import java.awt.event.HierarchyListener; |
32 |
import java.awt.event.MouseAdapter; |
import java.awt.event.MouseAdapter; |
33 |
import java.awt.event.MouseEvent; |
import java.awt.event.MouseEvent; |
34 |
|
import java.awt.event.MouseListener; |
35 |
|
|
36 |
import java.beans.PropertyChangeEvent; |
import java.beans.PropertyChangeEvent; |
37 |
import java.beans.PropertyChangeListener; |
import java.beans.PropertyChangeListener; |
38 |
|
|
39 |
|
import java.util.Vector; |
40 |
|
|
41 |
import javax.swing.Action; |
import javax.swing.Action; |
42 |
import javax.swing.BorderFactory; |
import javax.swing.BorderFactory; |
43 |
import javax.swing.Box; |
import javax.swing.Box; |
48 |
import javax.swing.JMenuItem; |
import javax.swing.JMenuItem; |
49 |
import javax.swing.JPanel; |
import javax.swing.JPanel; |
50 |
import javax.swing.JPopupMenu; |
import javax.swing.JPopupMenu; |
|
import javax.swing.Timer; |
|
51 |
|
|
52 |
import javax.swing.event.ChangeEvent; |
import javax.swing.event.ChangeEvent; |
53 |
import javax.swing.event.ChangeListener; |
import javax.swing.event.ChangeListener; |
72 |
* |
* |
73 |
* @author Grigor Iliev |
* @author Grigor Iliev |
74 |
*/ |
*/ |
75 |
public class NormalChannelView extends JPanel implements ChannelView { |
public class NormalChannelView extends PixmapPane implements ChannelView { |
76 |
private final Channel channel; |
private final Channel channel; |
77 |
private final ChannelOptionsView channelOptionsView; |
private ChannelOptionsView channelOptionsView = null; |
78 |
|
|
79 |
private final EnhancedDial dialVolume = new EnhancedDial(); |
private final EnhancedDial dialVolume = new EnhancedDial(); |
80 |
private final ChannelScreen screen; |
private final ChannelScreen screen; |
84 |
private final SoloButton btnSolo = new SoloButton(); |
private final SoloButton btnSolo = new SoloButton(); |
85 |
private final Channel.OptionsButton btnOptions; |
private final Channel.OptionsButton btnOptions; |
86 |
|
|
87 |
|
private final Vector<JComponent> components = new Vector<JComponent>(); |
88 |
|
|
|
/** Creates a new instance of <code>NormalChannelView</code> */ |
|
|
public |
|
|
NormalChannelView(Channel channel) { |
|
|
this(channel, new NormalChannelOptionsView(channel)); |
|
|
} |
|
89 |
|
|
90 |
/** Creates a new instance of <code>NormalChannelView</code> */ |
/** Creates a new instance of <code>NormalChannelView</code> */ |
91 |
public |
public |
92 |
NormalChannelView(Channel channel, ChannelOptionsView channelOptionsView) { |
NormalChannelView(Channel channel) { |
93 |
this.channel = channel; |
super(Res.gfxChannel); |
94 |
this.channelOptionsView = channelOptionsView; |
setPixmapInsets(new Insets(3, 3, 3, 3)); |
95 |
|
|
96 |
addMouseListener(channel.getContextMenu()); |
components.add(this); |
97 |
|
|
98 |
|
this.channel = channel; |
99 |
|
|
100 |
btnPower = new Channel.PowerButton(channel); |
btnPower = new Channel.PowerButton(channel); |
101 |
|
components.add(btnPower); |
102 |
btnOptions = new Channel.OptionsButton(channel); |
btnOptions = new Channel.OptionsButton(channel); |
103 |
|
components.add(btnOptions); |
|
setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); |
|
104 |
|
|
105 |
screen = new ChannelScreen(channel); |
screen = new ChannelScreen(channel); |
106 |
ChannelPane p = new ChannelPane(); |
setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); |
|
p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS)); |
|
|
|
|
|
//p.add(Box.createRigidArea(new Dimension(3, 0))); |
|
107 |
|
|
108 |
btnPower.setAlignmentY(JPanel.TOP_ALIGNMENT); |
btnPower.setAlignmentY(JPanel.TOP_ALIGNMENT); |
109 |
|
|
110 |
JPanel tb = new JPanel(); |
JPanel tb = new JPanel(); |
111 |
|
components.add(tb); |
112 |
tb.setBorder(BorderFactory.createEmptyBorder(3, 3, 0, 4)); |
tb.setBorder(BorderFactory.createEmptyBorder(3, 3, 0, 4)); |
113 |
tb.setLayout(new BoxLayout(tb, BoxLayout.X_AXIS)); |
tb.setLayout(new BoxLayout(tb, BoxLayout.X_AXIS)); |
114 |
tb.setOpaque(false); |
tb.setOpaque(false); |
117 |
tb.setPreferredSize(new Dimension(tb.getPreferredSize().width, 58)); |
tb.setPreferredSize(new Dimension(tb.getPreferredSize().width, 58)); |
118 |
tb.setMinimumSize(tb.getPreferredSize()); |
tb.setMinimumSize(tb.getPreferredSize()); |
119 |
tb.setMaximumSize(tb.getPreferredSize()); |
tb.setMaximumSize(tb.getPreferredSize()); |
120 |
p.add(tb); |
add(tb); |
121 |
|
|
122 |
//p.add(Box.createRigidArea(new Dimension(4, 0))); |
//p.add(Box.createRigidArea(new Dimension(4, 0))); |
123 |
|
|
124 |
p.add(createVSeparator()); |
add(createVSeparator()); |
125 |
|
|
126 |
//p.add(Box.createRigidArea(new Dimension(3, 0))); |
//p.add(Box.createRigidArea(new Dimension(3, 0))); |
127 |
|
|
128 |
JPanel p2 = new JPanel(); |
JPanel p2 = new JPanel(); |
129 |
|
components.add(p2); |
130 |
p2.setOpaque(false); |
p2.setOpaque(false); |
131 |
p2.setLayout(new BoxLayout(p2, BoxLayout.Y_AXIS)); |
p2.setLayout(new BoxLayout(p2, BoxLayout.Y_AXIS)); |
132 |
p2.setAlignmentY(JPanel.TOP_ALIGNMENT); |
p2.setAlignmentY(JPanel.TOP_ALIGNMENT); |
133 |
p2.setBorder(BorderFactory.createEmptyBorder(5, 3, 0, 2)); |
p2.setBorder(BorderFactory.createEmptyBorder(5, 3, 0, 2)); |
134 |
p2.add(screen); |
p2.add(screen); |
135 |
p.add(p2); |
add(p2); |
136 |
|
|
137 |
p.add(createVSeparator()); |
add(createVSeparator()); |
138 |
|
|
139 |
p2 = new JPanel(); |
p2 = new JPanel(); |
140 |
|
components.add(p2); |
141 |
p2.setOpaque(false); |
p2.setOpaque(false); |
142 |
p2.setLayout(new BoxLayout(p2, BoxLayout.Y_AXIS)); |
p2.setLayout(new BoxLayout(p2, BoxLayout.Y_AXIS)); |
143 |
p2.setAlignmentY(JPanel.TOP_ALIGNMENT); |
p2.setAlignmentY(JPanel.TOP_ALIGNMENT); |
144 |
p2.setBorder(BorderFactory.createEmptyBorder(4, 0, 0, 0)); |
p2.setBorder(BorderFactory.createEmptyBorder(4, 0, 0, 0)); |
145 |
p2.add(new JLabel(Res.gfxMuteTitle)); |
|
146 |
|
JLabel l = new JLabel(Res.gfxMuteTitle); |
147 |
|
components.add(l); |
148 |
|
p2.add(l); |
149 |
|
components.add(btnMute); |
150 |
p2.add(btnMute); |
p2.add(btnMute); |
151 |
p2.add(new JLabel(Res.gfxSoloTitle)); |
|
152 |
|
l = new JLabel(Res.gfxSoloTitle); |
153 |
|
components.add(l); |
154 |
|
p2.add(l); |
155 |
|
|
156 |
|
components.add(btnSolo); |
157 |
p2.add(btnSolo); |
p2.add(btnSolo); |
158 |
|
|
159 |
p.add(p2); |
add(p2); |
160 |
|
|
161 |
p.add(createVSeparator()); |
add(createVSeparator()); |
162 |
|
|
163 |
p2 = new JPanel(); |
p2 = new JPanel(); |
164 |
|
components.add(p2); |
165 |
p2.setOpaque(false); |
p2.setOpaque(false); |
166 |
p2.setLayout(new BoxLayout(p2, BoxLayout.Y_AXIS)); |
p2.setLayout(new BoxLayout(p2, BoxLayout.Y_AXIS)); |
167 |
p2.setAlignmentY(JPanel.TOP_ALIGNMENT); |
p2.setAlignmentY(JPanel.TOP_ALIGNMENT); |
168 |
p2.setBorder(BorderFactory.createEmptyBorder(4, 0, 0, 0)); |
p2.setBorder(BorderFactory.createEmptyBorder(4, 0, 0, 0)); |
169 |
JLabel l = new JLabel(Res.gfxVolumeTitle); |
l = new JLabel(Res.gfxVolumeTitle); |
170 |
|
components.add(l); |
171 |
l.setAlignmentX(JPanel.CENTER_ALIGNMENT); |
l.setAlignmentX(JPanel.CENTER_ALIGNMENT); |
172 |
l.setBorder(BorderFactory.createEmptyBorder(0, 0, 2, 0)); |
l.setBorder(BorderFactory.createEmptyBorder(0, 0, 2, 0)); |
173 |
p2.add(l); |
p2.add(l); |
174 |
|
|
175 |
|
components.add(dialVolume); |
176 |
dialVolume.setDialPixmap(Res.gfxVolumeDial, 30, 330); |
dialVolume.setDialPixmap(Res.gfxVolumeDial, 30, 330); |
177 |
dialVolume.setAlignmentX(JPanel.CENTER_ALIGNMENT); |
dialVolume.setAlignmentX(JPanel.CENTER_ALIGNMENT); |
178 |
p2.add(dialVolume); |
p2.add(dialVolume); |
179 |
p.add(p2); |
add(p2); |
180 |
|
|
181 |
p.add(createVSeparator()); |
add(createVSeparator()); |
182 |
|
|
183 |
p2 = new JPanel(); |
p2 = new JPanel(); |
184 |
|
components.add(p2); |
185 |
p2.setOpaque(false); |
p2.setOpaque(false); |
186 |
p2.setLayout(new BoxLayout(p2, BoxLayout.Y_AXIS)); |
p2.setLayout(new BoxLayout(p2, BoxLayout.Y_AXIS)); |
187 |
p2.setAlignmentY(JPanel.TOP_ALIGNMENT); |
p2.setAlignmentY(JPanel.TOP_ALIGNMENT); |
188 |
p2.setBorder(BorderFactory.createEmptyBorder(27, 0, 0, 0)); |
p2.setBorder(BorderFactory.createEmptyBorder(27, 0, 0, 0)); |
189 |
l = new JLabel(Res.gfxOptionsTitle); |
l = new JLabel(Res.gfxOptionsTitle); |
190 |
|
components.add(l); |
191 |
l.setAlignmentX(JPanel.CENTER_ALIGNMENT); |
l.setAlignmentX(JPanel.CENTER_ALIGNMENT); |
192 |
l.setBorder(BorderFactory.createEmptyBorder(0, 0, 2, 0)); |
l.setBorder(BorderFactory.createEmptyBorder(0, 0, 2, 0)); |
193 |
p2.add(l); |
p2.add(l); |
196 |
|
|
197 |
btnOptions.setAlignmentX(JPanel.CENTER_ALIGNMENT); |
btnOptions.setAlignmentX(JPanel.CENTER_ALIGNMENT); |
198 |
p2.add(btnOptions); |
p2.add(btnOptions); |
199 |
p.add(p2); |
add(p2); |
200 |
|
|
201 |
|
|
202 |
p.setPreferredSize(new Dimension(420, 60)); |
setPreferredSize(new Dimension(420, 60)); |
203 |
p.setMinimumSize(p.getPreferredSize()); |
setMinimumSize(getPreferredSize()); |
204 |
p.setMaximumSize(p.getPreferredSize()); |
setMaximumSize(getPreferredSize()); |
205 |
//p.setBorder(BorderFactory.createEmptyBorder(1, 0, 1, 0)); |
//p.setBorder(BorderFactory.createEmptyBorder(1, 0, 1, 0)); |
206 |
|
|
207 |
p.setAlignmentX(JPanel.CENTER_ALIGNMENT); |
setAlignmentX(JPanel.CENTER_ALIGNMENT); |
|
|
|
|
add(p); |
|
208 |
|
|
209 |
installView(); |
installView(); |
210 |
} |
} |
213 |
// Implementation of the ChannelView interface |
// Implementation of the ChannelView interface |
214 |
////////////////////////////////////////////// |
////////////////////////////////////////////// |
215 |
|
|
216 |
|
public Type |
217 |
|
getType() { return Type.NORMAL; } |
218 |
|
|
219 |
public JComponent |
public JComponent |
220 |
getComponent() { return this; } |
getComponent() { return this; } |
221 |
|
|
230 |
screen.updateVolumeInfo(dialVolume.getValue()); |
screen.updateVolumeInfo(dialVolume.getValue()); |
231 |
} |
} |
232 |
}); |
}); |
233 |
|
|
234 |
|
screen.installListeners(); |
235 |
|
|
236 |
|
addEnhancedMouseListener(channel.getContextMenu()); |
237 |
} |
} |
238 |
|
|
239 |
public void |
public void |
240 |
uninstallView() { |
uninstallView() { |
241 |
screen.onDestroy(); |
screen.onDestroy(); |
242 |
|
btnOptions.onDestroy(); |
243 |
|
uninstallChannelOptionsView(); |
244 |
|
//removeEnhancedMouseListener(channel.getContextMenu()); |
245 |
|
} |
246 |
|
|
247 |
|
public void |
248 |
|
installChannelOptionsView() { |
249 |
|
if(channelOptionsView != null) return; |
250 |
|
|
251 |
|
channelOptionsView = new NormalChannelOptionsView(channel); |
252 |
|
channelOptionsView.installView(); |
253 |
|
|
254 |
|
} |
255 |
|
|
256 |
|
public void |
257 |
|
uninstallChannelOptionsView() { |
258 |
|
if(channelOptionsView == null) return; |
259 |
|
channelOptionsView.uninstallView(); |
260 |
|
channelOptionsView = null; |
261 |
} |
} |
262 |
|
|
263 |
public ChannelOptionsView |
public ChannelOptionsView |
280 |
dialVolume.setEnabled(b); |
dialVolume.setEnabled(b); |
281 |
btnSolo.setEnabled(b); |
btnSolo.setEnabled(b); |
282 |
btnMute.setEnabled(b); |
btnMute.setEnabled(b); |
283 |
|
|
284 |
|
if(getChannelOptionsView() != null) getChannelOptionsView().updateChannelInfo(); |
285 |
} |
} |
286 |
|
|
287 |
public void |
public void |
296 |
btnOptions.doClick(); |
btnOptions.doClick(); |
297 |
} |
} |
298 |
|
|
299 |
|
public boolean |
300 |
|
isOptionsButtonSelected() { return btnOptions.isSelected(); } |
301 |
|
|
302 |
|
public void |
303 |
|
setOptionsButtonSelected(boolean b) { |
304 |
|
btnOptions.setSelected(b); |
305 |
|
} |
306 |
|
|
307 |
|
public void |
308 |
|
addEnhancedMouseListener(MouseListener l) { |
309 |
|
removeEnhancedMouseListener(l); |
310 |
|
|
311 |
|
for(JComponent c : components) c.addMouseListener(l); |
312 |
|
screen.addEnhancedMouseListener(l); |
313 |
|
} |
314 |
|
|
315 |
|
public void |
316 |
|
removeEnhancedMouseListener(MouseListener l) { |
317 |
|
for(JComponent c : components) c.removeMouseListener(l); |
318 |
|
screen.removeEnhancedMouseListener(l); |
319 |
|
} |
320 |
|
|
321 |
////////////////////////////////////////////// |
////////////////////////////////////////////// |
322 |
|
|
323 |
|
|
476 |
} |
} |
477 |
|
|
478 |
|
|
|
|
|
|
class ChannelPane extends PixmapPane { |
|
|
ChannelPane() { |
|
|
super(Res.gfxChannel); |
|
|
setPixmapInsets(new Insets(3, 3, 3, 3)); |
|
|
} |
|
|
} |
|
|
|
|
479 |
class ChannelScreen extends PixmapPane { |
class ChannelScreen extends PixmapPane { |
480 |
private final Channel channel; |
private final Channel channel; |
481 |
|
|
500 |
|
|
501 |
private final JPopupMenu menuEngines = new JPopupMenu(); |
private final JPopupMenu menuEngines = new JPopupMenu(); |
502 |
|
|
503 |
private Timer timer; |
private final ActionListener guiListener; |
504 |
|
|
505 |
|
private final Vector<JComponent> components = new Vector<JComponent>(); |
506 |
|
|
507 |
ChannelScreen(final Channel channel) { |
ChannelScreen(final Channel channel) { |
508 |
super(Res.gfxChannelScreen); |
super(Res.gfxChannelScreen); |
509 |
setPixmapInsets(new Insets(6, 6, 6, 6)); |
setPixmapInsets(new Insets(6, 6, 6, 6)); |
510 |
setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); |
setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); |
511 |
|
|
512 |
|
components.add(this); |
513 |
|
|
514 |
this.channel = channel; |
this.channel = channel; |
515 |
addMouseListener(channel.getContextMenu()); |
|
516 |
streamVoiceCountPane = new Channel.StreamVoiceCountPane(channel); |
streamVoiceCountPane = new Channel.StreamVoiceCountPane(channel); |
517 |
|
components.add(streamVoiceCountPane); |
518 |
|
|
519 |
volumePane = new Channel.VolumePane(channel); |
volumePane = new Channel.VolumePane(channel); |
520 |
|
components.add(volumePane); |
521 |
|
|
522 |
setOpaque(false); |
setOpaque(false); |
523 |
|
|
526 |
btnInstr.setAlignmentX(CENTER_ALIGNMENT); |
btnInstr.setAlignmentX(CENTER_ALIGNMENT); |
527 |
btnInstr.setRolloverEnabled(false); |
btnInstr.setRolloverEnabled(false); |
528 |
btnInstr.setBorder(BorderFactory.createEmptyBorder(3, 0, 0, 0)); |
btnInstr.setBorder(BorderFactory.createEmptyBorder(3, 0, 0, 0)); |
529 |
btnInstr.addMouseListener(channel.getContextMenu()); |
components.add(btnInstr); |
530 |
|
|
531 |
instrumentPane = new InstrumentPane(); |
instrumentPane = new InstrumentPane(); |
532 |
|
components.add(instrumentPane); |
533 |
add(instrumentPane); |
add(instrumentPane); |
534 |
|
|
535 |
|
add(Box.createRigidArea(new Dimension(0, 3))); |
536 |
|
|
537 |
JPanel p = new JPanel(); |
JPanel p = new JPanel(); |
538 |
|
components.add(p); |
539 |
p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS)); |
p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS)); |
540 |
p.setAlignmentX(CENTER_ALIGNMENT); |
p.setAlignmentX(CENTER_ALIGNMENT); |
541 |
p.setBorder(BorderFactory.createEmptyBorder(5, 2, 0, 0)); |
p.setBorder(BorderFactory.createEmptyBorder(5, 2, 0, 0)); |
542 |
|
|
543 |
|
components.add(btnFxSends); |
544 |
btnFxSends.setToolTipText(i18n.getButtonLabel("ChannelScreen.btnFxSends.tt")); |
btnFxSends.setToolTipText(i18n.getButtonLabel("ChannelScreen.btnFxSends.tt")); |
545 |
btnFxSends.addActionListener(new ActionListener() { |
btnFxSends.addActionListener(new ActionListener() { |
546 |
public void |
public void |
549 |
} |
} |
550 |
}); |
}); |
551 |
|
|
|
btnFxSends.addMouseListener(channel.getContextMenu()); |
|
|
|
|
552 |
p.add(btnFxSends); |
p.add(btnFxSends); |
553 |
|
|
554 |
//p.add(Box.createRigidArea(new Dimension(6, 0))); |
//p.add(Box.createRigidArea(new Dimension(6, 0))); |
555 |
p.add(Box.createGlue()); |
p.add(Box.createGlue()); |
556 |
|
|
557 |
|
components.add(btnEngine); |
558 |
btnEngine.setIcon(Res.iconEngine12); |
btnEngine.setIcon(Res.iconEngine12); |
559 |
btnEngine.setIconTextGap(1); |
btnEngine.setIconTextGap(1); |
|
btnEngine.addMouseListener(channel.getContextMenu()); |
|
560 |
p.add(btnEngine); |
p.add(btnEngine); |
561 |
//p.add(new Label("|")); |
//p.add(new Label("|")); |
562 |
|
|
583 |
setMaximumSize(getPreferredSize()); |
setMaximumSize(getPreferredSize()); |
584 |
|
|
585 |
createEngineMenu(); |
createEngineMenu(); |
586 |
installListeners(); |
|
587 |
|
guiListener = new ActionListener() { |
588 |
|
public void |
589 |
|
actionPerformed(ActionEvent e) { |
590 |
|
if(getMousePosition(true) != null) { |
591 |
|
getHandler().mouseEntered(null); |
592 |
|
} else { |
593 |
|
getHandler().mouseExited(null); |
594 |
|
} |
595 |
|
} |
596 |
|
}; |
597 |
|
} |
598 |
|
|
599 |
|
public void |
600 |
|
addEnhancedMouseListener(MouseListener l) { |
601 |
|
removeEnhancedMouseListener(l); |
602 |
|
for(JComponent c : components) c.addMouseListener(l); |
603 |
|
} |
604 |
|
|
605 |
|
public void |
606 |
|
removeEnhancedMouseListener(MouseListener l) { |
607 |
|
for(JComponent c : components) c.removeMouseListener(l); |
608 |
} |
} |
609 |
|
|
610 |
protected void |
protected void |
611 |
onDestroy() { timer.stop(); } |
onDestroy() { uninstallListeners(); } |
612 |
|
|
613 |
private void |
private void |
614 |
createEngineMenu() { |
createEngineMenu() { |
627 |
} |
} |
628 |
} |
} |
629 |
|
|
630 |
private void |
protected void |
631 |
installListeners() { |
installListeners() { |
632 |
btnInstr.addActionListener(new ActionListener() { |
btnInstr.addActionListener(new ActionListener() { |
633 |
public void |
public void |
652 |
addMouseListener(getHandler()); |
addMouseListener(getHandler()); |
653 |
addHierarchyListener(getHandler()); |
addHierarchyListener(getHandler()); |
654 |
|
|
655 |
ActionListener l = new ActionListener() { |
((MainFrame)CC.getMainFrame()).getGuiTimer().addActionListener(guiListener); |
656 |
public void |
} |
657 |
actionPerformed(ActionEvent e) { |
|
658 |
if(getMousePosition(true) != null) { |
private void |
659 |
getHandler().mouseEntered(null); |
uninstallListeners() { |
660 |
} else { |
((MainFrame)CC.getMainFrame()).getGuiTimer().removeActionListener(guiListener); |
|
getHandler().mouseExited(null); |
|
|
} |
|
|
} |
|
|
}; |
|
|
timer = new Timer(1000, l); |
|
|
timer.start(); |
|
661 |
} |
} |
662 |
|
|
663 |
protected void |
protected void |
664 |
updateScreenInfo(SamplerChannel sc) { |
updateScreenInfo(SamplerChannel sc) { |
665 |
|
String s = btnInstr.getToolTipText(); |
666 |
|
|
667 |
int status = sc.getInstrumentStatus(); |
int status = sc.getInstrumentStatus(); |
668 |
if(status >= 0 && status < 100) { |
if(status >= 0 && status < 100) { |
669 |
btnInstr.setText(i18n.getLabel("ChannelScreen.loadingInstrument", status)); |
btnInstr.setText(i18n.getLabel("ChannelScreen.loadingInstrument", status)); |
670 |
|
if(s != null) btnInstr.setToolTipText(null); |
671 |
} else if(status == -1) { |
} else if(status == -1) { |
672 |
btnInstr.setText(i18n.getButtonLabel("ChannelScreen.btnInstr")); |
btnInstr.setText(i18n.getButtonLabel("ChannelScreen.btnInstr")); |
673 |
|
if(s != null) btnInstr.setToolTipText(null); |
674 |
} else if(status < -1) { |
} else if(status < -1) { |
675 |
btnInstr.setText(i18n.getLabel("ChannelScreen.errorLoadingInstrument")); |
btnInstr.setText(i18n.getLabel("ChannelScreen.errorLoadingInstrument")); |
676 |
|
if(s != null) btnInstr.setToolTipText(null); |
677 |
} else { |
} else { |
678 |
if(sc.getInstrumentName() != null) btnInstr.setText(sc.getInstrumentName()); |
if(sc.getInstrumentName() != null) btnInstr.setText(sc.getInstrumentName()); |
679 |
else btnInstr.setText(i18n.getButtonLabel("ChannelScreen.btnInstr")); |
else btnInstr.setText(i18n.getButtonLabel("ChannelScreen.btnInstr")); |
680 |
|
|
681 |
|
btnInstr.setToolTipText(sc.getInstrumentName()); |
682 |
} |
} |
683 |
|
|
684 |
instrumentPane.update(); |
instrumentPane.update(); |
685 |
|
|
686 |
if(sc.getEngine() != null) { |
if(sc.getEngine() != null) { |
687 |
String s = sc.getEngine().getName(); |
s = sc.getEngine().getName(); |
688 |
s += " engine"; |
s += " engine"; |
689 |
if(!s.equals(btnEngine.getText())) { |
if(!s.equals(btnEngine.getText())) { |
690 |
btnEngine.setText(s); |
btnEngine.setText(s); |