Mercurial > hg > Members > sugi > javafx
annotate src/alice/test/topology/aquarium/fx/UpdateData.java @ 15:3458bde834d3
remove NullPointerException
author | e095732 |
---|---|
date | Sat, 02 Feb 2013 02:24:05 +0900 |
parents | b973de8b6785 |
children | 5e6d40908c60 |
rev | line source |
---|---|
4
50d77513d52e
Platform runLater must use for handling instance from other thread (Not on FX application thread )
e095732
parents:
diff
changeset
|
1 package alice.test.topology.aquarium.fx; |
50d77513d52e
Platform runLater must use for handling instance from other thread (Not on FX application thread )
e095732
parents:
diff
changeset
|
2 |
50d77513d52e
Platform runLater must use for handling instance from other thread (Not on FX application thread )
e095732
parents:
diff
changeset
|
3 import alice.codesegment.CodeSegment; |
15 | 4 import alice.datasegment.CommandType; |
5 import alice.datasegment.Receiver; | |
4
50d77513d52e
Platform runLater must use for handling instance from other thread (Not on FX application thread )
e095732
parents:
diff
changeset
|
6 |
50d77513d52e
Platform runLater must use for handling instance from other thread (Not on FX application thread )
e095732
parents:
diff
changeset
|
7 public class UpdateData extends CodeSegment { |
50d77513d52e
Platform runLater must use for handling instance from other thread (Not on FX application thread )
e095732
parents:
diff
changeset
|
8 |
15 | 9 private Receiver data1 = ids.create(CommandType.PEEK); |
10 private Receiver data2 = ids.create(CommandType.TAKE); | |
4
50d77513d52e
Platform runLater must use for handling instance from other thread (Not on FX application thread )
e095732
parents:
diff
changeset
|
11 |
15 | 12 public UpdateData(FishData fd){ |
13 ods.put("local", "diff", fd); | |
14 data1.setKey("image1"); | |
15 data2.setKey("diff"); | |
4
50d77513d52e
Platform runLater must use for handling instance from other thread (Not on FX application thread )
e095732
parents:
diff
changeset
|
16 } |
50d77513d52e
Platform runLater must use for handling instance from other thread (Not on FX application thread )
e095732
parents:
diff
changeset
|
17 |
50d77513d52e
Platform runLater must use for handling instance from other thread (Not on FX application thread )
e095732
parents:
diff
changeset
|
18 @Override |
50d77513d52e
Platform runLater must use for handling instance from other thread (Not on FX application thread )
e095732
parents:
diff
changeset
|
19 public void run() { |
15 | 20 FishData fd1 = data1.asClass(FishData.class); |
21 FishData fd2 = data2.asClass(FishData.class); | |
22 | |
23 fd1.SetXYZ(fd1.getX()+fd2.getX(), | |
24 fd1.getY()+fd2.getY(), | |
25 fd1.getZ()+fd2.getZ()); | |
26 ods.update("local", data1.key, fd1); | |
27 System.out.println("PUTDATA"); | |
4
50d77513d52e
Platform runLater must use for handling instance from other thread (Not on FX application thread )
e095732
parents:
diff
changeset
|
28 } |
50d77513d52e
Platform runLater must use for handling instance from other thread (Not on FX application thread )
e095732
parents:
diff
changeset
|
29 } |