本文整理汇总了Java中org.geometerplus.fbreader.bookmodel.BookReader类的典型用法代码示例。如果您正苦于以下问题:Java BookReader类的具体用法?Java BookReader怎么用?Java BookReader使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BookReader类属于org.geometerplus.fbreader.bookmodel包,在下文中一共展示了BookReader类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doAtStart
import org.geometerplus.fbreader.bookmodel.BookReader; //导入依赖的package包/类
protected void doAtStart(XHTMLReader reader, ZLStringMap xmlattributes) {
String fileName = reader.getAttributeValue(xmlattributes, myNamespace, myNameAttribute);
if (fileName != null) {
fileName = MiscUtil.decodeHtmlReference(fileName);
final ZLFile imageFile = ZLFile.createFileByPath(reader.myPathPrefix + fileName);
if (imageFile != null) {
final BookReader modelReader = reader.getModelReader();
boolean flag = modelReader.paragraphIsOpen() && !modelReader.paragraphIsNonEmpty();
if (flag) {
modelReader.endParagraph();
}
final String imageName = imageFile.getLongName();
modelReader.addImageReference(imageName, (short)0, false);
modelReader.addImage(imageName, new ZLFileImage(MimeType.IMAGE_AUTO, imageFile));
if (flag) {
modelReader.beginParagraph();
}
}
}
}
示例2: doAtStart
import org.geometerplus.fbreader.bookmodel.BookReader; //导入依赖的package包/类
protected void doAtStart(XHTMLReader reader, ZLStringMap xmlattributes) {
final BookReader modelReader = reader.getModelReader();
modelReader.endParagraph();
// TODO: increase left indent
modelReader.beginParagraph();
// TODO: replace bullet sign by number inside OL tag
modelReader.addData(BULLET);
}
示例3: OEBBookReader
import org.geometerplus.fbreader.bookmodel.BookReader; //导入依赖的package包/类
OEBBookReader(BookModel model) {
myModelReader = new BookReader(model);
model.setLabelResolver(new BookModel.LabelResolver() {
public List<String> getCandidates(String id) {
final int index = id.indexOf("#");
return index > 0
? Collections.<String>singletonList(id.substring(0, index))
: Collections.<String>emptyList();
}
});
}
示例4: doAtStart
import org.geometerplus.fbreader.bookmodel.BookReader; //导入依赖的package包/类
protected void doAtStart(XHTMLReader reader, ZLStringMap xmlattributes) {
final BookReader modelReader = reader.getModelReader();
switch (myControl) {
case FBTextKind.TITLE:
case FBTextKind.H1:
case FBTextKind.H2:
if (modelReader.Model.BookTextModel.getParagraphsNumber() > 1) {
modelReader.insertEndOfSectionParagraph();
}
modelReader.enterTitle();
break;
}
modelReader.pushKind(myControl);
modelReader.beginParagraph();
}
示例5: doAtEnd
import org.geometerplus.fbreader.bookmodel.BookReader; //导入依赖的package包/类
protected void doAtEnd(XHTMLReader reader) {
final BookReader modelReader = reader.getModelReader();
modelReader.endParagraph();
modelReader.popKind();
switch (myControl) {
case FBTextKind.TITLE:
case FBTextKind.H1:
case FBTextKind.H2:
modelReader.exitTitle();
break;
}
}
示例6: doAtStart
import org.geometerplus.fbreader.bookmodel.BookReader; //导入依赖的package包/类
protected void doAtStart(XHTMLReader reader, ZLStringMap xmlattributes) {
final BookReader modelReader = reader.getModelReader();
final String href = xmlattributes.getValue("href");
if (myHyperlinkStackSize == myHyperlinkStack.length) {
myHyperlinkStack = ZLArrayUtils.createCopy(myHyperlinkStack, myHyperlinkStackSize, 2 * myHyperlinkStackSize);
}
if (href != null && href.length() > 0) {
String link = href;
final byte hyperlinkType;
if (isReference(link)) {
hyperlinkType = FBTextKind.EXTERNAL_HYPERLINK;
} else {
hyperlinkType = FBTextKind.INTERNAL_HYPERLINK;
final int index = href.indexOf('#');
if (index == 0) {
link =
new StringBuilder(reader.myReferencePrefix)
.append(href, 1, href.length())
.toString();
} else if (index > 0) {
link =
new StringBuilder(reader.getLocalFileAlias(href.substring(0, index)))
.append(href, index, href.length())
.toString();
} else {
link = reader.getLocalFileAlias(href);
}
}
myHyperlinkStack[myHyperlinkStackSize++] = hyperlinkType;
modelReader.addHyperlinkControl(hyperlinkType, link);
} else {
myHyperlinkStack[myHyperlinkStackSize++] = FBTextKind.REGULAR;
}
final String name = xmlattributes.getValue("name");
if (name != null) {
modelReader.addHyperlinkLabel(reader.myReferencePrefix + name);
}
}
示例7: doAtStart
import org.geometerplus.fbreader.bookmodel.BookReader; //导入依赖的package包/类
protected void doAtStart(XHTMLReader reader, ZLStringMap xmlattributes) {
final BookReader modelReader = reader.getModelReader();
modelReader.pushKind(myControl);
modelReader.addControl(myControl, true);
}
示例8: doAtEnd
import org.geometerplus.fbreader.bookmodel.BookReader; //导入依赖的package包/类
protected void doAtEnd(XHTMLReader reader) {
final BookReader modelReader = reader.getModelReader();
modelReader.addControl(myControl, false);
modelReader.popKind();
}
示例9: NCXReader
import org.geometerplus.fbreader.bookmodel.BookReader; //导入依赖的package包/类
NCXReader(BookReader modelReader) {
}
示例10: doAtStart
import org.geometerplus.fbreader.bookmodel.BookReader; //导入依赖的package包/类
protected void doAtStart(XHTMLReader reader, ZLStringMap xmlattributes) {
reader.myPreformatted = true;
final BookReader modelReader = reader.getModelReader();
modelReader.beginParagraph();
modelReader.addControl(FBTextKind.CODE, true);
}
示例11: doAtEnd
import org.geometerplus.fbreader.bookmodel.BookReader; //导入依赖的package包/类
protected void doAtEnd(XHTMLReader reader) {
final BookReader modelReader = reader.getModelReader();
modelReader.addControl(FBTextKind.CODE, false);
modelReader.endParagraph();
reader.myPreformatted = false;
}
示例12: XHTMLReader
import org.geometerplus.fbreader.bookmodel.BookReader; //导入依赖的package包/类
public XHTMLReader(BookReader modelReader, Map<String,String> fileNumbers) {
myModelReader = modelReader;
myFileNumbers = fileNumbers;
}
示例13: getModelReader
import org.geometerplus.fbreader.bookmodel.BookReader; //导入依赖的package包/类
final BookReader getModelReader() {
return myModelReader;
}
示例14: FB2Reader
import org.geometerplus.fbreader.bookmodel.BookReader; //导入依赖的package包/类
public FB2Reader(BookModel model) {
myBookReader = new BookReader(model);
}