Subversion Repositories svn.mios

Rev

Rev 800 | Rev 852 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 800 Rev 808
Line 73... Line 73...
73
import javax.swing.event.PopupMenuListener;
73
import javax.swing.event.PopupMenuListener;
74
74
75
import org.midibox.apps.miosstudio.MIOSStudio;
75
import org.midibox.apps.miosstudio.MIOSStudio;
76
import org.midibox.apps.miosstudio.gui.xml.MIOSStudioGUIXML;
76
import org.midibox.apps.miosstudio.gui.xml.MIOSStudioGUIXML;
77
import org.midibox.apps.miosstudio.xml.MIOSStudioXML;
77
import org.midibox.apps.miosstudio.xml.MIOSStudioXML;
78
import org.midibox.midi.MidiFilterDevice;
78
import org.midibox.midi.MidiFilter;
79
import org.midibox.midi.MidiKeyboardControllerDevice;
79
import org.midibox.midi.MidiKeyboardController;
80
import org.midibox.midi.MidiRouterDevice;
80
import org.midibox.midi.SysexSendReceive;
81
import org.midibox.midi.SysexSendReceiveDevice;
81
import org.midibox.midi.VirtualMidiDevice;
82
import org.midibox.midi.gui.MidiDeviceManagerGUI;
82
import org.midibox.midi.gui.MidiDeviceManagerGUI;
83
import org.midibox.midi.gui.MidiDeviceRoutingGUI;
83
import org.midibox.midi.gui.MidiDeviceRoutingGUI;
84
import org.midibox.midi.gui.MidiFilterDeviceManagerGUI;
-
 
85
import org.midibox.midi.gui.MidiFilterGUI;
84
import org.midibox.midi.gui.MidiFilterGUI;
-
 
85
import org.midibox.midi.gui.MidiFilterManagerGUI;
86
import org.midibox.midi.gui.MidiKeyboardControllerGUI;
86
import org.midibox.midi.gui.MidiKeyboardControllerGUI;
87
import org.midibox.midi.gui.MidiMonitorFilteredGUI;
87
import org.midibox.midi.gui.MidiMonitorFilteredGUI;
88
import org.midibox.midi.gui.SysexSendReceiveDeviceManagerGUI;
88
import org.midibox.midi.gui.SysexSendReceiveManagerGUI;
89
import org.midibox.mios.HexFileUploadDevice;
89
import org.midibox.mios.HexFileUpload;
90
import org.midibox.mios.gui.DebugFunctionGUI;
90
import org.midibox.mios.gui.DebugFunctionGUI;
91
import org.midibox.mios.gui.HexFileUploadDeviceManagerGUI;
91
import org.midibox.mios.gui.HexFileUploadManagerGUI;
92
import org.midibox.mios.gui.LCDMessageGUI;
92
import org.midibox.mios.gui.LCDMessageGUI;
93
import org.midibox.utils.ResourceLoader;
93
import org.midibox.utils.ResourceLoader;
94
import org.midibox.utils.gui.DialogOwner;
94
import org.midibox.utils.gui.DialogOwner;
95
import org.midibox.utils.gui.FontLoader;
95
import org.midibox.utils.gui.FontLoader;
96
import org.midibox.utils.gui.HelpPane;
96
import org.midibox.utils.gui.HelpPane;
Line 129... Line 129...
129
129
130
    private MidiKeyboardControllerGUI midiKeyboardControllerGUI;
130
    private MidiKeyboardControllerGUI midiKeyboardControllerGUI;
131
131
132
    private MIOSStudioInternalFrame midiKeyboardControllerWindow;
132
    private MIOSStudioInternalFrame midiKeyboardControllerWindow;
133
133
134
    private SysexSendReceiveDeviceManagerGUI sysexSendReceiveDeviceManagerGUI;
134
    private SysexSendReceiveManagerGUI sysexSendReceiveDeviceManagerGUI;
