Fix a casting issue

This commit is contained in:
Kai S. K. Engelbart 2020-07-31 22:52:42 +02:00
parent 268e4439d7
commit b678ae295b

View File

@ -15,6 +15,7 @@ import java.util.logging.Logger;
import javafx.animation.RotateTransition; import javafx.animation.RotateTransition;
import javafx.application.Platform; import javafx.application.Platform;
import javafx.collections.FXCollections; import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.collections.transformation.FilteredList; import javafx.collections.transformation.FilteredList;
import javafx.fxml.FXML; import javafx.fxml.FXML;
import javafx.scene.Node; import javafx.scene.Node;
@ -133,7 +134,7 @@ public final class ChatScene implements Restorable {
private static final int MAX_MESSAGE_LENGTH = 255; private static final int MAX_MESSAGE_LENGTH = 255;
private static final int DEFAULT_ICON_SIZE = 16; private static final int DEFAULT_ICON_SIZE = 16;
private FilteredList<? extends Chat> chats; private FilteredList<Chat> chats;
/** /**
* Initializes the appearance of certain visual components. * Initializes the appearance of certain visual components.
@ -552,7 +553,7 @@ public final class ChatScene implements Restorable {
// Moving currentChat to the top // Moving currentChat to the top
Platform.runLater(() -> { Platform.runLater(() -> {
chats.getSource().remove(currentChat); chats.getSource().remove(currentChat);
chats.getSource().add(0, currentChat); ((ObservableList<Chat>) chats.getSource()).add(0, currentChat);
chatList.getSelectionModel().select(0); chatList.getSelectionModel().select(0);
localDB.getChats().remove(currentChat); localDB.getChats().remove(currentChat);
localDB.getChats().add(0, currentChat); localDB.getChats().add(0, currentChat);