reformat
[fanfix.git] / src / be / nikiroo / fanfix_swing / gui / book / BookBlock.java
index 8c83144f54dc6451e55de3fb1dca4bec99198c80..595f42ba7051d65ac80df1d906d20ad2d96bc064 100644 (file)
@@ -21,7 +21,8 @@ import be.nikiroo.fanfix_swing.gui.BooksPanel;
  */
 public class BookBlock extends BookLine {
        static private final long serialVersionUID = 1L;
-       static private Image empty = BookCoverImager.generateCoverImage(null, (BookInfo) null);
+       static private Image empty = BookCoverImager.generateCoverImage(null,
+                       (BookInfo) null);
 
        private JLabel title;
        private Image coverImage;
@@ -29,8 +30,10 @@ public class BookBlock extends BookLine {
        /**
         * Create a new {@link BookBlock} item for the given {@link Story}.
         * 
-        * @param info         the information about the story to represent
-        * @param seeWordCount TRUE to see word counts, FALSE to see authors
+        * @param info
+        *            the information about the story to represent
+        * @param seeWordCount
+        *            TRUE to see word counts, FALSE to see authors
         */
        public BookBlock(BookInfo info, boolean seeWordCount) {
                super(info, seeWordCount);
@@ -43,7 +46,8 @@ public class BookBlock extends BookLine {
                updateMeta();
 
                JPanel filler = new JPanel();
-               filler.setPreferredSize(new Dimension(BookCoverImager.getCoverWidth(), BookCoverImager.getCoverHeight()));
+               filler.setPreferredSize(new Dimension(BookCoverImager.getCoverWidth(),
+                               BookCoverImager.getCoverHeight()));
                filler.setOpaque(false);
 
                setLayout(new BorderLayout(10, 10));
@@ -55,7 +59,8 @@ public class BookBlock extends BookLine {
         * the cover image to use a base (see
         * {@link BookCoverImager#generateCoverImage(BasicLibrary, BookInfo)})
         * 
-        * @param coverImage the image
+        * @param coverImage
+        *            the image
         */
        public void setCoverImage(Image coverImage) {
                this.coverImage = coverImage;
@@ -64,32 +69,41 @@ public class BookBlock extends BookLine {
        @Override
        public void paint(Graphics g) {
                super.paint(g);
-               g.drawImage(coverImage, BookCoverImager.TEXT_WIDTH - BookCoverImager.COVER_WIDTH, 0, null);
-               BookCoverImager.paintOverlay(g, isEnabled(), isSelected(), isHovered(), getInfo().isCached());
+               g.drawImage(coverImage,
+                               BookCoverImager.TEXT_WIDTH - BookCoverImager.COVER_WIDTH, 0,
+                               null);
+               BookCoverImager.paintOverlay(g, isEnabled(), isSelected(), isHovered(),
+                               getInfo().isCached());
        }
 
        @Override
        protected void updateMeta() {
                String main = getInfo().getMainInfo();
                String optSecondary = getInfo().getSecondaryInfo(isSeeWordCount());
-               String color = String.format("#%X%X%X", AUTHOR_COLOR.getRed(), AUTHOR_COLOR.getGreen(), AUTHOR_COLOR.getBlue());
-               title.setText(String.format(
-                               "<html>" + "<body style='width: %d px; height: %d px; text-align: center;'>" + "%s" + "<br>"
-                                               + "<span style='color: %s;'>" + "%s" + "</span>" + "</body>" + "</html>",
-                               BookCoverImager.TEXT_WIDTH, BookCoverImager.TEXT_HEIGHT, main, color, optSecondary));
+               String color = String.format("#%X%X%X", AUTHOR_COLOR.getRed(),
+                               AUTHOR_COLOR.getGreen(), AUTHOR_COLOR.getBlue());
+               title.setText(String.format("<html>"
+                               + "<body style='width: %d px; height: %d px; text-align: center;'>"
+                               + "%s" + "<br>" + "<span style='color: %s;'>" + "%s" + "</span>"
+                               + "</body>" + "</html>", BookCoverImager.TEXT_WIDTH,
+                               BookCoverImager.TEXT_HEIGHT, main, color, optSecondary));
 
-               setBackground(BookCoverImager.getBackground(isEnabled(), isSelected(), isHovered()));
+               setBackground(BookCoverImager.getBackground(isEnabled(), isSelected(),
+                               isHovered()));
        }
 
        /**
         * Generate a cover icon based upon the given {@link BookInfo}.
         * 
-        * @param lib  the library the meta comes from
-        * @param info the {@link BookInfo}
+        * @param lib
+        *            the library the meta comes from
+        * @param info
+        *            the {@link BookInfo}
         * 
         * @return the image
         */
-       static public java.awt.Image generateCoverImage(BasicLibrary lib, BookInfo info) {
+       static public java.awt.Image generateCoverImage(BasicLibrary lib,
+                       BookInfo info) {
                return BookCoverImager.generateCoverImage(lib, info);
        }
 }