diff src/main/java/alice/test/topology/aquarium/fx/SetTranslate.java @ 387:1cbac5818dca multicast

add scope dataSegment
author sugi
date Mon, 16 Jun 2014 16:59:39 +0900
parents 878d397904da
children e29cf08ad1f3
line wrap: on
line diff
--- a/src/main/java/alice/test/topology/aquarium/fx/SetTranslate.java	Mon Jun 16 16:57:31 2014 +0900
+++ b/src/main/java/alice/test/topology/aquarium/fx/SetTranslate.java	Mon Jun 16 16:59:39 2014 +0900
@@ -9,11 +9,14 @@
 public class SetTranslate extends CodeSegment {
 	
 	private Receiver info  = ids.create(CommandType.TAKE); // object instance
-	private Receiver info1 = ids.create(CommandType.TAKE); // fish position information
+	private Receiver info1 = ids.create(CommandType.TAKE); // differential value
+	//private Receiver info2 = ids.create(CommandType.TAKE); // absolute fish position value
+	private Receiver info3 = ids.create(CommandType.PEEK); // start x
 	private boolean executed = false;
 	public SetTranslate(String key) {
 		info.setKey(key);
-		info1.setKey(key+"Position");
+		info1.setKey(key+"diffP");
+		info3.setKey("startX");
 	}
 
 	@Override
@@ -24,8 +27,9 @@
 			// javafx's Scene can be accessed only FX application thread.
 			Platform.runLater(this);
 		} else {
-			Group fish   = info.asClass(Group.class);
+			Group fish = info.asClass(Group.class);
 			FishInfo fp = info1.asClass(FishInfo.class);
+			//int scope = info3.asInteger();
         	
         	fish.setTranslateX(fish.getTranslateX()+fp.getX());
         	fish.setTranslateY(fish.getTranslateY()+fp.getY());