diff src/VncViewer.java @ 10:9c7eab50c708

update MyRfbProto. add acceptThread
author e085711
date Sat, 16 Apr 2011 20:40:24 +0900
parents b593d6ff5a46
children a0e1da7ebd39
line wrap: on
line diff
--- a/src/VncViewer.java	Sat Apr 16 00:22:17 2011 +0900
+++ b/src/VncViewer.java	Sat Apr 16 20:40:24 2011 +0900
@@ -157,26 +157,13 @@
 			vncContainer.add(buttonPanel);
 		}
 
-		/*****************************************************************************/
+/*****************************************************************************/
 		vncFrame.pack();
 		vncFrame.setVisible(true);
 		try {
 			rfb = new MyRfbProto(host, port, this);
-
-			rfb.framebufferWidth = 1680;
-			rfb.framebufferHeight = 1050;
-			rfb.bitsPerPixel = 32;
-			rfb.depth = 32;
-			rfb.bigEndian = false;
-			rfb.trueColour = true;
-			rfb.redMax = 255;
-			rfb.greenMax = 255;
-			rfb.blueMax = 255;
-			rfb.redShift = 16;
-			rfb.greenShift = 8;
-			rfb.blueShift = 0;
-			rfb.inNormalProtocol = true;
-
+			rfb.readServerInit();
+			
 			createCanvas(0, 0);
 		} catch (IOException e) {
 			System.out.println("Socket error");
@@ -186,7 +173,7 @@
 		gbc.weightx = 1.0;
 		gbc.weighty = 1.0;
 
-		if (inSeparateFrame) {
+		if (inSeparateFrame) { 
 
 			// Create a panel which itself is resizeable and can hold
 			// non-resizeable VncCanvas component at the top left corner.
@@ -215,47 +202,9 @@
 			validate();
 
 		}
-		// */
-		/*****************************************************************************/
+/*****************************************************************************/
 
-		/*
-		 * 
-		 * try { connectAndAuthenticate(); doProtocolInitialisation();
-		 * 
-		 * // FIXME: Use auto-scaling not only in a separate frame. if
-		 * (options.autoScale && inSeparateFrame) { Dimension screenSize; try {
-		 * screenSize = vncContainer.getToolkit().getScreenSize(); } catch
-		 * (Exception e) { screenSize = new Dimension(0, 0); }
-		 * createCanvas(screenSize.width - 32, screenSize.height - 32); } else {
-		 * createCanvas(0, 0); }
-		 * 
-		 * gbc.weightx = 1.0; gbc.weighty = 1.0;
-		 * 
-		 * if (inSeparateFrame) {
-		 * 
-		 * // Create a panel which itself is resizeable and can hold //
-		 * non-resizeable VncCanvas component at the top left corner. Panel
-		 * canvasPanel = new Panel(); canvasPanel.setLayout(new
-		 * FlowLayout(FlowLayout.LEFT, 0, 0)); canvasPanel.add(vc);
-		 * 
-		 * // Create a ScrollPane which will hold a panel with VncCanvas //
-		 * inside. desktopScrollPane = new
-		 * ScrollPane(ScrollPane.SCROLLBARS_AS_NEEDED); gbc.fill =
-		 * GridBagConstraints.BOTH; gridbag.setConstraints(desktopScrollPane,
-		 * gbc); desktopScrollPane.add(canvasPanel);
-		 * 
-		 * // Finally, add our ScrollPane to the Frame window.
-		 * vncFrame.add(desktopScrollPane); vncFrame.setTitle(rfb.desktopName);
-		 * vncFrame.pack(); vc.resizeDesktopFrame();
-		 * 
-		 * } else {
-		 * 
-		 * // Just add the VncCanvas component to the Applet.
-		 * gridbag.setConstraints(vc, gbc); add(vc); validate();
-		 * 
-		 * }
-		 */
-
+		
 		try {
 
 			if (showControls)