Mercurial > hg > Database > Alice
changeset 520:c9175c310987 dispose
add reconnect event on aquariumFX
author | sugi |
---|---|
date | Fri, 23 Jan 2015 14:51:58 +0900 |
parents | 16f44f2060cc |
children | b6e663a9a372 |
files | src/main/java/alice/test/topology/aquarium/fx/CalculatePosition.java src/main/java/alice/test/topology/aquarium/fx/GetMyHostName.java src/main/java/alice/test/topology/aquarium/fx/MoveBeforePosition.java src/main/java/alice/test/topology/aquarium/fx/SetTranslate.java src/main/java/alice/test/topology/aquarium/fx/StartAquariumFX.java |
diffstat | 5 files changed, 53 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/alice/test/topology/aquarium/fx/CalculatePosition.java Fri Jan 23 14:47:02 2015 +0900 +++ b/src/main/java/alice/test/topology/aquarium/fx/CalculatePosition.java Fri Jan 23 14:51:58 2015 +0900 @@ -37,6 +37,4 @@ this.recycle(); } - - }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/alice/test/topology/aquarium/fx/GetMyHostName.java Fri Jan 23 14:51:58 2015 +0900 @@ -0,0 +1,20 @@ +package alice.test.topology.aquarium.fx; + +import alice.codesegment.CodeSegment; +import alice.datasegment.CommandType; +import alice.datasegment.Receiver; + +public class GetMyHostName extends CodeSegment{ + + private Receiver info = ids.create(CommandType.PEEK); + + public GetMyHostName() { + info.setKey("host"); + } + @Override + public void run() { + String host = info.asString(); + new MoveBeforePosition(host); + } + +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/alice/test/topology/aquarium/fx/MoveBeforePosition.java Fri Jan 23 14:51:58 2015 +0900 @@ -0,0 +1,31 @@ +package alice.test.topology.aquarium.fx; + +import alice.codesegment.CodeSegment; +import alice.datasegment.CommandType; +import alice.datasegment.Receiver; + +public class MoveBeforePosition extends CodeSegment { + + private Receiver info = ids.create(CommandType.PEEK); + private Receiver info1 = ids.create(CommandType.TAKE); + private Receiver info2 = ids.create(CommandType.PEEK); + + public MoveBeforePosition(String key) { + info.setKey("parent", key+"FishbackUp"); + info1.setKey("OwnFishP"); + info2.setKey("host"); + } + @Override + public void run() { + FishInfo fp = info.asClass(FishInfo.class); + FishInfo fp2 = fp.clone(); + fp2.setX(0); + fp2.setY(0); + fp2.setZ(0); + ods.put(info1.key, fp); + String key = info2.asString(); + ods.put(key+"FishdiffP", fp2); + + } + +}
--- a/src/main/java/alice/test/topology/aquarium/fx/SetTranslate.java Fri Jan 23 14:47:02 2015 +0900 +++ b/src/main/java/alice/test/topology/aquarium/fx/SetTranslate.java Fri Jan 23 14:51:58 2015 +0900 @@ -25,6 +25,7 @@ if (!executed) { executed = true; new SendDataOthers(info1, info1.key); + ods.update(info.key+"backUp", info1.getReceiveData()); // javafx's Scene can be accessed only FX application thread. Platform.runLater(this); } else {
--- a/src/main/java/alice/test/topology/aquarium/fx/StartAquariumFX.java Fri Jan 23 14:47:02 2015 +0900 +++ b/src/main/java/alice/test/topology/aquarium/fx/StartAquariumFX.java Fri Jan 23 14:51:58 2015 +0900 @@ -5,6 +5,7 @@ public class StartAquariumFX { public static void main(String args[]){ AquariumConfig conf = new AquariumConfig(args); + conf.register(GetMyHostName.class); StartCodeSegment cs = new StartCodeSegment(); if (conf.getManagerHostName() !=null){ cs.ods.put("type", conf.type);