Subversion Repositories svn.mios

Rev

Rev 721 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 721 Rev 808
Line 46... Line 46...
46
import java.util.Observable;
46
import java.util.Observable;
47
import java.util.Observer;
47
import java.util.Observer;
48
import java.util.Vector;
48
import java.util.Vector;
49
49
50
import javax.sound.midi.MidiDevice;
50
import javax.sound.midi.MidiDevice;
-
 
51
import javax.sound.midi.Receiver;
51
import javax.swing.BorderFactory;
52
import javax.swing.BorderFactory;
52
import javax.swing.DefaultListCellRenderer;
53
import javax.swing.DefaultListCellRenderer;
53
import javax.swing.DefaultListModel;
54
import javax.swing.DefaultListModel;
54
import javax.swing.Icon;
55
import javax.swing.Icon;
55
import javax.swing.JButton;
56
import javax.swing.JButton;
Line 70... Line 71...
70
import javax.swing.event.ChangeListener;
71
import javax.swing.event.ChangeListener;
71
import javax.swing.event.ListSelectionEvent;
72
import javax.swing.event.ListSelectionEvent;
72
import javax.swing.event.ListSelectionListener;
73
import javax.swing.event.ListSelectionListener;
73
74
74
import org.midibox.midi.MidiDeviceRouting;
75
import org.midibox.midi.MidiDeviceRouting;
-
 
76
import org.midibox.midi.VirtualMidiDevice;
75
import org.midibox.utils.gui.DialogOwner;
77
import org.midibox.utils.gui.DialogOwner;
76
import org.midibox.utils.gui.GuiUtils;
78
import org.midibox.utils.gui.GuiUtils;
77
import org.midibox.utils.gui.ImageLoader;
79
import org.midibox.utils.gui.ImageLoader;
78
import org.midibox.utils.gui.SimpleTransferHandler;
80
import org.midibox.utils.gui.SimpleTransferHandler;
79
81
Line 349... Line 351...
349
    public void addMidiDeviceIcon(Object object, Icon icon) {
351
    public void addMidiDeviceIcon(Object object, Icon icon) {
350
        icons.put(object, icon);
352
        icons.put(object, icon);
351
    }
353
    }
352
354
353
    public Icon getMidiDeviceIcon(MidiDevice md) {
355
    public Icon getMidiDeviceIcon(MidiDevice md) {
-
 
356
-
 
357
        if (md instanceof VirtualMidiDevice) {
-
 
358
-
 
359
            Receiver receiver = ((VirtualMidiDevice) md).getMidiInReceiver();
-
 
360
-
 
361
            if (icons.containsKey(receiver)) {
-
 
362
                return (Icon) icons.get(receiver);
-
 
363
            }
-
 
364
-
 
365
            if (icons.containsKey(receiver.getClass())) {
-
 
366
                return (Icon) icons.get(receiver.getClass());
-
 
367
            }
-
 
368
        }
-
 
369
354
        if (icons.containsKey(md)) {
370
        if (icons.containsKey(md)) {
355
            return (Icon) icons.get(md);
371
            return (Icon) icons.get(md);
356
        }
372
        }
357
373
358
        if (icons.containsKey(md.getClass())) {
374
        if (icons.containsKey(md.getClass())) {