Skip to content
Snippets Groups Projects
Commit 54bc3f7b authored by BrunoDatoMeneses's avatar BrunoDatoMeneses
Browse files

DEL: unuseful runlaters

parent af2ef834
No related branches found
No related tags found
1 merge request!4Exp rein
package fr.irit.smac.amak.examples.randomantsMultiUi; package fr.irit.smac.amak.examples.randomantsMultiUi;
import fr.irit.smac.amak.Agent; import fr.irit.smac.amak.Agent;
import fr.irit.smac.amak.tools.RunLaterHelper;
import fr.irit.smac.amak.ui.AmasMultiUIWindow; import fr.irit.smac.amak.ui.AmasMultiUIWindow;
import fr.irit.smac.amak.ui.VUI; import fr.irit.smac.amak.ui.VUI;
import fr.irit.smac.amak.ui.drawables.DrawableImage; import fr.irit.smac.amak.ui.drawables.DrawableImage;
...@@ -47,10 +46,8 @@ public class AntExampleMutliUI extends Agent<AntHillExampleMultiUI, WorldExample ...@@ -47,10 +46,8 @@ public class AntExampleMutliUI extends Agent<AntHillExampleMultiUI, WorldExample
@Override @Override
protected void onRenderingInitialization() { protected void onRenderingInitialization() {
RunLaterHelper.runLater(() -> {
image = getAmas().getVUIMulti().createAndAddImage(dx, dy, "file:resources/ant.png"); image = getAmas().getVUIMulti().createAndAddImage(dx, dy, "file:resources/ant.png");
image.setName("Ant "+getId()); image.setName("Ant "+getId());
});
} }
/** /**
...@@ -84,7 +81,6 @@ public class AntExampleMutliUI extends Agent<AntHillExampleMultiUI, WorldExample ...@@ -84,7 +81,6 @@ public class AntExampleMutliUI extends Agent<AntHillExampleMultiUI, WorldExample
@Override @Override
public void onUpdateRender() { public void onUpdateRender() {
RunLaterHelper.runLater(() -> {
image.move(dx, dy); image.move(dx, dy);
image.setAngle(angle); image.setAngle(angle);
image.setInfo("Ant "+getId()+"\nPosition "+dx+" "+dy+"\nAngle "+angle); image.setInfo("Ant "+getId()+"\nPosition "+dx+" "+dy+"\nAngle "+angle);
...@@ -92,11 +88,5 @@ public class AntExampleMutliUI extends Agent<AntHillExampleMultiUI, WorldExample ...@@ -92,11 +88,5 @@ public class AntExampleMutliUI extends Agent<AntHillExampleMultiUI, WorldExample
image.setFilename("file:Resources/ant_dead.png"); image.setFilename("file:Resources/ant_dead.png");
image.setInfo("Ant "+getId()+"\nPosition "+dx+" "+dy+"\nAngle "+angle+"\nDead"); image.setInfo("Ant "+getId()+"\nPosition "+dx+" "+dy+"\nAngle "+angle+"\nDead");
} }
});
} }
} }
...@@ -18,10 +18,8 @@ public class AntHillExampleMultiUI extends Amas<WorldExampleMultiUI> { ...@@ -18,10 +18,8 @@ public class AntHillExampleMultiUI extends Amas<WorldExampleMultiUI> {
@Override @Override
protected void onRenderingInitialization() { protected void onRenderingInitialization() {
RunLaterHelper.runLater(() -> { vuiMulti.createAndAddImage(20, 20, "file:Resources/ant.png").setFixed().setLayer(10).setShowInExplorer(false);
vuiMulti.createAndAddImage(20, 20, "file:Resources/ant.png").setFixed().setLayer(10).setShowInExplorer(false); antsCountLabel = (DrawableString) vuiMulti.createAndAddString(45, 25, "Ants count").setFixed().setLayer(10).setShowInExplorer(false);
antsCountLabel = (DrawableString) vuiMulti.createAndAddString(45, 25, "Ants count").setFixed().setLayer(10).setShowInExplorer(false);
});
} }
@Override @Override
......
...@@ -44,11 +44,11 @@ public class AntsLaunchExampleMultiUI extends Application{ ...@@ -44,11 +44,11 @@ public class AntsLaunchExampleMultiUI extends Application{
AntHillExampleMultiUI ants = new AntHillExampleMultiUI(window, new VUIMulti("Ants VUI 1"), env); AntHillExampleMultiUI ants = new AntHillExampleMultiUI(window, new VUIMulti("Ants VUI 1"), env);
//new AntHillExampleMultiUI(window2, VUIMulti.get("Ants VUI 2"), env2); //new AntHillExampleMultiUI(window2, VUIMulti.get("Ants VUI 2"), env2);
System.out.println(Configuration.waitForGUI);
for(int i=0;i<10000;i++) { for(int i=0;i<10000;i++) {
System.out.println(i);
ants.cycle(); ants.cycle();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment