|
@@ -210,7 +210,6 @@ public class ConnectionCreationPanel extends JScrollPane {
|
|
|
@Override
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
if (mutex) {
|
|
|
- tfName.setText(connection.getName());
|
|
|
return;
|
|
|
}
|
|
|
connection.setName(tfName.getText());
|
|
@@ -234,7 +233,6 @@ public class ConnectionCreationPanel extends JScrollPane {
|
|
|
cmbSelectedLink
|
|
|
.addActionListener(a -> {
|
|
|
if (mutex) {
|
|
|
- cmbSelectedLink.setSelectedIndex(lastLinkIndex);
|
|
|
return;
|
|
|
}
|
|
|
int cmbSelectedLinkIndex = cmbSelectedLink
|
|
@@ -280,7 +278,6 @@ public class ConnectionCreationPanel extends JScrollPane {
|
|
|
|
|
|
cmbConnection.addActionListener(a -> {
|
|
|
if (mutex) {
|
|
|
- cmbConnection.setSelectedIndex(lastConnectionIndex);
|
|
|
return;
|
|
|
}
|
|
|
cmbConnection.getSelectedIndex();
|
|
@@ -336,6 +333,9 @@ public class ConnectionCreationPanel extends JScrollPane {
|
|
|
cmbProtocolType.addActionListener(new ActionListener() {
|
|
|
@Override
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
+ if(mutex)
|
|
|
+ return;
|
|
|
+
|
|
|
|
|
|
|
|
|
* Old Protocol
|
|
@@ -350,7 +350,7 @@ public class ConnectionCreationPanel extends JScrollPane {
|
|
|
Protocol newProtocol = null;
|
|
|
try {
|
|
|
|
|
|
- newProtocol = availableProtocols.get(
|
|
|
+ newProtocol = controller.getControllerImport().getProtocols().get(
|
|
|
cmbProtocolType.getSelectedIndex()).newInstance();
|
|
|
} catch (InstantiationException | IllegalAccessException e1) {
|
|
|
System.out
|
|
@@ -361,6 +361,9 @@ public class ConnectionCreationPanel extends JScrollPane {
|
|
|
System.out
|
|
|
.println("WARNING: Invalid Protocol Selected - restore last index");
|
|
|
} else if (connection.setProtocol(newProtocol)) {
|
|
|
+ System.out.println("Index"+cmbProtocolType.getSelectedIndex());
|
|
|
+ System.out.println("Protocol changed: ");
|
|
|
+ System.out.println(newProtocol.getClass().getSimpleName());
|
|
|
|
|
|
* New Roles as Strings
|
|
|
*/
|
|
@@ -723,12 +726,17 @@ public class ConnectionCreationPanel extends JScrollPane {
|
|
|
cmbProtocolType.addItem("unknown");
|
|
|
}
|
|
|
|
|
|
- for (int i = 0; i < availableProtocols.size(); i++)
|
|
|
+ lastProtocolIndex = -1;
|
|
|
+ for (int i = 0; i < availableProtocols.size(); i++){
|
|
|
+ System.out.println("i: "+i);
|
|
|
+ System.out.println("Protocol is: "+connection.getProtocol().getClass().getSimpleName());
|
|
|
+ System.out.println("Protocol: "+availableProtocols.get(i).getSimpleName());
|
|
|
if (connection.getProtocol().getClass()
|
|
|
.equals(availableProtocols.get(i))) {
|
|
|
|
|
|
lastProtocolIndex = i;
|
|
|
}
|
|
|
+ }
|
|
|
cmbProtocolType.setSelectedIndex(lastProtocolIndex);
|
|
|
|
|
|
|