Skip to content

Commit

Permalink
Update GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexCSilva committed Oct 29, 2018
1 parent 5271b48 commit 90f4cba
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
18 changes: 13 additions & 5 deletions www-weather/src/GUI/Panels/StationMaintenance.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public StationMaintenance() {
Dimension size = GUI.Window.getSize();
setPreferredSize(size);

JLabel panelTitle = new JLabel("<html><div style='text-align: center;'>Station Maintenance</div></html>");
panelTitle.setBounds(0, 25, size.width, 50);
JLabel panelTitle = new JLabel("<html><div style='text-align: center;'><h1>Station Maintenance</h1></div></html>");
panelTitle.setBounds(25, 25, size.width, 50);
System.out.printf("Title width: %s", panelTitle.getWidth());
add(panelTitle);

Expand All @@ -36,8 +36,8 @@ public StationMaintenance() {
add(backButton);

JButton notificationButton = new JButton("");
notificationButton.setBounds(size.width - 50, 35, 50, 25);
notificationButton.setLocation(12, 90);
notificationButton.setBounds(size.width - 125, 60, 50, 25);
//notificationButton.setLocation(12, 90);
try {
Image img = ImageIO.read(getClass().getResource("img/no_notifications.png"));
notificationButton.setIcon(new ImageIcon(img));
Expand Down Expand Up @@ -65,6 +65,14 @@ public StationMaintenance() {
try{
database.databaseInterface.setMaintenanceScheduleCompleted(schedule,true);
menu.remove(item);
if (menu.getComponentCount() == 0) {
try {
Image img = ImageIO.read(getClass().getResource("img/no_notifications.png"));
notificationButton.setIcon(new ImageIcon(img));
} catch (Exception ex) {
ex.printStackTrace();
}
}
}catch (Exception ex){
ex.printStackTrace();
}
Expand Down Expand Up @@ -103,7 +111,7 @@ public void actionPerformed(ActionEvent e) {
stationListPanel.setBackground(Color.cyan);
JScrollPane scrollPanel = new JScrollPane(stationListPanel);
stationListPanel.setAutoscrolls(true);
scrollPanel.setBounds(100, 150, 400, 300);
scrollPanel.setBounds(25, 110, size.width-50, size.height-(150+25));
add(scrollPanel);

populateStationListPanel();
Expand Down
4 changes: 4 additions & 0 deletions www-weather/src/GUI/Panels/StationSelectorMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ public StationSelectorMap(){
backButton.setBounds(size.width - 125, 25, 100, 25);
add(backButton);

JLabel titleLabel = new JLabel("Map view");
titleLabel.setBounds(25, 25, 100, 25);
add(titleLabel);

//Map panel

map.setBounds(50,55,size.width-100,size.height-120);
Expand Down

0 comments on commit 90f4cba

Please sign in to comment.