import javax.swing.SwingConstants;
import be.nikiroo.fanfix.Instance;
+import be.nikiroo.fanfix.bundles.StringIdGui;
import be.nikiroo.fanfix.data.Chapter;
+import be.nikiroo.fanfix.data.MetaData;
import be.nikiroo.fanfix.data.Story;
import be.nikiroo.utils.Image;
import be.nikiroo.utils.ui.ImageUtilsAwt;
* Create a new viewer.
*
* @param story
- * the {@link Story} to work on.
+ * the {@link Story} to work on
*/
public GuiReaderViewerPanel(Story story) {
+ this(story.getMeta(), story.getMeta().isImageDocument());
+ }
+
+ /**
+ * Create a new viewer.
+ *
+ * @param meta
+ * the {@link MetaData} of the story to show
+ * @param isImageDocument
+ * TRUE if it is an image document, FALSE if not
+ */
+ public GuiReaderViewerPanel(MetaData meta, boolean isImageDocument) {
super(new BorderLayout());
- this.imageDocument = story.getMeta().isImageDocument();
+ this.imageDocument = isImageDocument;
this.text = new JEditorPane("text/html", "");
+ text.setEditable(false);
text.setAlignmentY(TOP_ALIGNMENT);
htmlOutput = new GuiReaderViewerTextOutput();
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
scroll.getVerticalScrollBar().setUnitIncrement(16);
+ // TODO:
+ // JButton up = new BasicArrowButton(BasicArrowButton.NORTH);
+ // JButton down = new BasicArrowButton(BasicArrowButton.SOUTH);
+
if (!imageDocument) {
add(scroll, BorderLayout.CENTER);
} else {
main.invalidate();
}
- setChapter(story.getMeta().getResume());
+ setChapter(meta.getResume());
}
/**
}
imageProgress.setValue(i);
- imageProgress.setString(String.format("Image %d / %d", i + 1, chap
- .getParagraphs().size()));
+ imageProgress.setString(GuiReader.trans(StringIdGui.IMAGE_PROGRESSION,
+ i + 1, chap.getParagraphs().size()));
currentImage = i;