From 4792a9a10cb0008838119456720f349d4167ecde Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Sun, 19 Apr 2020 20:36:13 +0200 Subject: [PATCH] java 1.6 compat --- src/be/nikiroo/fanfix_swing/gui/BooksPanel.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) 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); -- 2.27.0