135
135
136
    private MIOSStudioInternalFrame sysexSendReceiveDeviceManagerWindow;
136
    private MIOSStudioInternalFrame sysexSendReceiveDeviceManagerWindow;
137
137
138
    private HexFileUploadDeviceManagerGUI hexFileUploadDeviceManagerGUI;
138
    private HexFileUploadManagerGUI hexFileUploadDeviceManagerGUI;
139
139
140
    private MIOSStudioInternalFrame hexFileUploadDeviceManagerWindow;
140
    private MIOSStudioInternalFrame hexFileUploadDeviceManagerWindow;
141
141
142
    /*
142
    /*
143
     * private MemoryReadWriteGUI memoryReadWriteGUI;
143
     * private MemoryReadWriteGUI memoryReadWriteGUI;
Line 236... Line 236...
236
236
237
        desktop.setBackground(Color.WHITE);
237
        desktop.setBackground(Color.WHITE);
238
238
239
        createInternalFrames();
239
        createInternalFrames();
240
240
241
        midiDeviceRoutingGUI.addMidiDeviceIcon(MidiRouterDevice.class,
241
        midiDeviceRoutingGUI.addMidiDeviceIcon(VirtualMidiDevice.class,
242
                ImageLoader.getImageIcon("virtualMidiDevice.png"));
242
                ImageLoader.getImageIcon("virtualMidiDevice.png"));
243
243
244
        midiDeviceRoutingGUI.addMidiDeviceIcon(MidiFilterDevice.class,
244
        midiDeviceRoutingGUI.addMidiDeviceIcon(MidiFilter.class, ImageLoader
245
                ImageLoader.getImageIcon("filter.png"));
245
                .getImageIcon("filter.png"));
246
246
247
        // start In/Out/Terminal thread
247
        // start In/Out/Terminal thread
248
        miosStudio.getMidiInPortMonitorDevice().getMidiMonitorFiltered()
248
        miosStudio.getMidiInPortMonitor().getMidiMonitor().deleteObserver(
249
                .getMidiMonitor().deleteObserver(midiInPortMonitorGUI);
249
                midiInPortMonitorGUI);
250
250
251
        miosStudio.getMidiOutPortMonitorDevice().getMidiMonitorFiltered()
251
        miosStudio.getMidiOutPortMonitor().getMidiMonitor().deleteObserver(
252
                .getMidiMonitor().deleteObserver(midiOutPortMonitorGUI);
252
                midiOutPortMonitorGUI);
253
253
254
        miosStudio.getMIOSTerminalDevice().getMidiMonitorFiltered()
254
        miosStudio.getMIOSTerminal().getMidiMonitor().deleteObserver(
255
                .getMidiMonitor().deleteObserver(miosTerminalGUI);
255
                miosTerminalGUI);
256
256
257
        Thread t = new Thread() {
257
        Thread t = new Thread() {
258
258
259
            public void run() {
259
            public void run() {
260
260
Line 322... Line 322...
322
         * .getMiosStudioOutPort(), icon);
322
         * .getMiosStudioOutPort(), icon);
323
         */
323
         */
324
324
325
        // MIDI OUT Port
325
        // MIDI OUT Port
326
        midiOutPortMonitorGUI = new MidiMonitorFilteredGUI(miosStudio
326
        midiOutPortMonitorGUI = new MidiMonitorFilteredGUI(miosStudio
327
                .getMidiOutPortMonitorDevice().getMidiMonitorFiltered());
327
                .getMidiOutPortMonitor());
328
328
329
        icon = ImageLoader.getImageIcon("midiOut.png");
329
        icon = ImageLoader.getImageIcon("midiOut.png");
