columnData[4] = new ColumnData("Version", 80, JLabel.LEFT, 0, String.class, null, null);
sectionData = new SectionData[]{new SectionData(UIColors.getTableFirstSectionBG(), UIColors.getTableFirstSectionFG(), 550, "")};
}
protected void doRefresh() {
final MidiSystemFacade midi = MidiSystemFacade.getInstance();
if (midi != null) {
midi.removeMidiSystemListener(this);
midi.addMidiSystemListener(this);
MidiDevice.Info[] devices = midi.getAllDevices();
Arrays.sort(devices, new Comparator() {
public int compare(Object o1, Object o2) {
return o1.toString().compareTo(o2.toString());
}
});
for (int i = 0, n = devices.length; i < n; i++) {
final MidiDevice.Info di = devices[i];
tableRowObjects.add(new ColumnValueProvider() {
public Object getValueAt(int col) {
switch (col) {
case 0:
return di.getName();
case 1:
try {
return (midi.isPortPermitted(di) ? "Yes" : "no");
} catch (UnknownMidiDeviceException e) {
return "unknown";
}
case 2:
try {
return IntPool.get(midi.getRefCount(di)).toString();
} catch (UnknownMidiDeviceException e) {
return "unknown";
}
case 3:
return di.getDescription();