diff --git a/ressources/Rule/BlobRule.json b/ressources/Rule/BlobRule.json index 822a900..be22af7 100644 --- a/ressources/Rule/BlobRule.json +++ b/ressources/Rule/BlobRule.json @@ -1,6 +1,6 @@ [{"cell": { "value" : 1, - "color" : [167,237,139], + "color" : [255,255,66], "conditionCountNear" : [3,5,7], "conditionHighestNear" : [], "ifValue" : 1, @@ -8,7 +8,7 @@ }}, {"cell": { "value" : 0, - "color" : [37,52,31], + "color" : [97, 94, 58], "conditionCountNear" : [1,3,5,8], "conditionHighestNear" : [], "ifValue" : 1, diff --git a/src/windowInterface/MyInterface.java b/src/windowInterface/MyInterface.java index d58cc85..30d431b 100644 --- a/src/windowInterface/MyInterface.java +++ b/src/windowInterface/MyInterface.java @@ -66,6 +66,14 @@ public class MyInterface extends JFrame { panelRight.setLayout(new GridLayout(12,1)); contentPane.add(panelRight, BorderLayout.EAST); + JButton btnStop = new JButton("Stop/Reset"); + btnStop.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + stopSimu(); + } + }); + panelTop.add(btnStop); + JButton btnGo = new JButton("Start/Pause"); btnGo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { @@ -133,14 +141,6 @@ public class MyInterface extends JFrame { } }); panelRight.add(btnLoadRule); - - JButton btnSaveRule = new JButton("Save Rule"); - btnSaveRule.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent arg0) { - clicSaveRuleToFileButton(); - } - }); - panelRight.add(btnSaveRule); JButton btnLoadAgents = new JButton("Load Agents"); btnLoadAgents.addActionListener(new ActionListener() { @@ -205,6 +205,11 @@ public class MyInterface extends JFrame { panelRight.add(clickLabel); clickLabel.setText("click : " + mySimu.clickActionName()); } + public void stopSimu() { + mySimu = new Simulator(this); + panelDraw.setSimu(mySimu); + panelDraw.repaint(); + } public void setStepBanner(String s) { stepLabel.setText(s); @@ -350,14 +355,6 @@ public class MyInterface extends JFrame { } } - public void clicSaveRuleToFileButton() { - String fileName=SelectFile(); - if (fileName.length()>0) { - ArrayList content = mySimu.getRule(); - writeFile(fileName, (String[]) content.toArray()); - } - } - public void clicSaveAgentsToFileButton() { String fileName=SelectFile(); if (fileName.length()>0) {