330
330
331
        midiOutPortMonitorWindow = new MIOSStudioInternalFrame(
331
        midiOutPortMonitorWindow = new MIOSStudioInternalFrame(
332
                "MIDI Monitor: OUT", true, true, true, true, icon,
332
                "MIDI Monitor: OUT", true, true, true, true, icon,
Line 335... Line 335...
335
        midiOutPortMonitorWindow.pack();
335
        midiOutPortMonitorWindow.pack();
336
336
337
        internalFrames.add(midiOutPortMonitorWindow);
337
        internalFrames.add(midiOutPortMonitorWindow);
338
338
339
        midiDeviceRoutingGUI.addMidiDeviceIcon(miosStudio
339
        midiDeviceRoutingGUI.addMidiDeviceIcon(miosStudio
340
                .getMidiOutPortMonitorDevice(), icon);
340
                .getMidiOutPortMonitor(), icon);
341
341
342
        // MIDI IN Port
342
        // MIDI IN Port
343
        midiInPortMonitorGUI = new MidiMonitorFilteredGUI(miosStudio
343
        midiInPortMonitorGUI = new MidiMonitorFilteredGUI(miosStudio
344
                .getMidiInPortMonitorDevice().getMidiMonitorFiltered());
344
                .getMidiInPortMonitor());
345
345
346
        icon = ImageLoader.getImageIcon("midiIn.png");
346
        icon = ImageLoader.getImageIcon("midiIn.png");
347
347
348
        midiInPortMonitorWindow = new MIOSStudioInternalFrame(
348
        midiInPortMonitorWindow = new MIOSStudioInternalFrame(
349
                "MIDI Monitor: IN", true, true, true, true, icon,
349
                "MIDI Monitor: IN", true, true, true, true, icon,
Line 352... Line 352...
352
        midiInPortMonitorWindow.pack();
352
        midiInPortMonitorWindow.pack();
353
353
354
        internalFrames.add(midiInPortMonitorWindow);
354
        internalFrames.add(midiInPortMonitorWindow);
355
355
356
        midiDeviceRoutingGUI.addMidiDeviceIcon(miosStudio
356
        midiDeviceRoutingGUI.addMidiDeviceIcon(miosStudio
357
                .getMidiInPortMonitorDevice(), icon);
357
                .getMidiInPortMonitor(), icon);
358
358
359
        // MIDI Keyboard Controller
359
        // MIDI Keyboard Controller
360
360
361
        icon = ImageLoader.getImageIcon("piano.png");
361
        icon = ImageLoader.getImageIcon("piano.png");
362
362
363
        midiKeyboardControllerGUI = new MidiKeyboardControllerGUI(miosStudio
363
        midiKeyboardControllerGUI = new MidiKeyboardControllerGUI(miosStudio
364
                .getMidiKeyboardControllerDevice().getMidiKeyboardController());
364
                .getMidiKeyboardController());
365
365
366
        midiKeyboardControllerWindow = new MIOSStudioInternalFrame(
366
        midiKeyboardControllerWindow = new MIOSStudioInternalFrame(
367
                "MIDI Keyboard Controller", false, // resizable
367
                "MIDI Keyboard Controller", false, // resizable
368
                true, // closable
368
                true, // closable
369
                false, // maximizable
369
                false, // maximizable
Line 371... Line 371...
371
371
372
        midiKeyboardControllerWindow.pack();
372
        midiKeyboardControllerWindow.pack();
373
373
374
        internalFrames.add(midiKeyboardControllerWindow);
374
        internalFrames.add(midiKeyboardControllerWindow);
375
375
376
        midiDeviceRoutingGUI.addMidiDeviceIcon(
376
        midiDeviceRoutingGUI.addMidiDeviceIcon(MidiKeyboardController.class,
377
                MidiKeyboardControllerDevice.class, icon);
377
                icon);
378
378
379
        // Sysex Send/Receive
379
        // Sysex Send/Receive
380
380
381
        sysexSendReceiveDeviceManagerGUI = new SysexSendReceiveDeviceManagerGUI(
381
        sysexSendReceiveDeviceManagerGUI = new SysexSendReceiveManagerGUI(
382
                miosStudio.getSysexSendReceiveDeviceManager());
382
                miosStudio.getSysexSendReceiveManager());
383
383
384
        icon = ImageLoader.getImageIcon("sysex.png");
384
        icon = ImageLoader.getImageIcon("sysex.png");
385
385
386
        sysexSendReceiveDeviceManagerWindow = new MIOSStudioInternalFrame(
386
        sysexSendReceiveDeviceManagerWindow = new MIOSStudioInternalFrame(
387
                "Sysex Send/Receive", true, true, true, true, icon,
387
                "Sysex Send/Receive", true, true, true, true, icon,
Line 389... Line 389...
389
389
390
        sysexSendReceiveDeviceManagerWindow.pack();
390
        sysexSendReceiveDeviceManagerWindow.pack();
391
391
392
        internalFrames.add(sysexSendReceiveDeviceManagerWindow);
392
        internalFrames.add(sysexSendReceiveDeviceManagerWindow);
393
393
394
        midiDeviceRoutingGUI.addMidiDeviceIcon(SysexSendReceiveDevice.class,
394
        midiDeviceRoutingGUI.addMidiDeviceIcon(SysexSendReceive.class, icon);
395
                icon);
-
 
396
395
397
        // Hex Upload
396
        // Hex Upload
398
397
399
        hexFileUploadDeviceManagerGUI = new HexFileUploadDeviceManagerGUI(
398
        hexFileUploadDeviceManagerGUI = new HexFileUploadManagerGUI(miosStudio
400
                miosStudio.getHexFileUploadDeviceManager());
399
                .getHexFileUploadManager());
401
400
402
        icon = ImageLoader.getImageIcon("hex.png");
401
        icon = ImageLoader.getImageIcon("hex.png");
403
402
404
        hexFileUploadDeviceManagerWindow = new MIOSStudioInternalFrame(
403
        hexFileUploadDeviceManagerWindow = new MIOSStudioInternalFrame(
405
                "MIOS Hex File Upload", true, true, true, true, icon,
404
                "MIOS Hex File Upload", true, true, true, true, icon,
Line 407... Line 406...
407
406
408
        hexFileUploadDeviceManagerWindow.pack();
407
        hexFileUploadDeviceManagerWindow.pack();
409
408
410
        internalFrames.add(hexFileUploadDeviceManagerWindow);
409
        internalFrames.add(hexFileUploadDeviceManagerWindow);
411
410
412
        midiDeviceRoutingGUI.addMidiDeviceIcon(HexFileUploadDevice.class, icon);
411
        midiDeviceRoutingGUI.addMidiDeviceIcon(HexFileUpload.class, icon);
413
412
414
        // Read/Write
413
        // Read/Write
415
        /*
414
        /*
416
         * icon = ImageLoader.getImageIcon("readWrite.png");
415
         * icon = ImageLoader.getImageIcon("readWrite.png");
417
         *
416
         *
Line 425... Line 424...
425
         */
424
         */
426
425
427
        // LCD Message
426
        // LCD Message
428
        icon = ImageLoader.getImageIcon("lcd.png");
427
        icon = ImageLoader.getImageIcon("lcd.png");
429
428
430
        lcdMessageGUI = new LCDMessageGUI(miosStudio.getLcdMessageDevice()
429
        lcdMessageGUI = new LCDMessageGUI(miosStudio.getLcdMessage());
431
                .getLCDMessage());
-
 
432
430
433
        lcdMessageWindow = new MIOSStudioInternalFrame("MIOS LCD Message",
431
        lcdMessageWindow = new MIOSStudioInternalFrame("MIOS LCD Message",
434
                true, true, true, true, icon, lcdMessageGUI);
432
                true, true, true, true, icon, lcdMessageGUI);
435
433
436
        lcdMessageWindow.pack();
434
        lcdMessageWindow.pack();
437
435
438
        internalFrames.add(lcdMessageWindow);
436
        internalFrames.add(lcdMessageWindow);
439
437
440
        midiDeviceRoutingGUI.addMidiDeviceIcon(
438
        midiDeviceRoutingGUI
441
                miosStudio.getLcdMessageDevice(), icon);
439
                .addMidiDeviceIcon(miosStudio.getLcdMessage(), icon);
442
440
443
        // MIOS Debug
441
        // MIOS Debug
444
442
445
        icon = ImageLoader.getImageIcon("debug.png");
443
        icon = ImageLoader.getImageIcon("debug.png");
446
444
447
        debugFunctionGUI = new DebugFunctionGUI(miosStudio
445
        debugFunctionGUI = new DebugFunctionGUI(miosStudio.getDebugFunction());
448
                .getDebugFunctionDevice().getDebugFunction());
-
 
449
446
450
        debugFunctionWindow = new MIOSStudioInternalFrame(
447
        debugFunctionWindow = new MIOSStudioInternalFrame(
451
                "MIOS Debug Functions", true, true, true, true, icon,
448
                "MIOS Debug Functions", true, true, true, true, icon,
452
                debugFunctionGUI);
449
                debugFunctionGUI);
453
450
454
        debugFunctionWindow.pack();
451
        debugFunctionWindow.pack();
455
452
456
        internalFrames.add(debugFunctionWindow);
453
        internalFrames.add(debugFunctionWindow);
457
454
458
        midiDeviceRoutingGUI.addMidiDeviceIcon(miosStudio
455
        midiDeviceRoutingGUI.addMidiDeviceIcon(miosStudio.getDebugFunction(),
459
                .getDebugFunctionDevice(), icon);
456
                icon);
460
457
461
        // MIOS Terminal
458
        // MIOS Terminal
462
        miosTerminalGUI = new MidiMonitorFilteredGUI(miosStudio
459
        miosTerminalGUI = new MidiMonitorFilteredGUI(miosStudio
463
                .getMIOSTerminalDevice().getMidiMonitorFiltered());
460
                .getMIOSTerminal());
464
461
465
        icon = ImageLoader.getImageIcon("miosTerminal.png");
462
        icon = ImageLoader.getImageIcon("miosTerminal.png");
466
463
467
        miosTerminalWindow = new MIOSStudioInternalFrame("MIOS Terminal", true,
464
        miosTerminalWindow = new MIOSStudioInternalFrame("MIOS Terminal", true,
468
                true, true, true, icon, miosTerminalGUI);
465
                true, true, true, icon, miosTerminalGUI);
469
466
470
        miosTerminalWindow.pack();
467
        miosTerminalWindow.pack();
471
468
472
        internalFrames.add(miosTerminalWindow);
469
        internalFrames.add(miosTerminalWindow);
473
470
474
        midiDeviceRoutingGUI.addMidiDeviceIcon(miosStudio
471
        midiDeviceRoutingGUI.addMidiDeviceIcon(miosStudio.getMIOSTerminal(),
475
                .getMIOSTerminalDevice(), icon);
472
                icon);
476
    }
473
    }
477
474
478
    public JMenuBar createMenuBar() {
475
    public JMenuBar createMenuBar() {
479
        JMenuBar menuBar = new JMenuBar();
476
        JMenuBar menuBar = new JMenuBar();
480
477
Line 655... Line 652...
655
        assignExternalButtonMnemonics();
652
        assignExternalButtonMnemonics();
656
        toolBar.setVisible(false);
653
        toolBar.setVisible(false);
657
        toolBar.setVisible(true);
654
        toolBar.setVisible(true);
658
    }
655
    }
659
656
660
    public SysexSendReceiveDeviceManagerGUI getSysexSendReceiveDeviceManagerGUI() {
657
    public SysexSendReceiveManagerGUI getSysexSendReceiveDeviceManagerGUI() {
661
        return sysexSendReceiveDeviceManagerGUI;
658
        return sysexSendReceiveDeviceManagerGUI;
662
    }
659
    }
663
660
664
    public HexFileUploadDeviceManagerGUI getHexFileUploadDeviceManagerGUI() {
661
    public HexFileUploadManagerGUI getHexFileUploadDeviceManagerGUI() {
665
        return hexFileUploadDeviceManagerGUI;
662
        return hexFileUploadDeviceManagerGUI;
666
    }
663
    }
667
664
668
    public Vector getInternalFrames() {
665
    public Vector getInternalFrames() {
669
        return internalFrames;
666
        return internalFrames;
Line 943... Line 940...
943
    }
940
    }
944
941
945
    private void showMidiThruFilter() {
942
    private void showMidiThruFilter() {
946
        if (thruFilterProperties == null) {
943
        if (thruFilterProperties == null) {
947
            final MidiFilterGUI midiFilterGUI = new MidiFilterGUI(miosStudio
944
            final MidiFilterGUI midiFilterGUI = new MidiFilterGUI(miosStudio
948
                    .getMidiThruFilterDevice().getMidiFilter());
945
                    .getMidiThruFilter());
949
946
950
            thruFilterProperties = new JDialog(DialogOwner.getFrame(),
947
            thruFilterProperties = new JDialog(DialogOwner.getFrame(),
951
                    "MIDI Thru Filter", false);
948
                    "MIDI Thru Filter", false);
952
            thruFilterProperties.setContentPane(midiFilterGUI);
949
            thruFilterProperties.setContentPane(midiFilterGUI);
953
            thruFilterProperties.pack();
950
            thruFilterProperties.pack();
954
            thruFilterProperties.setLocationRelativeTo(this);
951
            thruFilterProperties.setLocationRelativeTo(this);
955
            thruFilterProperties.setVisible(true);
952
            thruFilterProperties.setVisible(true);
956
953
957
            thruFilterProperties.addWindowListener(new WindowAdapter() {
954
            thruFilterProperties.addWindowListener(new WindowAdapter() {
958
                public void windowClosing(WindowEvent we) {
955
                public void windowClosing(WindowEvent we) {
959
                    miosStudio.getMidiThruFilterDevice().deleteObserver(
956
                    miosStudio.getMidiThruFilter()
960
                            midiFilterGUI);
957
                            .deleteObserver(midiFilterGUI);
961
                    thruFilterProperties = null;
958
                    thruFilterProperties = null;
962
                }
959
                }
963
            });
960
            });
964
        }
961
        }
965
        thruFilterProperties.requestFocus();
962
        thruFilterProperties.requestFocus();
Line 1044... Line 1041...
1044
        midiDeviceManagerDialog.requestFocus();
1041
        midiDeviceManagerDialog.requestFocus();
1045
    }
1042
    }
1046
1043
1047
    private void showMidiFilterManagerDialog() {
1044
    private void showMidiFilterManagerDialog() {
1048
        if (midiFilterManagerDialog == null) {
1045
        if (midiFilterManagerDialog == null) {
1049
            final MidiFilterDeviceManagerGUI midiFilterManagerGUI = new MidiFilterDeviceManagerGUI(
1046
            final MidiFilterManagerGUI midiFilterManagerGUI = new MidiFilterManagerGUI(
1050
                    miosStudio.getMidiFilterManager());
1047
                    miosStudio.getMidiFilterManager());
1051
1048
1052
            midiFilterManagerDialog = new JDialog(DialogOwner.getFrame(),
1049
            midiFilterManagerDialog = new JDialog(DialogOwner.getFrame(),
1053
                    "Filters", false);
1050
                    "Filters", false);
1054
            midiFilterManagerDialog.setContentPane(midiFilterManagerGUI);
1051
            midiFilterManagerDialog.setContentPane(midiFilterManagerGUI);