Temperaturzahl hinzugefügt

This commit is contained in:
feschi55
2014-11-22 17:15:21 +01:00
parent 396feb0b23
commit cbbcf098a3
+19 -12
View File
@@ -2,12 +2,15 @@ package de.heatup.ui;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Component;
import java.awt.FlowLayout; import java.awt.FlowLayout;
import java.awt.Font; import java.awt.Font;
import java.io.File; import java.io.File;
import javax.swing.JLabel; import javax.swing.JLabel;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JProgressBar; import javax.swing.JProgressBar;
import de.heatup.logging.Logger; import de.heatup.logging.Logger;
import de.heatup.ui.statusPanel.Score; import de.heatup.ui.statusPanel.Score;
import de.heatup.ui.statusPanel.Timer; import de.heatup.ui.statusPanel.Timer;
@@ -24,7 +27,8 @@ public class StatusPanelAdder{
private static double tempMinus=0.0; private static double tempMinus=0.0;
private static int temping=0; private static int temping=0;
private static double barSpeed=0.01; private static double barSpeed=0.01;
private static boolean ende=false;
private static JLabel labelTempC= new JLabel("§");
private static JLabel labelTemp= new JLabel("temperature"); private static JLabel labelTemp= new JLabel("temperature");
private static JProgressBar tempBar; private static JProgressBar tempBar;
private static JLabel labelScore= new JLabel("score"); private static JLabel labelScore= new JLabel("score");
@@ -51,11 +55,6 @@ public class StatusPanelAdder{
Logger.write("Font implemented"); Logger.write("Font implemented");
return ttfBase; return ttfBase;
} }
public static void raiseMod(){ public static void raiseMod(){
if (modifier==-1){ if (modifier==-1){
modifier=1; modifier=1;
@@ -87,6 +86,7 @@ public class StatusPanelAdder{
public static void tick() { public static void tick() {
labelTempC.setText(tempBar.getValue() + "°C");
temping=0; temping=0;
if (modifier<0){ if (modifier<0){
barSpeed=0.01; barSpeed=0.01;
@@ -111,7 +111,10 @@ public class StatusPanelAdder{
} else { } else {
tempBar.setValue(tempBar.getValue()+temping); tempBar.setValue(tempBar.getValue()+temping);
} }
if (tempBar.getValue()==110)Logger.write("EEENNNDDEEEE"); if (tempBar.getValue()==110&&(ende=false)){
Logger.write("EEENNNDDEEEE");
ende = true;
}
} }
@@ -124,17 +127,21 @@ public class StatusPanelAdder{
implementFont(); implementFont();
emulogicheading = ttfBase.deriveFont(Font.PLAIN, 16); emulogicheading = ttfBase.deriveFont(Font.PLAIN, 16);
emulogictext= ttfBase.deriveFont(Font.PLAIN, 12); emulogictext= ttfBase.deriveFont(Font.PLAIN, 12);
JPanel tempPanel=new JPanel(); JPanel tempPanel=new JPanel();
labelTemp.setFont(emulogicheading); labelTemp.setFont(emulogicheading);
labelTemp.setForeground(Color.YELLOW); labelTemp.setForeground(Color.YELLOW);
tempBar= new JProgressBar(30,110); tempBar= new JProgressBar(0,110);
tempBar.setValue(45); tempBar.setValue(30);
tempPanel.setLayout(new BorderLayout(0,vgap)); labelTempC.setFont(emulogictext);
labelTempC.setAlignmentX(Component.CENTER_ALIGNMENT);
labelTempC.setForeground(Color.YELLOW);
tempPanel.setLayout(new BorderLayout(0,vgap/2));
tempPanel.add(labelTemp, BorderLayout.NORTH); tempPanel.add(labelTemp, BorderLayout.NORTH);
tempPanel.add(tempBar, BorderLayout.SOUTH); tempPanel.add(tempBar, BorderLayout.CENTER);
tempPanel.add(labelTempC, BorderLayout.SOUTH);
tempPanel.setBackground(Color.BLACK); tempPanel.setBackground(Color.BLACK);
JPanel scorePanel=new JPanel(); JPanel scorePanel=new JPanel();
labelScore.setFont(emulogicheading); labelScore.setFont(emulogicheading);
labelScore.setForeground(Color.YELLOW); labelScore.setForeground(Color.YELLOW);