|
|
@@ -9,14 +9,16 @@ import java.awt.Rectangle;
|
|
|
import java.awt.event.MouseEvent;
|
|
|
import java.awt.event.MouseListener;
|
|
|
import java.awt.geom.GeneralPath;
|
|
|
+import java.io.Serializable;
|
|
|
import java.util.Calendar;
|
|
|
import java.util.GregorianCalendar;
|
|
|
|
|
|
import javax.swing.JDialog;
|
|
|
|
|
|
import agenda.Agenda;
|
|
|
+import gui.simulator.facilities.ImageType;
|
|
|
|
|
|
-public class Topbar implements MouseListener {
|
|
|
+public class Topbar implements MouseListener, Serializable {
|
|
|
private int oldwidth;
|
|
|
private GeneralPath background;
|
|
|
private GregorianCalendar time;
|
|
|
@@ -62,13 +64,13 @@ public class Topbar implements MouseListener {
|
|
|
g2.draw(background);
|
|
|
|
|
|
|
|
|
- g2.drawImage(Images.getImage(Images.ImageType.TopbarStopButton), screenwidth/4 + 40, 7, null );
|
|
|
- g2.drawImage(Images.getImage((!buttonsState[1]) ? Images.ImageType.TopbarPlayButton : Images.ImageType.TopbarPauzeButton), screenwidth/4 + 90, 7, null );
|
|
|
- g2.drawImage(Images.getImage(Images.ImageType.TopbarFasterButton), screenwidth/4 + 130, 7, null );
|
|
|
+ g2.drawImage(Images.getImage(ImageType.TopbarStopButton), screenwidth/4 + 40, 7, null );
|
|
|
+ g2.drawImage(Images.getImage((!buttonsState[1]) ? ImageType.TopbarPlayButton : ImageType.TopbarPauzeButton), screenwidth/4 + 90, 7, null );
|
|
|
+ g2.drawImage(Images.getImage(ImageType.TopbarFasterButton), screenwidth/4 + 130, 7, null );
|
|
|
g2.setFont(new Font("Sans-serif", Font.BOLD, 22));
|
|
|
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 );
|
|
|
- g2.drawImage(Images.getImage(Images.ImageType.TopbarPeopleButton), screenwidth/4*3 -150, 7, null );
|
|
|
+ g2.drawImage(Images.getImage(ImageType.TopbarGridButton), screenwidth/4*3 -60, 7, null );
|
|
|
+ g2.drawImage(Images.getImage(ImageType.TopbarPeopleButton), screenwidth/4*3 -150, 7, null );
|
|
|
g2.setFont(new Font("Sans-serif", Font.PLAIN, 18));
|
|
|
g2.drawString(terrain.getMaxVisitors() + "", screenwidth/4*3 - 120, 27);
|
|
|
}
|
|
|
@@ -132,6 +134,7 @@ public class Topbar implements MouseListener {
|
|
|
return true;
|
|
|
return false;
|
|
|
}
|
|
|
+
|
|
|
private int clickedButton(Point point){
|
|
|
for(int i = 0; i < getButtons().length; i++){
|
|
|
if(getButtons()[i].contains(point)){
|