private Element setMainElementAndAddressBasedOnProtocol(Protocol protocol, SSLState sslState) {
Element main;
switch (protocol) {
case VNC:
address = new InetSocketAddress(hostName.value, vncPort.value);
main = new VncClient("client", password.value, screen, canvas);
break;
case RDP:
address = new InetSocketAddress(hostName.value, rdpPort.value);
main = new RdpClient("client", hostName.value, domain.value, userName.value, rdpPassword.value, null, screen, canvas, sslState);
break;