use of org.geometerplus.fbreader.formats.fb2.FB2Reader in project FBReaderJ by geometer.
the class TestFB2Reader method writeTextModelDumpToFile.
private void writeTextModelDumpToFile(String inputFile, String outputFile) {
BookModel bookModel = new BookModel(inputFile);
new FB2Reader(bookModel).read();
ZLTextModel model = bookModel.getBookTextModel();
writeDumpToFile(model, outputFile);
}
use of org.geometerplus.fbreader.formats.fb2.FB2Reader in project FBReaderJ by geometer.
the class TestFB2Reader method testEndOfSectionParagraph.
public void testEndOfSectionParagraph() {
BookModel bookModel = new BookModel(myDirectory + "section.fb2");
new FB2Reader(bookModel).read();
ZLTextModel model = bookModel.getBookTextModel();
assertEquals(model.getParagraph(1).getKind(), ZLTextParagraph.Kind.END_OF_SECTION_PARAGRAPH);
}
use of org.geometerplus.fbreader.formats.fb2.FB2Reader in project FBReaderJ by geometer.
the class TestFB2Reader method testStanzaParagraphKinds.
public void testStanzaParagraphKinds() {
BookModel bookModel = new BookModel(myDirectory + "stanza.fb2");
new FB2Reader(bookModel).read();
ZLTextModel model = bookModel.getBookTextModel();
assertEquals(model.getParagraph(0).getKind(), ZLTextParagraph.Kind.BEFORE_SKIP_PARAGRAPH);
assertEquals(model.getParagraph(2).getKind(), ZLTextParagraph.Kind.AFTER_SKIP_PARAGRAPH);
assertEquals(model.getParagraph(1).getKind(), ZLTextParagraph.Kind.TEXT_PARAGRAPH);
}
use of org.geometerplus.fbreader.formats.fb2.FB2Reader in project FBReaderJ by geometer.
the class TestFB2Reader method testTreeParagraphRef.
public void testTreeParagraphRef() {
BookModel bookModel = new BookModel(myDirectory + "tree1.fb2");
new FB2Reader(bookModel).read();
ContentsModel model = bookModel.getContentsModel();
assertTrue(model.getReference((ZLTextTreeParagraph) model.getParagraph(0)) == 0);
}
use of org.geometerplus.fbreader.formats.fb2.FB2Reader in project FBReaderJ by geometer.
the class TestFB2Reader method testImageSize.
public void testImageSize() {
BookModel model = new BookModel(myDirectory + "image.fb2");
new FB2Reader(model).read();
ZLImage image = model.getImageMap().getImage("cover.jpg");
ZLImageData imageData = ZLImageManager.getInstance().getImageData(image);
ZLSwingPaintContext paint = new ZLSwingPaintContext();
assertTrue(paint.imageHeight(imageData) == 277);
assertTrue(paint.imageWidth(imageData) == 200);
}
Aggregations