Skip to content
Snippets Groups Projects
Commit bb9cde2f authored by Anian Bühler's avatar Anian Bühler
Browse files

removed controlpanel (btns) and reduced refresh rate to 60 Hz

parent fa135f96
Branches
No related tags found
No related merge requests found
......@@ -53,8 +53,8 @@ public class GUI extends JFrame implements Runnable, ActionListener {
private Modul[] modules = new Modul[4];
private volatile boolean stopFlag = false;
private JTextArea serialLog = new JTextArea();
private static int xscale= 1080;
private static int yscale= 1080;
private static int xscale= 720;
private static int yscale= 720;
/**
* Konstruktor der Klasse GUI
......@@ -63,16 +63,13 @@ public class GUI extends JFrame implements Runnable, ActionListener {
*/
public GUI(Simulator simu) {
super("ArduBlock Simulator");
this.addComponentListener(new ComponentListener() {
this.addComponentListener(new ComponentListener() {
@Override
public void componentResized(ComponentEvent e) {
System.out.println("test");
xscale = getWidth();
yscale = getHeight();
System.out.println("xScale: " + xscale + "\tyScale: " + yscale);
}
@Override
......@@ -128,6 +125,7 @@ public class GUI extends JFrame implements Runnable, ActionListener {
super.paint(g);
drawConnections(g); // Zeichne Verdrahtung
}
};
// Füge Module hinzu
modulPanel.add(modules[0].getPane(), BorderLayout.WEST);
......@@ -143,6 +141,8 @@ public class GUI extends JFrame implements Runnable, ActionListener {
// this.setLocation(-1300, 0); //M�glichkeit die Renderingposition festzulegen
this.setVisible(true);
}
/**
......@@ -281,7 +281,8 @@ public class GUI extends JFrame implements Runnable, ActionListener {
public void run() {
while (!stopFlag) {
try {
Thread.sleep(7); // 144Hz
//Thread.sleep(7); // 144 Hz
Thread.sleep(17); //60 Hz
} catch (InterruptedException e) {
// e.printStackTrace();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment