changeset 13:5f9709c253f7

add width
author e095732
date Wed, 30 Jan 2013 17:57:25 +0900
parents f842f414655b
children e027d228c455
files src/alice/test/topology/aquarium/fx/AddObject.java src/alice/test/topology/aquarium/fx/CheckMyName.java src/alice/test/topology/aquarium/fx/OtherNode.java
diffstat 3 files changed, 18 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/alice/test/topology/aquarium/fx/AddObject.java	Tue Jan 29 17:59:13 2013 +0900
+++ b/src/alice/test/topology/aquarium/fx/AddObject.java	Wed Jan 30 17:57:25 2013 +0900
@@ -45,7 +45,7 @@
 					new SetTranslation(iv ,iv.getId());
 					list.add(iv);
 					if (mynum == 0) new PositionController(iv.getId());
-					new Share(iv.getId());
+					new Share(iv.getId() ,10);
 				}
 				System.out.println("Create OBJ " + objCnt);
 				System.out.println(list);
--- a/src/alice/test/topology/aquarium/fx/CheckMyName.java	Tue Jan 29 17:59:13 2013 +0900
+++ b/src/alice/test/topology/aquarium/fx/CheckMyName.java	Wed Jan 30 17:57:25 2013 +0900
@@ -19,14 +19,16 @@
 	public void run() {
 		String name = host.asString();
 		Matcher matcher = pattern.matcher(name);
+		matcher.find();
 		
-		matcher.find();
 		int num = new Integer(matcher.group(2));
+		
 		ods.put("local", "mynum", num);
+		ods.put("local", "width", 800);
 		if (num==0) {
 			new TopNode().execute();
 		} else {
-			new OtherNode().execute();
+			new OtherNode();
 		}
 		
 	}
--- a/src/alice/test/topology/aquarium/fx/OtherNode.java	Tue Jan 29 17:59:13 2013 +0900
+++ b/src/alice/test/topology/aquarium/fx/OtherNode.java	Wed Jan 30 17:57:25 2013 +0900
@@ -1,8 +1,18 @@
 package alice.test.topology.aquarium.fx;
 
 import alice.codesegment.CodeSegment;
+import alice.datasegment.CommandType;
+import alice.datasegment.Receiver;
 
 public class OtherNode extends CodeSegment{
+	
+	private Receiver data1 = ids.create(CommandType.PEEK);
+	private Receiver data2 = ids.create(CommandType.PEEK);
+	
+	public OtherNode(){
+		data1.setKey("width");
+		data2.setKey("mynum");
+	}
 
 	@Override
 	public void run() {
@@ -10,6 +20,9 @@
 		new RegistRoutingTable();
 		ods.put("parent", "member", "ADD_MEM");
 		
+		int startX = data1.asInteger() * data2.asInteger(); 
+		ods.put("local", "startX", startX);
+		
 		ods.put("local", "objCnt", 5);
 		Aquarium aqua = new Aquarium();
 		aqua.run();