当前位置: 首页>>代码示例>>Java>>正文


Java BookReader类代码示例

本文整理汇总了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();
			}
		}
	}
}
 
开发者ID:AlixMing,项目名称:FBreader,代码行数:21,代码来源:XHTMLTagImageAction.java

示例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);
}
 
开发者ID:AlixMing,项目名称:FBreader,代码行数:9,代码来源:XHTMLTagItemAction.java

示例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();
		}
	});
}
 
开发者ID:liufeiit,项目名称:itmarry,代码行数:12,代码来源:OEBBookReader.java

示例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();
}
 
开发者ID:liufeiit,项目名称:itmarry,代码行数:16,代码来源:XHTMLTagParagraphWithControlAction.java

示例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;
	}
}
 
开发者ID:liufeiit,项目名称:itmarry,代码行数:13,代码来源:XHTMLTagParagraphWithControlAction.java

示例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);
	}
}
 
开发者ID:liufeiit,项目名称:itmarry,代码行数:39,代码来源:XHTMLTagHyperlinkAction.java

示例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);
}
 
开发者ID:AlixMing,项目名称:FBreader,代码行数:6,代码来源:XHTMLTagControlAction.java

示例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();
}
 
开发者ID:AlixMing,项目名称:FBreader,代码行数:6,代码来源:XHTMLTagControlAction.java

示例9: NCXReader

import org.geometerplus.fbreader.bookmodel.BookReader; //导入依赖的package包/类
NCXReader(BookReader modelReader) {
}
 
开发者ID:liufeiit,项目名称:itmarry,代码行数:3,代码来源:NCXReader.java

示例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);
}
 
开发者ID:liufeiit,项目名称:itmarry,代码行数:7,代码来源:XHTMLTagPreAction.java

示例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;
}
 
开发者ID:liufeiit,项目名称:itmarry,代码行数:7,代码来源:XHTMLTagPreAction.java

示例12: XHTMLReader

import org.geometerplus.fbreader.bookmodel.BookReader; //导入依赖的package包/类
public XHTMLReader(BookReader modelReader, Map<String,String> fileNumbers) {
	myModelReader = modelReader;
	myFileNumbers = fileNumbers;
}
 
开发者ID:liufeiit,项目名称:itmarry,代码行数:5,代码来源:XHTMLReader.java

示例13: getModelReader

import org.geometerplus.fbreader.bookmodel.BookReader; //导入依赖的package包/类
final BookReader getModelReader() {
	return myModelReader;
}
 
开发者ID:liufeiit,项目名称:itmarry,代码行数:4,代码来源:XHTMLReader.java

示例14: FB2Reader

import org.geometerplus.fbreader.bookmodel.BookReader; //导入依赖的package包/类
public FB2Reader(BookModel model) {
		myBookReader = new BookReader(model);
}
 
开发者ID:liufeiit,项目名称:itmarry,代码行数:4,代码来源:FB2Reader.java


注:本文中的org.geometerplus.fbreader.bookmodel.BookReader类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。