Skip to content
Snippets Groups Projects
Commit 8fa3d232 authored by Leon Dieter's avatar Leon Dieter
Browse files

minor changes

parent c7b45ff6
No related branches found
No related tags found
No related merge requests found
...@@ -160,6 +160,8 @@ public class Simulator implements Runnable, ActionListener{ ...@@ -160,6 +160,8 @@ public class Simulator implements Runnable, ActionListener{
* Thread nicht korrekt beendet wurde. * Thread nicht korrekt beendet wurde.
*/ */
public boolean reload() { public boolean reload() {
if (simuThread instanceof Thread) { if (simuThread instanceof Thread) {
stopSimu(); stopSimu();
try { try {
...@@ -173,20 +175,24 @@ public class Simulator implements Runnable, ActionListener{ ...@@ -173,20 +175,24 @@ public class Simulator implements Runnable, ActionListener{
Point locationWindow = gui.getLocation(); Point locationWindow = gui.getLocation();
int WidthWindow = gui.getxscale(); int WidthWindow = gui.getxscale();
int HeightWindow = gui.getyscale(); int HeightWindow = gui.getyscale();
System.out.println(gui.getxscale());
System.out.println(gui.getyscale());
System.out.println("aufruf");
gui.stopThread(); gui.stopThread();
gui.dispose(); gui.dispose();
createSubClasses(); createSubClasses();
gui.setLocation(locationWindow); gui.setLocation(locationWindow);
gui.updateGUI(WidthWindow, HeightWindow); gui.setxscale(WidthWindow);
gui.setyscale(HeightWindow);
System.out.println(WidthWindow + " " + HeightWindow);
//gui.updateGUI(WidthWindow, HeightWindow);
for (SimCodeFunction function : functionsCode) { for (SimCodeFunction function : functionsCode) {
arduino.addFunction(function); arduino.addFunction(function);
} }
return true; return true;
} }
......
...@@ -76,6 +76,7 @@ public class GUI extends JFrame implements Runnable, ActionListener { ...@@ -76,6 +76,7 @@ public class GUI extends JFrame implements Runnable, ActionListener {
*/ */
public GUI(Simulator simu) { public GUI(Simulator simu) {
super("ArduBlock Simulator"); super("ArduBlock Simulator");
// Konstruktor der Module // Konstruktor der Module
modules[0] = new RGB(new ImageIcon(getToolkit() modules[0] = new RGB(new ImageIcon(getToolkit()
.getImage(GUI.class.getResource("/tec/letsgoing/ardublock/simulator/img/PM31_RGB_LED.png"))), xscale, yscale); .getImage(GUI.class.getResource("/tec/letsgoing/ardublock/simulator/img/PM31_RGB_LED.png"))), xscale, yscale);
...@@ -198,6 +199,7 @@ public class GUI extends JFrame implements Runnable, ActionListener { ...@@ -198,6 +199,7 @@ public class GUI extends JFrame implements Runnable, ActionListener {
*/ */
public void updateGUI(int _xscale, int _yscale) { public void updateGUI(int _xscale, int _yscale) {
System.out.println("update: " + xscale + " " + _yscale);
for(int i = 0; i < 4; i++) { for(int i = 0; i < 4; i++) {
modules[i].updateGUI(_xscale, _yscale); modules[i].updateGUI(_xscale, _yscale);
...@@ -479,6 +481,16 @@ public class GUI extends JFrame implements Runnable, ActionListener { ...@@ -479,6 +481,16 @@ public class GUI extends JFrame implements Runnable, ActionListener {
return yscale; return yscale;
} }
public void setxscale(int _xscale) {
xscale = _xscale;
}
public void setyscale(int _yscale) {
yscale = _yscale;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment