1 package camidion.chordhelper.mididevice;
3 import java.awt.event.ActionEvent;
5 import javax.swing.AbstractAction;
6 import javax.swing.Action;
7 import javax.swing.JDialog;
8 import javax.swing.JScrollPane;
9 import javax.swing.JSplitPane;
11 import camidion.chordhelper.ButtonIcon;
14 * MIDIデバイスダイアログ (View)
16 public class MidiDeviceDialog extends JDialog {
18 * MIDIデバイスダイアログを構築します。
19 * @param deviceModelList デバイスモデル(MIDIコネクタリストモデル)のリスト
21 public MidiDeviceDialog(MidiTransceiverListModelList deviceModelList) {
22 setTitle(openAction.getValue(Action.NAME).toString());
23 setBounds( 300, 300, 800, 500 );
24 MidiDeviceTreeModel deviceTreeModel = new MidiDeviceTreeModel(deviceModelList);
25 MidiDeviceTreeView deviceTreeView = new MidiDeviceTreeView(deviceTreeModel);
26 MidiDeviceInfoPane deviceInfoPane = new MidiDeviceInfoPane();
27 MidiOpenedDevicesView desktopPane = new MidiOpenedDevicesView(deviceTreeView, deviceInfoPane, this);
28 deviceTreeView.addTreeSelectionListener(deviceInfoPane);
29 deviceTreeView.addTreeSelectionListener(desktopPane);
31 JSplitPane.HORIZONTAL_SPLIT,
33 JSplitPane.VERTICAL_SPLIT,
34 new JScrollPane(deviceTreeView),
35 new JScrollPane(deviceInfoPane)
37 setDividerLocation(260);
41 setOneTouchExpandable(true);
42 setDividerLocation(250);
46 * MIDIデバイスダイアログを開くアクション
48 public Action openAction = new AbstractAction() {
50 putValue(NAME, "MIDI device connection");
51 putValue(SHORT_DESCRIPTION, "MIDIデバイス間の接続を編集");
52 putValue(LARGE_ICON_KEY, new ButtonIcon(ButtonIcon.MIDI_CONNECTOR_ICON));
55 public void actionPerformed(ActionEvent event) { setVisible(true); }