Remove some spurious comments

This commit is contained in:
Nathan McRae 2025-01-12 22:32:34 -08:00
parent 3b725e3f29
commit b1d1acad2f

View File

@ -1,5 +1,6 @@
package name.nathanmcrae.numbersstation;
import java.util.Optional;
import javafx.collections.ListChangeListener;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
@ -11,7 +12,6 @@ import javafx.event.ActionEvent;
import javafx.event.Event;
import javafx.scene.Node;
import javafx.stage.Stage;
import java.util.Optional;
public class StationSelectionController {
@ -23,9 +23,7 @@ public class StationSelectionController {
private ObservableList<StationSettings> stationList;
public StationSelectionController() {
// Initialize the list with an empty list
stationList = FXCollections.observableArrayList();
// Add listener to the stationList
stationList.addListener((ListChangeListener<StationSettings>) change -> onStationListChanged(change));
}
@ -53,16 +51,13 @@ public class StationSelectionController {
@FXML
private void handleAddButtonPress(ActionEvent event) {
// Create a TextInputDialog
TextInputDialog dialog = new TextInputDialog();
dialog.setTitle("New Station");
dialog.setHeaderText("Add a New Station");
dialog.setContentText("Please enter the station name:");
// Show the dialog and capture the result
Optional<String> result = dialog.showAndWait();
result.ifPresent(stationName -> {
// Add the new station to the list
StationSettings newStation = new StationSettings(stationName);
stationList.add(newStation);
});
@ -70,7 +65,6 @@ public class StationSelectionController {
@FXML
private void handleRemoveButtonPress(ActionEvent event) {
// Remove the selected item from the list
int selectedIndex = stationListView.getSelectionModel().getSelectedIndex();
if (selectedIndex >= 0) {
stationList.remove(selectedIndex);