+
+ if (cached) {
+ UIUtils.drawEllipse3D(g, Color.green.darker(), COVER_WIDTH
+ + HOFFSET + 30, 10, 20, 20);
+ }
+ }
+
+ /**
+ * Generate a cover icon based upon the given cover image (which may be
+ * NULL).
+ *
+ * @param image
+ * the cover image, or NULL for none
+ *
+ * @return the icon
+ */
+ private ImageIcon generateCoverIcon(BufferedImage image) {
+ BufferedImage resizedImage = new BufferedImage(SPINE_WIDTH
+ + COVER_WIDTH, SPINE_HEIGHT + COVER_HEIGHT + HOFFSET,
+ BufferedImage.TYPE_4BYTE_ABGR);
+ Graphics2D g = resizedImage.createGraphics();
+ g.setColor(Color.white);
+ g.fillRect(0, HOFFSET, COVER_WIDTH, COVER_HEIGHT);
+ if (image != null) {
+ g.drawImage(image, 0, HOFFSET, COVER_WIDTH, COVER_HEIGHT, null);
+ } else {
+ g.setColor(Color.black);
+ g.drawLine(0, HOFFSET, COVER_WIDTH, HOFFSET + COVER_HEIGHT);
+ g.drawLine(COVER_WIDTH, HOFFSET, 0, HOFFSET + COVER_HEIGHT);
+ }
+ g.dispose();
+
+ return new ImageIcon(resizedImage);