/[svn]/jsampler/trunk/src/org/jsampler/view/fantasia/NormalChannelView.java
ViewVC logotype

Diff of /jsampler/trunk/src/org/jsampler/view/fantasia/NormalChannelView.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1735 by iliev, Sun May 4 18:58:16 2008 UTC revision 1743 by iliev, Sat May 31 23:04:01 2008 UTC
# Line 74  import static org.jsampler.view.fantasia Line 74  import static org.jsampler.view.fantasia
74   */   */
75  public class NormalChannelView extends PixmapPane 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;
# Line 90  public class NormalChannelView extends P Line 90  public class NormalChannelView extends P
90          /** Creates a new instance of <code>NormalChannelView</code> */          /** Creates a new instance of <code>NormalChannelView</code> */
91          public          public
92          NormalChannelView(Channel channel) {          NormalChannelView(Channel channel) {
                 this(channel, new NormalChannelOptionsView(channel));  
         }  
           
         /** Creates a new instance of <code>NormalChannelView</code> */  
         public  
         NormalChannelView(Channel channel, ChannelOptionsView channelOptionsView) {  
93                  super(Res.gfxChannel);                  super(Res.gfxChannel);
94                  setPixmapInsets(new Insets(3, 3, 3, 3));                  setPixmapInsets(new Insets(3, 3, 3, 3));
95                                    
96                  components.add(this);                  components.add(this);
97                                    
98                  this.channel = channel;                  this.channel = channel;
                 this.channelOptionsView = channelOptionsView;  
99                                    
100                  btnPower = new Channel.PowerButton(channel);                  btnPower = new Channel.PowerButton(channel);
101                  components.add(btnPower);                  components.add(btnPower);
# Line 246  public class NormalChannelView extends P Line 239  public class NormalChannelView extends P
239          public void          public void
240          uninstallView() {          uninstallView() {
241                  screen.onDestroy();                  screen.onDestroy();
242                    btnOptions.onDestroy();
243                    uninstallChannelOptionsView();
244                  //removeEnhancedMouseListener(channel.getContextMenu());                  //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
264          getChannelOptionsView() { return channelOptionsView; }          getChannelOptionsView() { return channelOptionsView; }
265                    
# Line 269  public class NormalChannelView extends P Line 280  public class NormalChannelView extends P
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
# Line 519  class ChannelScreen extends PixmapPane { Line 532  class ChannelScreen extends PixmapPane {
532                  components.add(instrumentPane);                  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);                  components.add(p);
539                  p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));                  p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
# Line 647  class ChannelScreen extends PixmapPane { Line 662  class ChannelScreen extends PixmapPane {
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);

Legend:
Removed from v.1735  
changed lines
  Added in v.1743

  ViewVC Help
Powered by ViewVC