X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix_swing%2Fgui%2FDetailsPanel.java;h=e3185a6a81c3dc39796bde9ad22f638820327e51;hb=32ed608959c0dec74660388248831976b97e8c56;hp=ced9c3b939f50d59e038bad8321faa17f001d23c;hpb=abf564fe64ada9b63f0b25397d54da875c39c920;p=nikiroo-utils.git diff --git a/src/be/nikiroo/fanfix_swing/gui/DetailsPanel.java b/src/be/nikiroo/fanfix_swing/gui/DetailsPanel.java index ced9c3b..e3185a6 100644 --- a/src/be/nikiroo/fanfix_swing/gui/DetailsPanel.java +++ b/src/be/nikiroo/fanfix_swing/gui/DetailsPanel.java @@ -60,8 +60,10 @@ public class DetailsPanel extends JPanel { /** * Configure a {@link JLabel} with the given colour. * - * @param label the label to configure - * @param color the colour to use + * @param label + * the label to configure + * @param color + * the colour to use * * @return the (same) configured label */ @@ -76,7 +78,8 @@ public class DetailsPanel extends JPanel { /** * Set the {@link BookInfo} you want to see displayed here. * - * @param info the {@link BookInfo} to display + * @param info + * the {@link BookInfo} to display */ public void setBook(final BookInfo info) { this.info = info; @@ -85,11 +88,16 @@ public class DetailsPanel extends JPanel { if (info == null) { name.setText(null); opt.setText(null); + } else if (info.getMainInfo() == null) { + name.setText( + "All the " + info.getType().toString().toLowerCase() + "s"); + opt.setText(info.getSecondaryInfo(true)); } else { final String myId = info.getId(); name.setText(info.getMainInfo()); opt.setText(info.getSecondaryInfo(true)); + new SwingWorker() { @Override protected Image doInBackground() throws Exception { @@ -97,7 +105,8 @@ public class DetailsPanel extends JPanel { BookInfo current = DetailsPanel.this.info; if (current != null && current.getId().equals(myId)) { - return BookBlock.generateCoverImage(Instance.getInstance().getLibrary(), info); + return BookBlock.generateCoverImage( + Instance.getInstance().getLibrary(), info); } return null;