From 534e85ab7c607b3720bf22bb1dab0ac131c61768 Mon Sep 17 00:00:00 2001
From: buehlera <buehlera@tec-nb-buehlera>
Date: Fri, 17 Jul 2020 15:13:55 +0200
Subject: [PATCH] changes 20200717

---
 res/{ => img}/ArduinoUno.png                  | Bin
 res/{ => img}/Measure.png                     | Bin
 res/{ => img}/PM24_Potentiometer.png          | Bin
 res/{ => img}/PM26_Taster.png                 | Bin
 res/{ => img}/PM31_RGB_LED.png                | Bin
 res/{ => img}/Play.png                        | Bin
 res/{ => img}/Reload.png                      | Bin
 res/{ => img}/Reset.png                       | Bin
 res/{ => img}/Stop.png                        | Bin
 res/{ => img}/Taster_Off.png                  | Bin
 res/{ => img}/Taster_On.png                   | Bin
 .../ardublock/simulator/Simulator.java        |   4 +++-
 .../ardublock/simulator/view/GUI.java         |  19 ++++++++++++++----
 13 files changed, 18 insertions(+), 5 deletions(-)
 rename res/{ => img}/ArduinoUno.png (100%)
 rename res/{ => img}/Measure.png (100%)
 rename res/{ => img}/PM24_Potentiometer.png (100%)
 rename res/{ => img}/PM26_Taster.png (100%)
 rename res/{ => img}/PM31_RGB_LED.png (100%)
 rename res/{ => img}/Play.png (100%)
 rename res/{ => img}/Reload.png (100%)
 rename res/{ => img}/Reset.png (100%)
 rename res/{ => img}/Stop.png (100%)
 rename res/{ => img}/Taster_Off.png (100%)
 rename res/{ => img}/Taster_On.png (100%)

diff --git a/res/ArduinoUno.png b/res/img/ArduinoUno.png
similarity index 100%
rename from res/ArduinoUno.png
rename to res/img/ArduinoUno.png
diff --git a/res/Measure.png b/res/img/Measure.png
similarity index 100%
rename from res/Measure.png
rename to res/img/Measure.png
diff --git a/res/PM24_Potentiometer.png b/res/img/PM24_Potentiometer.png
similarity index 100%
rename from res/PM24_Potentiometer.png
rename to res/img/PM24_Potentiometer.png
diff --git a/res/PM26_Taster.png b/res/img/PM26_Taster.png
similarity index 100%
rename from res/PM26_Taster.png
rename to res/img/PM26_Taster.png
diff --git a/res/PM31_RGB_LED.png b/res/img/PM31_RGB_LED.png
similarity index 100%
rename from res/PM31_RGB_LED.png
rename to res/img/PM31_RGB_LED.png
diff --git a/res/Play.png b/res/img/Play.png
similarity index 100%
rename from res/Play.png
rename to res/img/Play.png
diff --git a/res/Reload.png b/res/img/Reload.png
similarity index 100%
rename from res/Reload.png
rename to res/img/Reload.png
diff --git a/res/Reset.png b/res/img/Reset.png
similarity index 100%
rename from res/Reset.png
rename to res/img/Reset.png
diff --git a/res/Stop.png b/res/img/Stop.png
similarity index 100%
rename from res/Stop.png
rename to res/img/Stop.png
diff --git a/res/Taster_Off.png b/res/img/Taster_Off.png
similarity index 100%
rename from res/Taster_Off.png
rename to res/img/Taster_Off.png
diff --git a/res/Taster_On.png b/res/img/Taster_On.png
similarity index 100%
rename from res/Taster_On.png
rename to res/img/Taster_On.png
diff --git a/src/tec/letsgoing/ardublock/simulator/Simulator.java b/src/tec/letsgoing/ardublock/simulator/Simulator.java
index cab02ba..c6105d4 100644
--- a/src/tec/letsgoing/ardublock/simulator/Simulator.java
+++ b/src/tec/letsgoing/ardublock/simulator/Simulator.java
@@ -36,7 +36,9 @@ public class Simulator implements Runnable, ActionListener {
 
 	private Vector<SimCodeFunction> functionsCode = new Vector<SimCodeFunction>();
 
-	private Simulator() {
+	//changed to public by Anian
+	//private Simulator() {
+	public Simulator() {
 		createSubClasses();
 	}
 
diff --git a/src/tec/letsgoing/ardublock/simulator/view/GUI.java b/src/tec/letsgoing/ardublock/simulator/view/GUI.java
index cd1b0f8..82d56eb 100644
--- a/src/tec/letsgoing/ardublock/simulator/view/GUI.java
+++ b/src/tec/letsgoing/ardublock/simulator/view/GUI.java
@@ -23,6 +23,7 @@ import javax.swing.JScrollPane;
 import javax.swing.JTextArea;
 import javax.swing.text.DefaultCaret;
 
+//import edu.mit.blocks.workspace.Workspace;
 import tec.letsgoing.ardublock.simulator.Simulator;
 import tec.letsgoing.ardublock.simulator.arduino.Arduino;
 import tec.letsgoing.ardublock.simulator.view.modules.ArduinoUno;
@@ -77,10 +78,20 @@ public class GUI extends JFrame implements Runnable, ActionListener {
 		JButton reloadButton = new JButton();
 		JButton measButton = new JButton();
 
-		goButton.setIcon(new ImageIcon("res/Play.png"));
-		stopButton.setIcon(new ImageIcon("res/Stop.png"));
-		reloadButton.setIcon(new ImageIcon("res/Reload.png"));
-		measButton.setIcon(new ImageIcon("res/Measure.png"));
+		//Changes by Anian: added res to build-path (subfolder img) to export images to .jar file
+		//TODO get Images (Modules and Arduino) in ArduBlock and from .jar-File
+		// e.g. by  getToolkit().getImage(GUI.class.getResource("PathToImage")) 
+		//-> compare OpenBlocks-Workspace.java line 156 
+		// creating Modules with images -> maybe pass img by parameter? -> getToolkit not available in Modules...
+		goButton.setIcon(new ImageIcon(getToolkit().getImage(GUI.class.getResource("/img/Play.png"))));
+		stopButton.setIcon(new ImageIcon(getToolkit().getImage(GUI.class.getResource("/img/Stop.png"))));
+		reloadButton.setIcon(new ImageIcon(getToolkit().getImage(GUI.class.getResource("/img/Reload.png"))));
+		measButton.setIcon(new ImageIcon(getToolkit().getImage(GUI.class.getResource("/img/Measure.png"))));
+		
+		//goButton.setIcon(new ImageIcon("res/Play.png"));
+		//stopButton.setIcon(new ImageIcon("res/Stop.png"));
+		//reloadButton.setIcon(new ImageIcon("res/Reload.png"));
+		//measButton.setIcon(new ImageIcon("res/Measure.png"));
 
 		goButton.addActionListener(simu);
 		stopButton.addActionListener(simu);
-- 
GitLab