annotate src/main/java/jp/ac/u_ryukyu/alicevnc/CheckMyName.java @ 31:556e27a53219

refactor and bug fix
author sugi
date Sat, 08 Nov 2014 23:11:45 +0900
parents d8c6a4c7f16e
children aace9df1462e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
30
d8c6a4c7f16e change algotherm
sugi
parents:
diff changeset
1 package jp.ac.u_ryukyu.alicevnc;
d8c6a4c7f16e change algotherm
sugi
parents:
diff changeset
2
d8c6a4c7f16e change algotherm
sugi
parents:
diff changeset
3 import alice.codesegment.CodeSegment;
d8c6a4c7f16e change algotherm
sugi
parents:
diff changeset
4 import alice.datasegment.CommandType;
d8c6a4c7f16e change algotherm
sugi
parents:
diff changeset
5 import alice.datasegment.Receiver;
d8c6a4c7f16e change algotherm
sugi
parents:
diff changeset
6
d8c6a4c7f16e change algotherm
sugi
parents:
diff changeset
7 public class CheckMyName extends CodeSegment {
d8c6a4c7f16e change algotherm
sugi
parents:
diff changeset
8
d8c6a4c7f16e change algotherm
sugi
parents:
diff changeset
9 private Receiver info = ids.create(CommandType.PEEK);
d8c6a4c7f16e change algotherm
sugi
parents:
diff changeset
10
d8c6a4c7f16e change algotherm
sugi
parents:
diff changeset
11 public CheckMyName(){
d8c6a4c7f16e change algotherm
sugi
parents:
diff changeset
12 info.setKey("host");
d8c6a4c7f16e change algotherm
sugi
parents:
diff changeset
13 }
d8c6a4c7f16e change algotherm
sugi
parents:
diff changeset
14
d8c6a4c7f16e change algotherm
sugi
parents:
diff changeset
15 @Override
d8c6a4c7f16e change algotherm
sugi
parents:
diff changeset
16 public void run() {
d8c6a4c7f16e change algotherm
sugi
parents:
diff changeset
17 if ("node0".equals(info.asString())) {
31
556e27a53219 refactor and bug fix
sugi
parents: 30
diff changeset
18 new CreateWindow("local");
556e27a53219 refactor and bug fix
sugi
parents: 30
diff changeset
19 new NegotiateVNCServer();
30
d8c6a4c7f16e change algotherm
sugi
parents:
diff changeset
20 } else {
31
556e27a53219 refactor and bug fix
sugi
parents: 30
diff changeset
21 new CreateWindow("parent");
30
d8c6a4c7f16e change algotherm
sugi
parents:
diff changeset
22 }
31
556e27a53219 refactor and bug fix
sugi
parents: 30
diff changeset
23
556e27a53219 refactor and bug fix
sugi
parents: 30
diff changeset
24 new ReceiveChangeRequest();
556e27a53219 refactor and bug fix
sugi
parents: 30
diff changeset
25 new SendChangeRequest();
30
d8c6a4c7f16e change algotherm
sugi
parents:
diff changeset
26 }
d8c6a4c7f16e change algotherm
sugi
parents:
diff changeset
27
d8c6a4c7f16e change algotherm
sugi
parents:
diff changeset
28 }