SerialPorrChooser: Aktualisiert

thobaben_diagram
Harald Wolff 2015-08-12 22:22:40 +02:00
parent cb68511857
commit 77ed1c85c0
1 changed files with 7 additions and 8 deletions

View File

@ -14,6 +14,7 @@ import java.awt.GridBagLayout;
import org.hwo.i18n.Messages;
import org.hwo.io.SerialPort;
import org.hwo.io.NewSerialPort.NewSerialPort;
import org.hwo.ui.JComboBoxEx;
import java.awt.GridBagConstraints;
@ -27,11 +28,11 @@ import java.awt.event.ActionEvent;
public class SerialPortChooser extends JDialog {
public static SerialPort execute()
public static NewSerialPort execute()
{
return execute(null);
}
public static SerialPort execute(String selectedPortName)
public static NewSerialPort execute(String selectedPortName)
{
SerialPortChooser spc = new SerialPortChooser();
@ -46,7 +47,7 @@ public class SerialPortChooser extends JDialog {
private final JPanel contentPanel = new JPanel();
private SerialPort selectedSerialPort;
private NewSerialPort selectedSerialPort;
private JComboBoxEx cbPortList;
/**
@ -121,15 +122,13 @@ public class SerialPortChooser extends JDialog {
cbPortList.removeAllItems();
for (String portName: SerialPort.getPortNames())
for (String portName: NewSerialPort.getPortNames())
cbPortList.addItem(portName);
}
private void accept()
{
selectedSerialPort = SerialPort.newInstance();
selectedSerialPort.setPortName(cbPortList.getSelectedItem().toString());
selectedSerialPort = new NewSerialPort(cbPortList.getSelectedItem().toString());
setVisible(false);
}
@ -139,7 +138,7 @@ public class SerialPortChooser extends JDialog {
setVisible(false);
}
public SerialPort getSelectedSerialPort() {
public NewSerialPort getSelectedSerialPort() {
return selectedSerialPort;
}