30
|
1 package jp.ac.u_ryukyu.alicevnc;
|
|
2
|
|
3 import alice.codesegment.CodeSegment;
|
|
4 import alice.datasegment.CommandType;
|
|
5 import alice.datasegment.Receiver;
|
|
6
|
|
7 public class CheckMyName extends CodeSegment {
|
|
8
|
|
9 private Receiver info = ids.create(CommandType.PEEK);
|
|
10
|
47
|
11 public CheckMyName(CodeSegment cs){
|
|
12 this.aliceDaemon = cs.aliceDaemon;
|
|
13 info.setKey("host", this);
|
30
|
14 }
|
|
15
|
|
16 @Override
|
|
17 public void run() {
|
|
18 if ("node0".equals(info.asString())) {
|
47
|
19 new CreateWindow("local", this);
|
|
20 new NegotiateVNCServer(this);
|
30
|
21 } else {
|
47
|
22 new CreateWindow("parent", this);
|
30
|
23 }
|
31
|
24
|
47
|
25 new ReceiveAliceVNCMessage(this);
|
|
26 new SendChangeRequest(this);
|
30
|
27 }
|
|
28
|
|
29 }
|