From: Niki Roo Date: Sun, 19 Apr 2020 18:36:13 +0000 (+0200) Subject: java 1.6 compat X-Git-Tag: fanfix-swing-0.0.1~9 X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=4792a9a10cb0008838119456720f349d4167ecde;p=fanfix-swing.git java 1.6 compat --- diff --git a/src/be/nikiroo/fanfix_swing/gui/BooksPanel.java b/src/be/nikiroo/fanfix_swing/gui/BooksPanel.java index 8c22de1e..47d6a6ee 100644 --- a/src/be/nikiroo/fanfix_swing/gui/BooksPanel.java +++ b/src/be/nikiroo/fanfix_swing/gui/BooksPanel.java @@ -220,21 +220,22 @@ public class BooksPanel extends ListenerPanel { }; } - private ListCellRenderer generateRenderer() { - return new ListCellRenderer() { + @SuppressWarnings("rawtypes") // ListCellRenderer is not java 1.6 + private ListCellRenderer generateRenderer() { + return new ListCellRenderer() { @Override - public Component getListCellRendererComponent( - JList list, BookInfo value, int index, - boolean isSelected, boolean cellHasFocus) { + public Component getListCellRendererComponent(JList list, + Object value, int index, boolean isSelected, + boolean cellHasFocus) { BookLine book = books.get(value); if (book == null) { if (listMode) { - book = new BookLine(value, seeWordCount); + book = new BookLine((BookInfo) value, seeWordCount); } else { - book = new BookBlock(value, seeWordCount); + book = new BookBlock((BookInfo) value, seeWordCount); startUpdateBookCover((BookBlock) book); } - books.put(value, book); + books.put((BookInfo) value, book); } book.setSelected(isSelected);