git://git.nikiroo.be
/
nikiroo-utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update to latest version of nikiroo-utils
[nikiroo-utils.git]
/
src
/
be
/
nikiroo
/
fanfix
/
reader
/
GuiReaderBook.java
diff --git
a/src/be/nikiroo/fanfix/reader/GuiReaderBook.java
b/src/be/nikiroo/fanfix/reader/GuiReaderBook.java
index e6fe91b4d84ed95def7fe13ba48b52850ceb9686..1334518a49feba8367df5f829ae2e48576a2458a 100644
(file)
--- a/
src/be/nikiroo/fanfix/reader/GuiReaderBook.java
+++ b/
src/be/nikiroo/fanfix/reader/GuiReaderBook.java
@@
-27,7
+27,7
@@
import javax.swing.JPanel;
import be.nikiroo.fanfix.Instance;
import be.nikiroo.fanfix.data.MetaData;
import be.nikiroo.fanfix.data.Story;
import be.nikiroo.fanfix.Instance;
import be.nikiroo.fanfix.data.MetaData;
import be.nikiroo.fanfix.data.Story;
-import be.nikiroo.utils.I
O
Utils;
+import be.nikiroo.utils.I
mage
Utils;
import be.nikiroo.utils.ui.UIUtils;
/**
import be.nikiroo.utils.ui.UIUtils;
/**
@@
-93,12
+93,15
@@
class GuiReaderBook extends JPanel {
private Date lastClick;
private List<BookActionListener> listeners;
private Date lastClick;
private List<BookActionListener> listeners;
+ private Reader reader;
private MetaData meta;
private boolean cached;
/**
* Create a new {@link GuiReaderBook} item for the given {@link Story}.
*
private MetaData meta;
private boolean cached;
/**
* Create a new {@link GuiReaderBook} item for the given {@link Story}.
*
+ * @param reader
+ * the associated reader
* @param meta
* the story {@link MetaData}
* @param cached
* @param meta
* the story {@link MetaData}
* @param cached
@@
-106,7
+109,9
@@
class GuiReaderBook extends JPanel {
* @param seeWordCount
* TRUE to see word counts, FALSE to see authors
*/
* @param seeWordCount
* TRUE to see word counts, FALSE to see authors
*/
- public GuiReaderBook(MetaData meta, boolean cached, boolean seeWordCount) {
+ public GuiReaderBook(Reader reader, MetaData meta, boolean cached,
+ boolean seeWordCount) {
+ this.reader = reader;
this.cached = cached;
this.meta = meta;
this.cached = cached;
this.meta = meta;
@@
-365,7
+370,7
@@
class GuiReaderBook extends JPanel {
InputStream in = Instance.getCache().getFromCache(id);
if (in != null) {
try {
InputStream in = Instance.getCache().getFromCache(id);
if (in != null) {
try {
- resizedImage = I
OUtils.toImage
(in);
+ resizedImage = I
mageUtils.fromStream
(in);
in.close();
in = null;
} catch (IOException e) {
in.close();
in = null;
} catch (IOException e) {
@@
-375,7
+380,7
@@
class GuiReaderBook extends JPanel {
if (resizedImage == null) {
try {
if (resizedImage == null) {
try {
- BufferedImage cover =
Instance
.getLibrary().getCover(
+ BufferedImage cover =
reader
.getLibrary().getCover(
meta.getLuid());
resizedImage = new BufferedImage(SPINE_WIDTH + COVER_WIDTH,
meta.getLuid());
resizedImage = new BufferedImage(SPINE_WIDTH + COVER_WIDTH,