mirror of
https://github.com/jokerx3/HeatUp
synced 2026-07-27 08:49:44 +02:00
StatusPanelAdder ausgerichtet
This commit is contained in:
@@ -4,17 +4,11 @@ import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.Font;
|
||||
import java.awt.GridBagConstraints;
|
||||
import java.awt.GridLayout;
|
||||
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;
|
||||
@@ -25,7 +19,9 @@ public class StatusPanelAdder{
|
||||
private Score score;
|
||||
private Timer timer;
|
||||
private static JPanel panel;
|
||||
|
||||
private static int hgap=75;
|
||||
private static int vgap=7;
|
||||
|
||||
public int getTemp(){
|
||||
return temp.getTemp();
|
||||
}
|
||||
@@ -37,11 +33,13 @@ public class StatusPanelAdder{
|
||||
}
|
||||
|
||||
public static void setPanel(JPanel newPanel){
|
||||
newPanel.setLayout(new FlowLayout());
|
||||
newPanel.setLayout(new FlowLayout(FlowLayout.CENTER, hgap,5));
|
||||
panel=newPanel;
|
||||
}
|
||||
|
||||
public static void createPanel(){
|
||||
|
||||
|
||||
JLabel labelTemp= new JLabel("temperature");
|
||||
labelTemp.setFont(new Font("Arial", Font.CENTER_BASELINE, 16));
|
||||
labelTemp.setBorder(new LineBorder(Color.BLACK, 1));
|
||||
@@ -50,7 +48,7 @@ public class StatusPanelAdder{
|
||||
tempBar.setValue(45);
|
||||
|
||||
JPanel tempPanel=new JPanel();
|
||||
tempPanel.setLayout(new BorderLayout());
|
||||
tempPanel.setLayout(new BorderLayout(0,vgap));
|
||||
tempPanel.add(labelTemp, BorderLayout.NORTH);
|
||||
tempPanel.add(tempBar, BorderLayout.SOUTH);
|
||||
|
||||
@@ -64,7 +62,7 @@ public class StatusPanelAdder{
|
||||
//scoreLabel.setBorder(new LineBorder(Color.BLACK, 1));
|
||||
|
||||
JPanel scorePanel=new JPanel();
|
||||
scorePanel.setLayout(new BorderLayout());
|
||||
scorePanel.setLayout(new BorderLayout(0,vgap));
|
||||
scorePanel.add(labelScore, BorderLayout.NORTH);
|
||||
scorePanel.add(scoreLabel, BorderLayout.SOUTH);
|
||||
|
||||
@@ -76,7 +74,7 @@ public class StatusPanelAdder{
|
||||
JLabel powerUpLabel = new JLabel(/*new ImageIcon("path_to_image.png")*/"powerUpLabel");
|
||||
//powerUpLabel.setBorder(new LineBorder(Color.BLACK, 1));
|
||||
JPanel powerUpPanel=new JPanel();
|
||||
powerUpPanel.setLayout(new BorderLayout());
|
||||
powerUpPanel.setLayout(new BorderLayout(0,vgap));
|
||||
powerUpPanel.add(labelPowerUp, BorderLayout.NORTH);
|
||||
powerUpPanel.add(powerUpLabel, BorderLayout.SOUTH);
|
||||
|
||||
@@ -93,7 +91,7 @@ public class StatusPanelAdder{
|
||||
timeLabel.setFont(new Font("Arial", Font.ITALIC, 12));
|
||||
|
||||
JPanel timePanel=new JPanel();
|
||||
timePanel.setLayout(new BorderLayout());
|
||||
timePanel.setLayout(new BorderLayout(0,vgap));
|
||||
timePanel.add(labelTime, BorderLayout.NORTH);
|
||||
timePanel.add(timeLabel, BorderLayout.SOUTH);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user