Version 1.2.0: better UI, some fixes
[fanfix.git] / src / be / nikiroo / fanfix / reader / LocalReaderBook.java
index a9b24a2019f7c2902c40c97be63ca672430e7c46..c716bd3aa47d75f3d3171aaf3d07f261c154bbad 100644 (file)
@@ -68,8 +68,13 @@ class LocalReaderBook extends JPanel {
        private Date lastClick;
        private long doubleClickDelay = 200; // in ms
        private List<BookActionListener> listeners;
+       private String luid;
+       private boolean cached;
+
+       public LocalReaderBook(MetaData meta, boolean cached) {
+               this.luid = meta.getLuid();
+               this.cached = cached;
 
-       public LocalReaderBook(MetaData meta) {
                if (meta.getCover() != null) {
                        BufferedImage resizedImage = new BufferedImage(SPINE_WIDTH
                                        + COVER_WIDTH, SPINE_HEIGHT + COVER_HEIGHT + HOFFSET,
@@ -179,6 +184,29 @@ class LocalReaderBook extends JPanel {
                listeners.add(listener);
        }
 
+       public String getLuid() {
+               return luid;
+       }
+
+       /**
+        * This boos is cached into the {@link LocalReader} library.
+        * 
+        * @return the cached
+        */
+       public boolean isCached() {
+               return cached;
+       }
+
+       /**
+        * This boos is cached into the {@link LocalReader} library.
+        * 
+        * @param cached
+        *            the cached to set
+        */
+       public void setCached(boolean cached) {
+               this.cached = cached;
+       }
+
        @Override
        public void paint(Graphics g) {
                super.paint(g);
@@ -211,6 +239,11 @@ class LocalReaderBook extends JPanel {
                }
 
                Rectangle clip = g.getClipBounds();
+               if (cached) {
+                       g.setColor(Color.green);
+                       g.fillOval(clip.x + clip.width - 30, 10, 20, 20);
+               }
+               
                g.setColor(color);
                g.fillRect(clip.x, clip.y, clip.width, clip.height);
        }