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 cab02ba405acfa251eeb922c8876721bf53cddc5..c6105d4266bf13dfaeb24dba1cd658f6e5479a24 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 cd1b0f8186aff5d3251a92ad0e3b5985560f920a..82d56eb0c33456efbe56bbab299f2c29d409ba2f 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);