|
|
@@ -32,6 +32,7 @@ public class Topbar implements MouseListener {
|
|
|
this.simulator = simulator;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
public void draw(Graphics2D g2, int screenwidth){
|
|
|
screenwidth += 100;
|
|
|
if(oldwidth != screenwidth){
|
|
|
@@ -61,7 +62,7 @@ public class Topbar implements MouseListener {
|
|
|
g2.drawImage(Images.getImage(Images.ImageType.TopbarFasterButton), screenwidth/4 + 130, 7, null );
|
|
|
|
|
|
g2.setFont(new Font("Sans-serif", Font.BOLD, 22));
|
|
|
- g2.drawString(time.get(Calendar.HOUR_OF_DAY) + ":" + time.get(Calendar.MINUTE), screenwidth/2-10 , 28);
|
|
|
+ g2.drawString(time.get(Calendar.HOUR_OF_DAY) + ":" + getMins(), screenwidth/2-10 , 28);
|
|
|
|
|
|
g2.drawImage(Images.getImage(Images.ImageType.TopbarGridButton), screenwidth/4*3 -60, 7, null );
|
|
|
|
|
|
@@ -75,6 +76,16 @@ public class Topbar implements MouseListener {
|
|
|
public Rectangle[] getButtons(){
|
|
|
return buttons;
|
|
|
}
|
|
|
+
|
|
|
+ public String getMins(){
|
|
|
+ String minutesString = ""+time.get(Calendar.MINUTE);
|
|
|
+
|
|
|
+ if(Integer.parseInt(minutesString) < 10){
|
|
|
+ minutesString = "0" + time.get(Calendar.MINUTE);
|
|
|
+ }
|
|
|
+ return minutesString;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public void mouseClicked(MouseEvent e) {
|
|
|
@@ -130,4 +141,4 @@ public class Topbar implements MouseListener {
|
|
|
public void recalculate(){
|
|
|
time.setTimeInMillis(time.getTimeInMillis()+10000);
|
|
|
}
|
|
|
-}
|
|
|
+}
|