Mercurial > hg > Applications > TreeVNC
comparison src/main/java/jp/ac/u_ryukyu/treevnc/CreateConnectionParam.java @ 604:668ff8c17f46
fix Find root
author | riono |
---|---|
date | Tue, 18 Feb 2020 16:56:12 +0900 |
parents | 887ebd993b3d |
children | b1ace1c5d37a |
comparison
equal
deleted
inserted
replaced
603:1ea1ad54224b | 604:668ff8c17f46 |
---|---|
3 import com.glavsoft.viewer.ViewerInterface; | 3 import com.glavsoft.viewer.ViewerInterface; |
4 import com.glavsoft.viewer.swing.ConnectionParams; | 4 import com.glavsoft.viewer.swing.ConnectionParams; |
5 | 5 |
6 public class CreateConnectionParam { | 6 public class CreateConnectionParam { |
7 | 7 |
8 private final FindRoot getBcast; | |
9 private String hostName; | 8 private String hostName; |
10 private int portNumber = ConnectionParams.DEFAULT_VNC_ROOT; | 9 private int portNumber = ConnectionParams.DEFAULT_VNC_ROOT; |
11 private TreeRFBProto rfb; | 10 private TreeRFBProto rfb; |
12 private String myHostName; | 11 private String myHostName; |
13 private boolean rootMode = false; | 12 private boolean rootMode = false; |
15 private boolean displayMode = false; | 14 private boolean displayMode = false; |
16 | 15 |
17 public CreateConnectionParam(TreeRFBProto rfb) { | 16 public CreateConnectionParam(TreeRFBProto rfb) { |
18 this.rfb = rfb; | 17 this.rfb = rfb; |
19 rfb.setConnectionParam(this); | 18 rfb.setConnectionParam(this); |
20 getBcast = new FindRoot(rfb.acceptPort,this); | |
21 } | 19 } |
22 | 20 |
23 public synchronized void findTreeVncRoot() { | 21 |
24 rfb.createRootSelectionPanel(this, getBcast); | |
25 getBcast.findRoot(); | |
26 // wait for RootSelection | |
27 try { | |
28 wait(); | |
29 } catch (InterruptedException e) { | |
30 System.out.println("any thread interrupt when wait for FindRoot " + e.getMessage()); | |
31 } | |
32 } | |
33 | 22 |
34 /** | 23 /** |
35 * To find parent, send WHERE_TO_CONNECT command to the TreeVNC root | 24 * To find parent, send WHERE_TO_CONNECT command to the TreeVNC root |
36 * Incoming CONNECT_TO message is handled in MyRFBProto | 25 * Incoming CONNECT_TO message is handled in MyRFBProto |
37 * @param v | 26 * @param v |
89 | 78 |
90 public synchronized void restart() { | 79 public synchronized void restart() { |
91 notify(); | 80 notify(); |
92 } | 81 } |
93 | 82 |
94 public FindRoot getFindRoot() { | |
95 return getBcast; | |
96 } | |
97 | |
98 } | 83 } |