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

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

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

revision 1784 by iliev, Mon Sep 8 00:19:27 2008 UTC revision 1785 by iliev, Tue Oct 7 00:07:14 2008 UTC
# Line 40  import javax.swing.AbstractAction; Line 40  import javax.swing.AbstractAction;
40  import javax.swing.Action;  import javax.swing.Action;
41  import javax.swing.BoxLayout;  import javax.swing.BoxLayout;
42  import javax.swing.ButtonGroup;  import javax.swing.ButtonGroup;
 import javax.swing.DefaultListCellRenderer;  
43  import javax.swing.ImageIcon;  import javax.swing.ImageIcon;
44  import javax.swing.JButton;  import javax.swing.JButton;
45  import javax.swing.JComponent;  import javax.swing.JComponent;
# Line 50  import javax.swing.JPanel; Line 49  import javax.swing.JPanel;
49  import javax.swing.JPopupMenu;  import javax.swing.JPopupMenu;
50  import javax.swing.JRadioButtonMenuItem;  import javax.swing.JRadioButtonMenuItem;
51  import javax.swing.JScrollPane;  import javax.swing.JScrollPane;
 import javax.swing.JToggleButton;  
52  import javax.swing.JToolBar;  import javax.swing.JToolBar;
53    
 import net.sf.juife.InformationDialog;  
 import net.sf.juife.TitleBar;  
   
