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 |
|
|
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 |
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); |
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); |