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

minor changes

parent 868abafd
Branches
No related tags found
No related merge requests found
...@@ -67,7 +67,7 @@ public class GUI extends JFrame implements Runnable, ActionListener { ...@@ -67,7 +67,7 @@ public class GUI extends JFrame implements Runnable, ActionListener {
private int yscale = 968; private int yscale = 968;
private JPanel modulPanel; private JPanel modulPanel;
private Container mainPane; private Container mainPane;
private int WindowHeight = 968, WindowWidth = 968, topPanelHeight, topPanelWidth; private int WindowHeight = 1000, WindowWidth = 950, topPanelHeight, topPanelWidth;
/** /**
* Konstruktor der Klasse GUI * Konstruktor der Klasse GUI
...@@ -138,24 +138,21 @@ public class GUI extends JFrame implements Runnable, ActionListener { ...@@ -138,24 +138,21 @@ 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()) > 30 || Math.abs(WindowWidth - getWidth()) > 30) { if(Math.abs(WindowHeight - getHeight()) > 5 || Math.abs(WindowWidth - getWidth()) > 5) {
WindowHeight = getHeight(); WindowHeight = getHeight();
WindowWidth = getWidth(); WindowWidth = getWidth();
topPanelWidth = topPanel.getWidth(); topPanelWidth = topPanel.getWidth();
topPanelHeight = topPanel.getHeight(); topPanelHeight = topPanel.getHeight();
System.out.println("WindowWidth" + WindowWidth);
System.out.println("WindowHeight" + WindowHeight);
System.out.println("toppanelWidth" + topPanelWidth);
System.out.println("toppanelHeight" + topPanelHeight);
//GUI wird nur gleichmig skaliert mit den Gren des kleineren Seitenverhtlnisses //GUI wird nur gleichmig skaliert mit den Gren des kleineren Seitenverhtlnisses
if(WindowWidth <= WindowHeight) { if(WindowWidth <= WindowHeight - 80) {
xscale = WindowWidth; xscale = WindowWidth;
yscale = WindowWidth; yscale = WindowWidth;
} }
else { else {
xscale = WindowHeight; xscale = WindowHeight - 80;
yscale = WindowHeight; yscale = WindowHeight - 80;
} }
//GUI wird upgedatet //GUI wird upgedatet
...@@ -164,7 +161,7 @@ public class GUI extends JFrame implements Runnable, ActionListener { ...@@ -164,7 +161,7 @@ public class GUI extends JFrame implements Runnable, ActionListener {
} }
updateSerialLog(getHeight()-topPanel.getHeight());
} }
@Override @Override
...@@ -204,7 +201,8 @@ public class GUI extends JFrame implements Runnable, ActionListener { ...@@ -204,7 +201,8 @@ public class GUI extends JFrame implements Runnable, ActionListener {
modules[2].updateGUI(xscale, yscale); modules[2].updateGUI(xscale, yscale);
modules[3].updateGUI(xscale, yscale); modules[3].updateGUI(xscale, yscale);
updateSerialLog(WindowWidth);
} }
...@@ -310,20 +308,8 @@ public class GUI extends JFrame implements Runnable, ActionListener { ...@@ -310,20 +308,8 @@ 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/30), 2), 16);
if(size >= 1000) { serialLog.setRows(numRows);
serialLog.setRows(3); // Anzahl der Angezeigten Reihen
}
else if(size < 1000 && size >= 800) {
serialLog.setRows(6); // Anzahl der Angezeigten Reihen
}
else if(size < 800 && size >= 600) {
serialLog.setRows(8); // Anzahl der Angezeigten Reihen
}
else if(size < 600) {
serialLog.setRows(10); // Anzahl der Angezeigten Reihen
}
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment