- private AltosDeviceDialog (Frame in_frame, Component location,
- AltosDevice[] devices) {
+ private AltosDevice[] devices() {
+ java.util.List<AltosDevice> usb_devices = AltosUSBDevice.list(product);
+ int num_devices = usb_devices.size();
+ java.util.List<AltosDevice> bt_devices = AltosBTKnown.bt_known().list(product);
+ num_devices += bt_devices.size();
+ AltosDevice[] devices = new AltosDevice[num_devices];
+
+ for (int i = 0; i < usb_devices.size(); i++)
+ devices[i] = usb_devices.get(i);
+ int off = usb_devices.size();
+ for (int j = 0; j < bt_devices.size(); j++)
+ devices[off + j] = bt_devices.get(j);
+ return devices;
+ }
+
+ private void update_devices() {
+ AltosDevice[] devices = devices();
+ list.setListData(devices);
+ select_button.setEnabled(devices.length > 0);
+ }
+
+ private AltosDeviceDialog (Frame in_frame, Component location, int in_product) {