Mercurial > hg > Applications > TreeVNC
changeset 604:668ff8c17f46
fix Find root
author | riono |
---|---|
date | Tue, 18 Feb 2020 16:56:12 +0900 |
parents | 1ea1ad54224b |
children | b1ace1c5d37a |
files | Todo.txt src/main/java/jp/ac/u_ryukyu/treevnc/CreateConnectionParam.java src/viewer_swing/java/com/glavsoft/viewer/CuiViewer.java src/viewer_swing/java/com/glavsoft/viewer/Viewer.java src/viewer_swing/java/com/glavsoft/viewer/ViewerInterface.java |
diffstat | 5 files changed, 20 insertions(+), 32 deletions(-) [+] |
line wrap: on
line diff
--- a/Todo.txt Mon Feb 17 17:11:55 2020 +0900 +++ b/Todo.txt Tue Feb 18 16:56:12 2020 +0900 @@ -1,14 +1,8 @@ -Sat Feb 23 08:24:24 JST 2019 - - 64kにframeBufferUpdateRectangleを複数詰め込むことにより大きさをそろえることができる。 +Tue Feb 18 16:13:15 JST 2020 - +----+ - | | - +---------------+ - | | - +----+----------+ - | | - +----+ + NetworkInterfaceがマルチキャストをサポートしていたらマルチキャストを使用する + ただし、ダイレクトモードでアクセスしたら、streamする + ダイレクトモードアクセスかどうかの判断は難しい Fri Feb 22 19:12:24 JST 2019
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/CreateConnectionParam.java Mon Feb 17 17:11:55 2020 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/CreateConnectionParam.java Tue Feb 18 16:56:12 2020 +0900 @@ -5,7 +5,6 @@ public class CreateConnectionParam { - private final FindRoot getBcast; private String hostName; private int portNumber = ConnectionParams.DEFAULT_VNC_ROOT; private TreeRFBProto rfb; @@ -17,19 +16,9 @@ public CreateConnectionParam(TreeRFBProto rfb) { this.rfb = rfb; rfb.setConnectionParam(this); - getBcast = new FindRoot(rfb.acceptPort,this); } - public synchronized void findTreeVncRoot() { - rfb.createRootSelectionPanel(this, getBcast); - getBcast.findRoot(); - // wait for RootSelection - try { - wait(); - } catch (InterruptedException e) { - System.out.println("any thread interrupt when wait for FindRoot " + e.getMessage()); - } - } + /** * To find parent, send WHERE_TO_CONNECT command to the TreeVNC root @@ -91,8 +80,4 @@ notify(); } - public FindRoot getFindRoot() { - return getBcast; - } - }
--- a/src/viewer_swing/java/com/glavsoft/viewer/CuiViewer.java Mon Feb 17 17:11:55 2020 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/CuiViewer.java Tue Feb 18 16:56:12 2020 +0900 @@ -246,7 +246,7 @@ TreeRFBProto rfb = new TreeRFBProto(false, this); CreateConnectionParam cp = new CreateConnectionParam(rfb); if (hostName==null) { - cp.findTreeVncRoot(); + findTreeVncRoot(rfb, cp); } else { cp.setHostName(hostName); }
--- a/src/viewer_swing/java/com/glavsoft/viewer/Viewer.java Mon Feb 17 17:11:55 2020 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/Viewer.java Tue Feb 18 16:56:12 2020 +0900 @@ -408,7 +408,7 @@ if (hostName!=null) { cp.setHostName(hostName); } else { - cp.findTreeVncRoot(); + findTreeVncRoot(rfb,cp); // selected "Start Display Mode" or "Start as TreeVNC Root" for start selection panel if (cp.isDisplayMode() || cp.isRootMode()) { myRfb = rfb;
--- a/src/viewer_swing/java/com/glavsoft/viewer/ViewerInterface.java Mon Feb 17 17:11:55 2020 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/ViewerInterface.java Tue Feb 18 16:56:12 2020 +0900 @@ -5,10 +5,7 @@ import com.glavsoft.transport.Writer; import com.glavsoft.viewer.swing.ConnectionParams; import com.glavsoft.viewer.swing.SwingViewerWindow; -import jp.ac.u_ryukyu.treevnc.BroadcastRFBListener; -import jp.ac.u_ryukyu.treevnc.ScreenChangeRequest; -import jp.ac.u_ryukyu.treevnc.ScreenChangeSelectionPanel; -import jp.ac.u_ryukyu.treevnc.TreeRFBProto; +import jp.ac.u_ryukyu.treevnc.*; import java.awt.*; import java.io.IOException; @@ -140,4 +137,16 @@ selectionPanel.visible(); } } + + default void findTreeVncRoot(TreeRFBProto rfb,CreateConnectionParam cp) { + FindRoot getBcast = new FindRoot(rfb.acceptPort, cp); + rfb.createRootSelectionPanel(cp, getBcast); + getBcast.findRoot(); + // wait for RootSelection + try { + cp.wait(); + } catch (InterruptedException e) { + System.out.println("any thread interrupt when wait for FindRoot " + e.getMessage()); + } + } }