Removed minutes label from timestamp

Tags: #story[820]
This commit is contained in:
Michael Rausch
2017-05-03 22:16:03 +12:00
parent d992422efd
commit 7a5f4e8f8c
@@ -3,7 +3,6 @@ package seng302.controllers;
import javafx.application.Platform; import javafx.application.Platform;
import javafx.collections.FXCollections; import javafx.collections.FXCollections;
import javafx.collections.ObservableList; import javafx.collections.ObservableList;
import javafx.concurrent.Task;
import javafx.fxml.FXML; import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader; import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable; import javafx.fxml.Initializable;
@@ -19,16 +18,12 @@ import seng302.models.parsers.StreamParser;
import seng302.models.parsers.XMLParser; import seng302.models.parsers.XMLParser;
import javax.xml.crypto.dsig.XMLObject;
import java.io.IOException; import java.io.IOException;
import java.net.URL; import java.net.URL;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
/**
* Created by michaelrausch on 21/03/17.
*/
public class Controller implements Initializable { public class Controller implements Initializable {
@FXML @FXML
private AnchorPane contentPane; private AnchorPane contentPane;
@@ -39,13 +34,13 @@ public class Controller implements Initializable {
@FXML @FXML
private Button switchToRaceViewButton; private Button switchToRaceViewButton;
@FXML @FXML
private TableView teamList; private TableView<XMLParser.BoatXMLObject.Boat> teamList;
@FXML @FXML
private TableColumn boatNameCol; private TableColumn<XMLParser.BoatXMLObject.Boat, String> boatNameCol;
@FXML @FXML
private TableColumn shortNameCol; private TableColumn<XMLParser.BoatXMLObject.Boat, String> shortNameCol;
@FXML @FXML
private TableColumn countryCol; private TableColumn<XMLParser.BoatXMLObject.Boat, String> countryCol;
@FXML @FXML
private Label realTime; private Label realTime;
@@ -101,7 +96,7 @@ public class Controller implements Initializable {
if (timerSecond.length() == 1) { if (timerSecond.length() == 1) {
timerSecond = "0" + timerSecond; timerSecond = "0" + timerSecond;
} }
String timerString = "-" + timerMinute + ":" + timerSecond + " minutes"; String timerString = "-" + timerMinute + ":" + timerSecond;
timeTillLive.setText(timerString); timeTillLive.setText(timerString);
} else { } else {
realTime.setText(StreamParser.getCurrentTimeString()); realTime.setText(StreamParser.getCurrentTimeString());
@@ -113,7 +108,7 @@ public class Controller implements Initializable {
if (timerSecond.length() == 1) { if (timerSecond.length() == 1) {
timerSecond = "0" + timerSecond; timerSecond = "0" + timerSecond;
} }
String timerString = timerMinute + ":" + timerSecond + " minutes"; String timerString = timerMinute + ":" + timerSecond;
timeTillLive.setText(timerString); timeTillLive.setText(timerString);
} }
}); });
@@ -133,13 +128,13 @@ public class Controller implements Initializable {
ObservableList<XMLParser.BoatXMLObject.Boat> data = FXCollections.observableArrayList(); ObservableList<XMLParser.BoatXMLObject.Boat> data = FXCollections.observableArrayList();
teamList.setItems(data); teamList.setItems(data);
boatNameCol.setCellValueFactory( boatNameCol.setCellValueFactory(
new PropertyValueFactory<XMLParser.BoatXMLObject.Boat,String>("BoatName") new PropertyValueFactory<>("BoatName")
); );
shortNameCol.setCellValueFactory( shortNameCol.setCellValueFactory(
new PropertyValueFactory<XMLParser.BoatXMLObject.Boat,String>("ShortName") new PropertyValueFactory<>("ShortName")
); );
countryCol.setCellValueFactory( countryCol.setCellValueFactory(
new PropertyValueFactory<XMLParser.BoatXMLObject.Boat,String>("Country") new PropertyValueFactory<>("Country")
); );
for (XMLParser.BoatXMLObject.Boat boat : StreamParser.getBoats()) { for (XMLParser.BoatXMLObject.Boat boat : StreamParser.getBoats()) {
data.add(boat); data.add(boat);