diff src/viewer_swing/java/com/glavsoft/viewer/swing/SwingRfbConnectionWorker.java @ 224:ccbc3a951961

fix indent, update mm.
author oc
date Sun, 06 Jul 2014 17:50:00 +0900
parents b31903e5b02d
children 5e55cc34f789
line wrap: on
line diff
--- a/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingRfbConnectionWorker.java	Sun Jul 06 12:46:20 2014 +0900
+++ b/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingRfbConnectionWorker.java	Sun Jul 06 17:50:00 2014 +0900
@@ -48,8 +48,8 @@
 import jp.ac.u_ryukyu.treevnc.TreeRFBProto;
 
 /**
-* @author dime at tightvnc.com
-*/
+ * @author dime at tightvnc.com
+ */
 public class SwingRfbConnectionWorker extends SwingWorker<Void, String> implements RfbConnectionWorker, IRfbSessionListener {
 
     private String predefinedPassword;
@@ -82,12 +82,12 @@
 
         workingProtocol.handshake();
         myRfb.setProtocolContext(workingProtocol);
-//      tryAgain = false;
+        //      tryAgain = false;
         return null;
     }
 
     public SwingRfbConnectionWorker(String predefinedPassword, ConnectionPresenter presenter, JFrame parentWindow,
-                                    SwingViewerWindowFactory viewerWindowFactory, TreeRFBProto myRfb) {
+            SwingViewerWindowFactory viewerWindowFactory, TreeRFBProto myRfb) {
         this.predefinedPassword = predefinedPassword;
         this.presenter = presenter;
         this.parentWindow = parentWindow;
@@ -110,22 +110,22 @@
             presenter.showMessage("Handshake established");
             ClipboardControllerImpl clipboardController;
             if(!myRfb.getCuiVersion())
-            	clipboardController = new ClipboardControllerImpl(workingProtocol, rfbSettings.getRemoteCharsetName());
+                clipboardController = new ClipboardControllerImpl(workingProtocol, rfbSettings.getRemoteCharsetName());
             else 
-            	clipboardController = new ClipboardControllerImpl(workingProtocol, "cui");
+                clipboardController = new ClipboardControllerImpl(workingProtocol, "cui");
             clipboardController.setEnabled(rfbSettings.isAllowClipboardTransfer());
             rfbSettings.addListener(clipboardController);
             if(!myRfb.getCuiVersion())
-            	viewerWindow = viewerWindowFactory.createViewerWindow(workingProtocol, rfbSettings, uiSettings, connectionString, presenter);
+                viewerWindow = viewerWindowFactory.createViewerWindow(workingProtocol, rfbSettings, uiSettings, connectionString, presenter);
             myRfb.setProtocolContext(workingProtocol);
             workingProtocol.startNormalHandling(this,viewerWindow.getSurface(), clipboardController, myRfb);
             presenter.showMessage("Started");
-            
+
             // hide VNC server's view to prevent video feed back. 
             if (myRfb.hasViewer() && myRfb.getReconnectingId() != 0)
                 viewerWindow.setVisible(true);
             if(!myRfb.getCuiVersion())
-            	presenter.successfulRfbConnection();
+                presenter.successfulRfbConnection();
         } catch (CancellationException e) {
             logger.info("Cancelled");
             presenter.showMessage("Cancelled");
@@ -153,11 +153,11 @@
                 logger.severe(errorMessage);
                 presenter.clearPredefinedPassword();
             } catch (TransportException e) {
-//            if ( ! isAppletStopped) {
+                //            if ( ! isAppletStopped) {
                 errorTitle = "Connection Error";
                 errorMessage = "Connection Error: " + e.getMessage();
                 logger.severe(errorMessage);
-//            }
+                //            }
             } catch (IOException e) {
                 errorTitle = "Connection Error";
                 errorMessage = "Connection Error: " + e.getMessage();
@@ -178,12 +178,12 @@
     }
 
     @Override
-	public void rfbSessionStopped(final String reason) {
+    public void rfbSessionStopped(final String reason) {
         if (workingProtocol != null) {
-			workingProtocol.cleanUpSession();
-		}
-		if (isStoppingProcess) return;
-		cleanUpUISessionAndConnection();
+            workingProtocol.cleanUpSession();
+        }
+        if (isStoppingProcess) return;
+        cleanUpUISessionAndConnection();
         logger.info("Rfb session stopped: " + reason);
         if (presenter.needReconnection()) {
             SwingUtilities.invokeLater(new Runnable() {
@@ -194,7 +194,7 @@
                 }
             });
         }
-	}
+    }
 
     @Override
     public boolean cancel() {
@@ -207,17 +207,17 @@
     }
 
     private synchronized void cleanUpUISessionAndConnection() {
-		isStoppingProcess = true;
-		if (workingSocket != null && workingSocket.isConnected()) {
-			try {
-				workingSocket.close();
-			} catch (IOException e) { /*nop*/ }
-		}
-		if (viewerWindow != null) {
+        isStoppingProcess = true;
+        if (workingSocket != null && workingSocket.isConnected()) {
+            try {
+                workingSocket.close();
+            } catch (IOException e) { /*nop*/ }
+        }
+        if (viewerWindow != null) {
             viewerWindow.close();
-		}
-		isStoppingProcess = false;
-	}
+        }
+        isStoppingProcess = false;
+    }
 
     @Override
     public void setWorkingSocket(Socket workingSocket) {
@@ -258,7 +258,7 @@
         public String getPassword() {
             return Strings.isTrimmedEmpty(predefinedPassword) ?
                     getPasswordFromGUI() :
-                    predefinedPassword;
+                        predefinedPassword;
         }
 
         private String getPasswordFromGUI() {
@@ -283,13 +283,13 @@
         }
     }
 
-	@Override
-	public SwingViewerWindow getViewer() {
-		return viewerWindow;
-	}
+    @Override
+    public SwingViewerWindow getViewer() {
+        return viewerWindow;
+    }
 
-	@Override
-	public Socket getSocket() {
-		return workingSocket;
-	}
+    @Override
+    public Socket getSocket() {
+        return workingSocket;
+    }
 }