diff --git a/HeatUp/src/de/heatup/ui/StatusPanelAdder.java b/HeatUp/src/de/heatup/ui/StatusPanelAdder.java index 9b43ce1..af32d3e 100644 --- a/HeatUp/src/de/heatup/ui/StatusPanelAdder.java +++ b/HeatUp/src/de/heatup/ui/StatusPanelAdder.java @@ -6,19 +6,22 @@ import java.awt.GridBagConstraints; import java.awt.Insets; import javax.swing.JLabel; +import javax.swing.JPanel; import javax.swing.JProgressBar; import javax.swing.SwingConstants; import javax.swing.border.LineBorder; +import de.heatup.testing.GameLoopD; import de.heatup.ui.statusPanel.Score; import de.heatup.ui.statusPanel.Temperature; import de.heatup.ui.statusPanel.Timer; public class StatusPanelAdder{ - Temperature temp; - Score score; - Timer timer; + private Temperature temp; + private Score score; + private Timer timer; + public static JPanel panel; public int getTemp(){ return temp.getTemp(); @@ -30,6 +33,10 @@ public class StatusPanelAdder{ return timer.getTime(); } + public void setPanel(JPanel panel){ + this.panel=panel; + } + public static void createPanel(){ JLabel labelTemp= new JLabel("temperature"); labelTemp.setFont(new Font("Arial", Font.CENTER_BASELINE, 16)); @@ -68,7 +75,7 @@ public class StatusPanelAdder{ //Insets(int top, int left, int bottom, int right); - GameInterface.getStatusPanel().add(labelTime, new GridBagConstraints( // formPanel ist das Panel, indas eingefügt wird + panel.add(labelTime, new GridBagConstraints( // formPanel ist das Panel, indas eingefügt wird 1, 1, // Spaltennr., Zeilennr. 4, 2, // Spaltenbreite (gridwidth), Zeilenbreite (gridheigth) 0.0, 0.0, @@ -77,7 +84,7 @@ public class StatusPanelAdder{ new Insets(0,20,30,20), // Abstand zu den anderen Objekten 0,0)); - GameInterface.getStatusPanel().add(timeLabel, new GridBagConstraints( // formPanel ist das Panel, indas eingefügt wird + panel.add(timeLabel, new GridBagConstraints( // formPanel ist das Panel, indas eingefügt wird 2, 1, // Spaltennr., Zeilennr. 4, 2, // Spaltenbreite (gridwidth), Zeilenbreite (gridheigth) 0.0, 0.0, @@ -88,7 +95,7 @@ public class StatusPanelAdder{ - GameInterface.getStatusPanel().add(labelTemp, new GridBagConstraints( // formPanel ist das Panel, indas eingefügt wird + panel.add(labelTemp, new GridBagConstraints( // formPanel ist das Panel, indas eingefügt wird 3, 1, // Spaltennr., Zeilennr. 4, 2, // Spaltenbreite (gridwidth), Zeilenbreite (gridheigth) 0.0, 0.0, @@ -97,7 +104,7 @@ public class StatusPanelAdder{ new Insets(0,20,30,20), // Abstand zu den anderen Objekten 0,0)); - GameInterface.getStatusPanel().add(tempBar, new GridBagConstraints( // formPanel ist das Panel, indas eingefügt wird + panel.add(tempBar, new GridBagConstraints( // formPanel ist das Panel, indas eingefügt wird 3, 2, // Spaltennr., Zeilennr. 4, 2, // Spaltenbreite (gridwidth), Zeilenbreite (gridheigth) 0.0, 0.0, @@ -108,7 +115,7 @@ public class StatusPanelAdder{ - GameInterface.getStatusPanel().add(labelScore, new GridBagConstraints( // formPanel ist das Panel, indas eingefügt wird + panel.add(labelScore, new GridBagConstraints( // formPanel ist das Panel, indas eingefügt wird 1, 2, // Spaltennr., Zeilennr. 4, 2, // Spaltenbreite (gridwidth), Zeilenbreite (gridheigth) 0.0, 0.0, @@ -116,7 +123,7 @@ public class StatusPanelAdder{ GridBagConstraints.NONE, new Insets (0,0,0,0), // Abstand zu den anderen Objekten 0,0)); - GameInterface.getStatusPanel().add(scoreLabel, new GridBagConstraints( // formPanel ist das Panel, indas eingefügt wird + panel.add(scoreLabel, new GridBagConstraints( // formPanel ist das Panel, indas eingefügt wird 2, 2, // Spaltennr., Zeilennr. 4, 2, // Spaltenbreite (gridwidth), Zeilenbreite (gridheigth) 0.0, 0.0, @@ -126,7 +133,7 @@ public class StatusPanelAdder{ 0,0)); - GameInterface.getStatusPanel().add(labelPowerUp, new GridBagConstraints( // formPanel ist das Panel, indas eingefügt wird + panel.add(labelPowerUp, new GridBagConstraints( // formPanel ist das Panel, indas eingefügt wird 4, 1, // Spaltennr., Zeilennr. 4, 2, // Spaltenbreite (gridwidth), Zeilenbreite (gridheigth) 0.0, 0.0, @@ -136,7 +143,7 @@ public class StatusPanelAdder{ 0,0)); - GameInterface.getStatusPanel().add(powerUpLabel, new GridBagConstraints( // formPanel ist das Panel, indas eingefügt wird + panel.add(powerUpLabel, new GridBagConstraints( // formPanel ist das Panel, indas eingefügt wird 4, 2, // Spaltennr., Zeilennr. 4, 2, // Spaltenbreite (gridwidth), Zeilenbreite (gridheigth) 0.0, 0.0, @@ -146,9 +153,5 @@ public class StatusPanelAdder{ 0,0)); } - - private static void getStatusPanel(){ - GameInterface.getStatusPanel(); - } }