54  import org.jdesktop.swingx.JXCollapsiblePane;  import org.jdesktop.swingx.JXCollapsiblePane;
55    
56  import org.jsampler.CC;  import org.jsampler.CC;
# Line 70  import org.jsampler.event.SamplerChannel Line 65  import org.jsampler.event.SamplerChannel
65  import org.jsampler.view.JSChannel;  import org.jsampler.view.JSChannel;
66  import org.jsampler.view.JSChannelsPane;  import org.jsampler.view.JSChannelsPane;
67    
68    import org.jsampler.view.fantasia.basic.PixmapToggleButton;
69    
70  import org.jsampler.view.std.JSChannelOutputRoutingDlg;  import org.jsampler.view.std.JSChannelOutputRoutingDlg;
71  import org.jsampler.view.std.JSFxSendsDlg;  import org.jsampler.view.std.JSFxSendsDlg;
72  import org.jsampler.view.std.JSFxSendsPane;  import org.jsampler.view.std.JSFxSendsPane;
# Line 286  public class Channel extends JSChannel { Line 283  public class Channel extends JSChannel {
283           * Determines whether the channel is selected.           * Determines whether the channel is selected.
284           * @return <code>true</code> if the channel is selected, <code>false</code> otherwise.           * @return <code>true</code> if the channel is selected, <code>false</code> otherwise.
285           */           */
286          public boolean isSelected() { return selected; }          @Override
287            public boolean
288            isSelected() { return selected; }
289                    
290          /**          /**
291           * Sets the selection state of this channel.           * Sets the selection state of this channel.
# Line 294  public class Channel extends JSChannel { Line 293  public class Channel extends JSChannel {
293           * @param select Specifies the new selection state of this channel;           * @param select Specifies the new selection state of this channel;
294           * <code>true</code> to select the channel, <code>false</code> otherwise.           * <code>true</code> to select the channel, <code>false</code> otherwise.
295           */           */
296            @Override
297          public void          public void
298          setSelected(boolean select) {          setSelected(boolean select) {
299                                    
# Line 389  public class Channel extends JSChannel { Line 389  public class Channel extends JSChannel {
389                   * @param e A <code>SamplerChannelEvent</code> instance                   * @param e A <code>SamplerChannelEvent</code> instance
390                   * containing event information.                   * containing event information.
391                   */                   */
392                    @Override
393                  public void                  public void
394                  channelChanged(SamplerChannelEvent e) { updateChannelInfo(); }                  channelChanged(SamplerChannelEvent e) { updateChannelInfo(); }
395                    
# Line 397  public class Channel extends JSChannel { Line 398  public class Channel extends JSChannel {
398                   * @param e A <code>SamplerChannelEvent</code> instance                   * @param e A <code>SamplerChannelEvent</code> instance
399                   * containing event information.                   * containing event information.
400                   */                   */
401                    @Override
402                  public void                  public void
403                  streamCountChanged(SamplerChannelEvent e) {                  streamCountChanged(SamplerChannelEvent e) {
404                          viewTracker.getCurrentView().updateStreamCount(getModel().getStreamCount());                          viewTracker.getCurrentView().updateStreamCount(getModel().getStreamCount());
# Line 407  public class Channel extends JSChannel { Line 409  public class Channel extends JSChannel {
409                   * @param e A <code>SamplerChannelEvent</code> instance                   * @param e A <code>SamplerChannelEvent</code> instance
410                   * containing event information.                   * containing event information.
411                   */                   */
412                    @Override
413                  public void                  public void
414                  voiceCountChanged(SamplerChannelEvent e) {                  voiceCountChanged(SamplerChannelEvent e) {
415                          viewTracker.getCurrentView().updateVoiceCount(getModel().getVoiceCount());                          viewTracker.getCurrentView().updateVoiceCount(getModel().getVoiceCount());
# Line 417  public class Channel extends JSChannel { Line 420  public class Channel extends JSChannel {
420                   * @param e A <code>SamplerChannelListEvent</code>                   * @param e A <code>SamplerChannelListEvent</code>
421                   * instance providing the event information.                   * instance providing the event information.
422                   */                   */
423                    @Override
424                  public void                  public void
425                  channelAdded(SamplerChannelListEvent e) { }                  channelAdded(SamplerChannelListEvent e) { }
426                    
# Line 425  public class Channel extends JSChannel { Line 429  public class Channel extends JSChannel {
429                   * @param e A <code>SamplerChannelListEvent</code>                   * @param e A <code>SamplerChannelListEvent</code>
430                   * instance providing the event information.                   * instance providing the event information.
431                   */                   */
432                    @Override
433                  public void                  public void
434                  channelRemoved(SamplerChannelListEvent e) {                  channelRemoved(SamplerChannelListEvent e) {
435                          // Some cleanup when the channel is removed.                          // Some cleanup when the channel is removed.
# Line 433  public class Channel extends JSChannel { Line 438  public class Channel extends JSChannel {
438                          }                          }
439                  }                  }
440                                    
441                    @Override
442                  public void                  public void
443                  propertyChange(PropertyChangeEvent e) {                  propertyChange(PropertyChangeEvent e) {
444                          if(e.getNewValue() == "collapsed") {                          if(e.getNewValue() == "collapsed") {
# Line 661  public class Channel extends JSChannel { Line 667  public class Channel extends JSChannel {
667                          fallbackToOriginalView();                          fallbackToOriginalView();
668                  }                  }
669                                    
670                    @Override
671                  public void                  public void
672                  mouseEntered(MouseEvent e) {                  mouseEntered(MouseEvent e) {
673                          guiListener.actionPerformed(null);                          guiListener.actionPerformed(null);
674                  }                  }
675                                    
676                    @Override
677                  public void                  public void
678                  mouseExited(MouseEvent e) {                  mouseExited(MouseEvent e) {
679                          guiListener.actionPerformed(null);                          guiListener.actionPerformed(null);
680                  }                  }
681                                    
682                    @Override
683                  public void                  public void
684                  mousePressed(MouseEvent e) {                  mousePressed(MouseEvent e) {
685                          mousePressed = true;                          mousePressed = true;
686                  }                  }
687                                    
688                    @Override
689                  public void                  public void
690                  mouseReleased(MouseEvent e) {                  mouseReleased(MouseEvent e) {
691                          mousePressed = false;                          mousePressed = false;
# Line 703  public class Channel extends JSChannel { Line 713  public class Channel extends JSChannel {
713                          preferences().removePropertyChangeListener(s, this);                          preferences().removePropertyChangeListener(s, this);
714                  }                  }
715                                    
716                    @Override
717                  public void                  public void
718                  propertyChange(PropertyChangeEvent e) {                  propertyChange(PropertyChangeEvent e) {
719                          updateMouseOverViewType();                          updateMouseOverViewType();
# Line 716  public class Channel extends JSChannel { Line 727  public class Channel extends JSChannel {
727                          getModel().addSamplerChannelListener(this);                          getModel().addSamplerChannelListener(this);
728                  }                  }
729                                    
730                    @Override
731                  public void                  public void
732                  actionPerformed(ActionEvent e) {                  actionPerformed(ActionEvent e) {
733                          CC.getSamplerModel().editBackendInstrument(getChannelId());                          CC.getSamplerModel().editBackendInstrument(getChannelId());
734                  }                  }
735                                    
736                    @Override
737                  public void                  public void
738                  channelChanged(SamplerChannelEvent e) {                  channelChanged(SamplerChannelEvent e) {
739                          boolean b = getChannelInfo().getInstrumentStatus() == 100;                          boolean b = getChannelInfo().getInstrumentStatus() == 100;
740                          setEnabled(b);                          setEnabled(b);
741                  }                  }
742                                    
743                    @Override
744                  public void                  public void
745                  streamCountChanged(SamplerChannelEvent e) { }                  streamCountChanged(SamplerChannelEvent e) { }
746                                    
747                    @Override
748                  public void                  public void
749                  voiceCountChanged(SamplerChannelEvent e) { }                  voiceCountChanged(SamplerChannelEvent e) { }
750          }          }
# Line 739  public class Channel extends JSChannel { Line 754  public class Channel extends JSChannel {
754                          super(i18n.getMenuLabel("channels.fxSends"));                          super(i18n.getMenuLabel("channels.fxSends"));
755                  }                  }
756                                    
757                    @Override
758                  public void                  public void
759                  actionPerformed(ActionEvent e) {                  actionPerformed(ActionEvent e) {
760                          showFxSendsDialog();                          showFxSendsDialog();
# Line 752  public class Channel extends JSChannel { Line 768  public class Channel extends JSChannel {
768                          getModel().addSamplerChannelListener(this);                          getModel().addSamplerChannelListener(this);
769                  }                  }
770                                    
771                    @Override
772                  public void                  public void
773                  actionPerformed(ActionEvent e) {                  actionPerformed(ActionEvent e) {
774                          SamplerChannel c = getChannelInfo();                          SamplerChannel c = getChannelInfo();
775                          new JSChannelOutputRoutingDlg(CC.getMainFrame(), c).setVisible(true);                          new JSChannelOutputRoutingDlg(CC.getMainFrame(), c).setVisible(true);
776                  }                  }
777                                    
778                    @Override
779                  public void                  public void
780                  channelChanged(SamplerChannelEvent e) {                  channelChanged(SamplerChannelEvent e) {
781                          boolean b = getChannelInfo().getAudioOutputDevice() != -1;                          boolean b = getChannelInfo().getAudioOutputDevice() != -1;
782                          setEnabled(b);                          setEnabled(b);
783                  }                  }
784                                    
785                    @Override
786                  public void                  public void
787                  streamCountChanged(SamplerChannelEvent e) { }                  streamCountChanged(SamplerChannelEvent e) { }
788                                    
789                    @Override
790                  public void                  public void
791                  voiceCountChanged(SamplerChannelEvent e) { }                  voiceCountChanged(SamplerChannelEvent e) { }
792          }          }
# Line 776  public class Channel extends JSChannel { Line 796  public class Channel extends JSChannel {
796                          super(i18n.getMenuLabel("channels.smallView"));                          super(i18n.getMenuLabel("channels.smallView"));
797                  }                  }
798                                    
799                    @Override
800                  public void                  public void
801                  actionPerformed(ActionEvent e) {                  actionPerformed(ActionEvent e) {
802                          viewTracker.setView(new SmallChannelView(Channel.this));                          viewTracker.setView(new SmallChannelView(Channel.this));
# Line 787  public class Channel extends JSChannel { Line 808  public class Channel extends JSChannel {
808                          super(i18n.getMenuLabel("channels.normalView"));                          super(i18n.getMenuLabel("channels.normalView"));
809                  }                  }
810                                    
811                    @Override
812                  public void                  public void
813                  actionPerformed(ActionEvent e) {                  actionPerformed(ActionEvent e) {
814                          viewTracker.setView(new NormalChannelView(Channel.this));                          viewTracker.setView(new NormalChannelView(Channel.this));
# Line 838  public class Channel extends JSChannel { Line 860  public class Channel extends JSChannel {
860                          return menu;                          return menu;
861                  }                  }
862                                    
863                    @Override
864                  public void                  public void
865                  mousePressed(MouseEvent e) {                  mousePressed(MouseEvent e) {
866                          if(e.isPopupTrigger()) show(e);                          if(e.isPopupTrigger()) show(e);
867                  }                  }
868                    
869                    @Override
870                  public void                  public void
871                  mouseReleased(MouseEvent e) {                  mouseReleased(MouseEvent e) {
872                          if(e.isPopupTrigger()) show(e);                          if(e.isPopupTrigger()) show(e);
# Line 862  public class Channel extends JSChannel { Line 886  public class Channel extends JSChannel {
886                          actionRemoveFxSend.putValue(Action.SMALL_ICON, Res.iconDelete16);                          actionRemoveFxSend.putValue(Action.SMALL_ICON, Res.iconDelete16);
887                  }                  }
888                                    
889                    @Override
890                  protected JToolBar                  protected JToolBar
891                  createToolBar() {                  createToolBar() {
892                          JToolBar tb = new JToolBar();                          JToolBar tb = new JToolBar();
# Line 1009  public class Channel extends JSChannel { Line 1034  public class Channel extends JSChannel {
1034                          setToolTipText(i18n.getButtonLabel("Channel.ttRemoveChannel"));                          setToolTipText(i18n.getButtonLabel("Channel.ttRemoveChannel"));
1035                  }                  }
1036                                    
1037                    @Override
1038                  public void                  public void
1039                  actionPerformed(ActionEvent e) {                  actionPerformed(ActionEvent e) {
1040                          boolean b = preferences().getBoolProperty(CONFIRM_CHANNEL_REMOVAL);                          boolean b = preferences().getBoolProperty(CONFIRM_CHANNEL_REMOVAL);
# Line 1022  public class Channel extends JSChannel { Line 1048  public class Channel extends JSChannel {
1048                          channel.remove();                          channel.remove();
1049                  }                  }
1050                                    
1051                    @Override
1052                  public boolean                  public boolean
1053                  contains(int x, int y) { return (x - 11)*(x - 11) + (y - 11)*(y - 11) < 71; }                  contains(int x, int y) { return (x - 11)*(x - 11) + (y - 11)*(y - 11) < 71; }
1054          }          }
# Line 1042  public class Channel extends JSChannel { Line 1069  public class Channel extends JSChannel {
1069                          setToolTipText(i18n.getButtonLabel("Channel.ttShowOptions"));                          setToolTipText(i18n.getButtonLabel("Channel.ttShowOptions"));
1070                  }                  }
1071                                    
1072                    @Override
1073                  public void                  public void
1074                  actionPerformed(ActionEvent e) {                  actionPerformed(ActionEvent e) {
1075                          ChannelView view = channel.viewTracker.getCurrentView();                          ChannelView view = channel.viewTracker.getCurrentView();
# Line 1064  public class Channel extends JSChannel { Line 1092  public class Channel extends JSChannel {
1092                          channel.optionsPane.addPropertyChangeListener(s, this);                          channel.optionsPane.addPropertyChangeListener(s, this);
1093                  }                  }
1094                                    
1095                    @Override
1096                  public void                  public void
1097                  propertyChange(PropertyChangeEvent e) {                  propertyChange(PropertyChangeEvent e) {
1098                          if(e.getNewValue() == "collapsed") {                          if(e.getNewValue() == "collapsed") {
# Line 1079  public class Channel extends JSChannel { Line 1108  public class Channel extends JSChannel {
1108                          channel.optionsPane.removePropertyChangeListener(s, this);                          channel.optionsPane.removePropertyChangeListener(s, this);
1109                  }                  }
1110                                    
1111                    @Override
1112                  public boolean                  public boolean
1113                  contains(int x, int y) { return super.contains(x, y) & y < 13; }                  contains(int x, int y) { return super.contains(x, y) & y < 13; }
1114          }          }

Legend:
Removed from v.1784  
changed lines
  Added in v.1785

  ViewVC Help
Powered by ViewVC