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

minor changes

parent 88a778dd
Branches
No related tags found
No related merge requests found
...@@ -127,9 +127,9 @@ public class GUI extends JFrame implements Runnable, ActionListener { ...@@ -127,9 +127,9 @@ public class GUI extends JFrame implements Runnable, ActionListener {
//mainPane.add(createControlPanel(simu), BorderLayout.EAST); //mainPane.add(createControlPanel(simu), BorderLayout.EAST);
mainPane.add(createSerialLog(), BorderLayout.PAGE_END); mainPane.add(createSerialLog(), BorderLayout.PAGE_END);
//this.setSize(xscale, yscale); //this.setSize(xscale, yscale);
this.pack(); super.pack();
// this.setLocation(-1300, 0); //Mglichkeit die Renderingposition festzulegen // this.setLocation(-1300, 0); //Mglichkeit die Renderingposition festzulegen
this.setVisible(true); super.setVisible(true);
//ComponentListener wird hinzugefgt, der auf das Vergrern des Fenster reagiert und die GUI neu ldt //ComponentListener wird hinzugefgt, der auf das Vergrern des Fenster reagiert und die GUI neu ldt
this.addComponentListener(new ComponentListener() { this.addComponentListener(new ComponentListener() {
...@@ -138,7 +138,7 @@ public class GUI extends JFrame implements Runnable, ActionListener { ...@@ -138,7 +138,7 @@ public class GUI extends JFrame implements Runnable, ActionListener {
//Das Fenster soll erst dann upgedatet werden wenn eine Grennderung grer 30 stattgefunden hat //Das Fenster soll erst dann upgedatet werden wenn eine Grennderung grer 30 stattgefunden hat
//um zu verhindern dass die update Funktion durch ein zu hufiges Aufrufen das Programm aufhngt. //um zu verhindern dass die update Funktion durch ein zu hufiges Aufrufen das Programm aufhngt.
if((Math.abs(WindowHeight - getHeight()) > 15) || (Math.abs(WindowWidth - getWidth()) > 15)) { if((Math.abs(WindowHeight - getHeight()) > 5) || (Math.abs(WindowWidth - getWidth()) > 5)) {
WindowHeight = getHeight(); WindowHeight = getHeight();
WindowWidth = getWidth(); WindowWidth = getWidth();
...@@ -192,20 +192,26 @@ public class GUI extends JFrame implements Runnable, ActionListener { ...@@ -192,20 +192,26 @@ public class GUI extends JFrame implements Runnable, ActionListener {
* @param yscale * @param yscale
* Fenstergre in y * Fenstergre in y
*/ */
public void updateGUI(int xscale, int yscale) { public void updateGUI(int _xscale, int _yscale) {
for(int i = 0; i < 4; i++) {
modules[0].updateGUI(xscale, yscale); modules[i].updateGUI(_xscale, _yscale);
modules[1].updateGUI(xscale, yscale);
modules[2].updateGUI(xscale, yscale); }
modules[3].updateGUI(xscale, yscale);
// modules[0].updateGUI(_xscale, _yscale);
// modules[1].updateGUI(_xscale, _yscale);
// modules[2].updateGUI(_xscale, _yscale);
// modules[3].updateGUI(_xscale, _yscale);
//updateSerialLog(getHeight()-topPanel.getHeight());
updateSerialLog(getHeight()-topPanel.getHeight()); updateSerialLog(getHeight()-topPanel.getHeight());
System.out.println(topPanel.getHeight());
System.out.println(modulPanel.getHeight());
super.setVisible(true);
panel.setVisible(true);
} }
...@@ -312,7 +318,7 @@ public class GUI extends JFrame implements Runnable, ActionListener { ...@@ -312,7 +318,7 @@ public class GUI extends JFrame implements Runnable, ActionListener {
*/ */
public void updateSerialLog(int size) { public void updateSerialLog(int size) {
int numRows = Math.min(Math.max(((int)size/20-3), 3), 20); int numRows = Math.min(Math.max(((int)size/20)-3, 3), 20);
serialLog.setRows(numRows); serialLog.setRows(numRows);
System.out.println(numRows); System.out.println(numRows);
} }
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment