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

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

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

revision 1317 by iliev, Fri Aug 10 19:55:03 2007 UTC revision 1318 by iliev, Sat Sep 1 13:46:04 2007 UTC
# Line 25  package org.jsampler.view.fantasia; Line 25  package org.jsampler.view.fantasia;
25  import java.awt.BorderLayout;  import java.awt.BorderLayout;
26  import java.awt.Component;  import java.awt.Component;
27    
28    import java.awt.event.ActionEvent;
29    import java.awt.event.ActionListener;
30    
31  import javax.swing.BoxLayout;  import javax.swing.BoxLayout;
32  import javax.swing.ListSelectionModel;  import javax.swing.ListSelectionModel;
33    
# Line 49  import org.jsampler.view.JSChannelsPane; Line 52  import org.jsampler.view.JSChannelsPane;
52  public class ChannelsPane extends JSChannelsPane {  public class ChannelsPane extends JSChannelsPane {
53          private final ChannelListPane chnList = new ChannelListPane();          private final ChannelListPane chnList = new ChannelListPane();
54          private final DefaultComponentListModel listModel = new DefaultComponentListModel();          private final DefaultComponentListModel listModel = new DefaultComponentListModel();
55                            
56            private ActionListener listener;
57                    
58          /**          /**
59           * Creates a new instance of <code>ChannelsPane</code> with           * Creates a new instance of <code>ChannelsPane</code> with
# Line 58  public class ChannelsPane extends JSChan Line 62  public class ChannelsPane extends JSChan
62           */           */
63          public          public
64          ChannelsPane(String title) {          ChannelsPane(String title) {
65                    this(title, null);
66            }
67            
68            /**
69             * Creates a new instance of <code>ChannelsPane</code> with
70             * the specified <code>title</code>.
71             * @param title The title of this <code>ChannelsPane</code>
72             * @param l A listener which is notified when a newly created
73             * channel is fully expanded on the screen.
74             */
75            public
76            ChannelsPane(String title, ActionListener l) {
77                  super(title);                  super(title);
78                                    
79                    listener = l;
80                    
81                  setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));                  setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
82                                    
83                  chnList.setModel(listModel);                  chnList.setModel(listModel);
# Line 79  public class ChannelsPane extends JSChan Line 97  public class ChannelsPane extends JSChan
97           */           */
98          public void          public void
99          addChannel(SamplerChannelModel channelModel) {          addChannel(SamplerChannelModel channelModel) {
100                  Channel channel = new Channel(channelModel);                  Channel channel = new Channel(channelModel, listener);
101                  listModel.add(channel);                  listModel.add(channel);
102                  if(channel.getChannelInfo().getEngine() == null) channel.expandChannel(false);                  if(channel.getChannelInfo().getEngine() == null) channel.expandChannel(false);
103                  chnList.setSelectedComponent(channel, true);                  chnList.setSelectedComponent(channel, true);

Legend:
Removed from v.1317  
changed lines
  Added in v.1318

  ViewVC Help
Powered by ViewVC