X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altosuilib%2FAltosDeviceDialog.java;h=77249bfcca014a6cd7b6cb3acc86f1aac6fb690f;hb=a61217f0a6d0ef48b6471f632c4600255867e831;hp=73bc0b2f5141cd117b15c0c2d7d2e3f458556bc4;hpb=2120d362cefceba69e75996b6391d9558978c01d;p=fw%2Faltos diff --git a/altosuilib/AltosDeviceDialog.java b/altosuilib/AltosDeviceDialog.java index 73bc0b2f..77249bfc 100644 --- a/altosuilib/AltosDeviceDialog.java +++ b/altosuilib/AltosDeviceDialog.java @@ -3,7 +3,8 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of @@ -15,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_1; +package org.altusmetrum.altosuilib_12; import javax.swing.*; import java.awt.*; @@ -23,14 +24,14 @@ import java.awt.event.*; public abstract class AltosDeviceDialog extends AltosUIDialog implements ActionListener { - private AltosDevice value; - private JList list; - private JButton cancel_button; - private JButton select_button; - public Frame frame; - public int product; - public JPanel buttonPane; - + private AltosDevice value; + private JList list; + private JButton cancel_button; + private JButton select_button; + public Frame frame; + public int product; + public JPanel buttonPane; + public AltosDevice getValue() { return value; } @@ -65,7 +66,7 @@ public abstract class AltosDeviceDialog extends AltosUIDialog implements ActionL select_button.setEnabled(false); getRootPane().setDefaultButton(select_button); - list = new JList(devices) { + list = new JList(devices) { //Subclass JList to workaround bug 4832765, which can cause the //scroll pane to not let the user easily scroll up to the beginning //of the list. An alternative would be to set the unitIncrement @@ -131,7 +132,8 @@ public abstract class AltosDeviceDialog extends AltosUIDialog implements ActionL buttonPane.add(cancel_button); buttonPane.add(Box.createRigidArea(new Dimension(10, 0))); - add_bluetooth(); + if (AltosUILib.has_bluetooth) + add_bluetooth(); buttonPane.add(select_button);