Mercurial > hg > Applications > TreeVNC
changeset 320:a237c7e3b7ca
change class name, change value thread join time
author | oc |
---|---|
date | Sat, 31 Jan 2015 00:11:15 +0900 |
parents | f2b835466a24 |
children | 9637525e57c8 |
files | .idea/gradle.xml .idea/libraries/Gradle__com_jcraft_jsch_0_1_50.xml TreeVNC.iml src/main/java/com/glavsoft/rfb/protocol/Protocol.java src/main/java/com/glavsoft/rfb/protocol/state/InitState.java src/main/java/jp/ac/u_ryukyu/treevnc/RequestSingleDisplaySize.java src/main/java/jp/ac/u_ryukyu/treevnc/RequestSingleDisplayWidth.java src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java |
diffstat | 9 files changed, 65 insertions(+), 57 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.idea/gradle.xml Sat Jan 31 00:11:15 2015 +0900 @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="GradleSettings"> + <option name="linkedExternalProjectsSettings"> + <GradleProjectSettings> + <option name="distributionType" value="LOCAL" /> + <option name="externalProjectPath" value="$PROJECT_DIR$" /> + <option name="gradleHome" value="/usr/local/Cellar/gradle/2.1/libexec" /> + <option name="modules"> + <set> + <option value="$PROJECT_DIR$" /> + </set> + </option> + </GradleProjectSettings> + </option> + </component> +</project> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.idea/libraries/Gradle__com_jcraft_jsch_0_1_50.xml Sat Jan 31 00:11:15 2015 +0900 @@ -0,0 +1,9 @@ +<component name="libraryTable"> + <library name="Gradle: com.jcraft:jsch:0.1.50"> + <CLASSES> + <root url="jar://$PROJECT_DIR$/src/libs/jsch-0.1.50.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> +</component> \ No newline at end of file
--- a/TreeVNC.iml Fri Jan 30 15:37:03 2015 +0900 +++ b/TreeVNC.iml Sat Jan 31 00:11:15 2015 +0900 @@ -1,24 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> -<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="2.7.2" type="JAVA_MODULE" version="4"> +<module external.linked.project.id="TreeVNC" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="2.7.2" type="JAVA_MODULE" version="4"> <component name="NewModuleRootManager" inherit-compiler-output="false"> <output url="file://$MODULE_DIR$/build/classes/main" /> <output-test url="file://$MODULE_DIR$/build/classes/test" /> <exclude-output /> <content url="file://$MODULE_DIR$"> <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/viewer_swing/java" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/viewerSwing/java" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/src/viewer_swing/java" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> + <sourceFolder url="file://$MODULE_DIR$/src/viewer_swing/resources" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/viewerSwing/resources" type="java-resource" /> - <sourceFolder url="file://$MODULE_DIR$/src/viewer_swing/resources" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" /> <excludeFolder url="file://$MODULE_DIR$/.gradle" /> <excludeFolder url="file://$MODULE_DIR$/build" /> </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> - <orderEntry type="library" exported="" name="Gradle: jsch-0.1.50" level="project" /> + <orderEntry type="library" exported="" name="Gradle: com.jcraft:jsch:0.1.50" level="project" /> </component> -</module> - +</module> \ No newline at end of file
--- a/src/main/java/com/glavsoft/rfb/protocol/Protocol.java Fri Jan 30 15:37:03 2015 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/Protocol.java Sat Jan 31 00:11:15 2015 +0900 @@ -300,7 +300,7 @@ if (senderTask != null) { senderTask.stopTask(); try { - senderThread.join(1000); + senderThread.join(); } catch (InterruptedException e) { // nop } @@ -314,7 +314,7 @@ if (receiverTask != null) { receiverTask.stopTask(); try { - receiverThread.join(1000); + receiverThread.join(); } catch (InterruptedException e) { // nop }
--- a/src/main/java/com/glavsoft/rfb/protocol/state/InitState.java Fri Jan 30 15:37:03 2015 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/state/InitState.java Sat Jan 31 00:11:15 2015 +0900 @@ -86,7 +86,7 @@ ProtocolSettings settings = context.getSettings(); settings.enableAllEncodingCaps(); completeContextData(serverInitMessage); - super.rfb.setSingleDisplaySize(serverInitMessage.getFrameBufferWidth(), serverInitMessage.getFrameBufferHeight()); +// super.rfb.setSingleDisplaySize(serverInitMessage.getFrameBufferWidth(), serverInitMessage.getFrameBufferHeight()); } }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/RequestSingleDisplaySize.java Sat Jan 31 00:11:15 2015 +0900 @@ -0,0 +1,29 @@ +package jp.ac.u_ryukyu.treevnc; + +import com.glavsoft.exceptions.TransportException; +import com.glavsoft.rfb.client.ClientToServerMessage; +import com.glavsoft.transport.Writer; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; + +/** + * Created by OcBookPro on 15/01/10. + */ +public class RequestSingleDisplaySize implements ClientToServerMessage { + + private short id; + + public RequestSingleDisplaySize() { + } + + @Override + public void send(Writer writer) throws TransportException { + ByteBuffer out = ByteBuffer.allocate(2); + out.order(ByteOrder.BIG_ENDIAN); + out.put(REQUEST_SINGLE_DISPLAY_SIZE); + out.put((byte)0); // padding + writer.write(out.array(), 0, out.position()); + writer.flush(); + } +}
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/RequestSingleDisplayWidth.java Fri Jan 30 15:37:03 2015 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -package jp.ac.u_ryukyu.treevnc; - -import com.glavsoft.exceptions.TransportException; -import com.glavsoft.rfb.client.ClientToServerMessage; -import com.glavsoft.transport.Writer; - -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -/** - * Created by OcBookPro on 15/01/10. - */ -public class RequestSingleDisplayWidth implements ClientToServerMessage { - - private short id; - - public RequestSingleDisplayWidth() { - } - - @Override - public void send(Writer writer) throws TransportException { - ByteBuffer out = ByteBuffer.allocate(2); - out.order(ByteOrder.BIG_ENDIAN); - out.put(REQUEST_SINGLE_DISPLAY_SIZE); - out.put((byte)0); // padding - writer.write(out.array(), 0, out.position()); - writer.flush(); - } -}
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java Fri Jan 30 15:37:03 2015 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java Sat Jan 31 00:11:15 2015 +0900 @@ -501,16 +501,6 @@ return originalInitData; } - public void setOriginalInitData(int singleWidth, int singleHeight, String remoteDesktopName) { - TreeVncCommandChannelListener treeVncCommandChannelListener = new TreeVncCommandChannelListener(this, acceptPort); - originalInitData = treeVncCommandChannelListener.createOriginalInitData(singleWidth, singleHeight, remoteDesktopName); - } - - public byte[] getOriginalInitData() { - return originalInitData; - } - - public void addSerialNumber(LinkedList<ByteBuffer> bufs) { ByteBuffer serialNum = multicastqueue.allocate(4+8); // addSerialNum flag + SerialNum if (this.addSerialNum) {
--- a/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java Fri Jan 30 15:37:03 2015 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java Sat Jan 31 00:11:15 2015 +0900 @@ -871,15 +871,8 @@ @Override public void actionPerformed(ActionEvent e) { // adjustHdSizeButton.setSelected(false); + // この時点で取れてきてるはず・・・! int singleWidth = viewer.getRfb().getSingleWidth(); - int singleHeight = viewer.getRfb().getSingleHeight(); - if (viewer.getRfb().isTreeManager()) { - System.out.println(singleWidth); - uiSettings.adjustHdSize(singleWidth); - return; - } - context.sendMessage(new RequestSingleDisplayWidth()); - System.out.println(singleWidth); uiSettings.adjustHdSize(singleWidth); } }); @@ -896,7 +889,7 @@ int singleWidth = viewer.getRfb().getSingleWidth(); int singleHeight = viewer.getRfb().getSingleHeight(); if (!viewer.getRfb().isTreeManager()) { - context.sendMessage(new RequestSingleDisplayWidth()); + context.sendMessage(new RequestSingleDisplaySize()); } frame.setSize(thisScreenWidth, thisScreenHeight); uiSettings.fitScreen(thisScreenWidth, thisScreenHeight, singleWidth, singleHeight);