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
|
|
11 public CheckMyName(){
|
|
12 info.setKey("host");
|
|
13 }
|
|
14
|
|
15 @Override
|
|
16 public void run() {
|
|
17 if ("node0".equals(info.asString())) {
|
31
|
18 new CreateWindow("local");
|
|
19 new NegotiateVNCServer();
|
30
|
20 } else {
|
31
|
21 new CreateWindow("parent");
|
30
|
22 }
|
31
|
23
|
|
24 new ReceiveChangeRequest();
|
|
25 new SendChangeRequest();
|
30
|
26 }
|
|
27
|
|
28 }
|