• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ZLTextRegion类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.geometerplus.zlibrary.text.view.ZLTextRegion的典型用法代码示例。如果您正苦于以下问题:Java ZLTextRegion类的具体用法?Java ZLTextRegion怎么用?Java ZLTextRegion使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ZLTextRegion类属于org.geometerplus.zlibrary.text.view包,在下文中一共展示了ZLTextRegion类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: run

import org.geometerplus.zlibrary.text.view.ZLTextRegion; //导入依赖的package包/类
@Override
protected void run(Object ... params) {
	final FBView fbView = Reader.getTextView();
	ZLTextRegion region = fbView.getSelectedRegion();
	final ZLTextRegion.Filter filter =
		(region != null && region.getSoul() instanceof ZLTextWordRegionSoul)
			|| Reader.NavigateAllWordsOption.getValue()
				? ZLTextRegion.AnyRegionFilter : ZLTextRegion.ImageOrHyperlinkFilter;
	region = fbView.nextRegion(myDirection, filter);
	if (region != null) {
		fbView.selectRegion(region);
	} else {
		switch (myDirection) {
			case down:
				fbView.scrollPage(true, FBView.ScrollingMode.SCROLL_LINES, 1);
				break;
			case up:
				fbView.scrollPage(false, FBView.ScrollingMode.SCROLL_LINES, 1);
				break;
		}
	}

	Reader.getViewWidget().reset();
	Reader.getViewWidget().repaint();
}
 
开发者ID:AlixMing,项目名称:FBreader,代码行数:26,代码来源:MoveCursorAction.java


示例2: onFingerSingleTap

import org.geometerplus.zlibrary.text.view.ZLTextRegion; //导入依赖的package包/类
public boolean onFingerSingleTap(int x, int y)
{
	if (super.onFingerSingleTap(x, y)) { return true; }

	final ZLTextRegion region = findRegion(x, y, MAX_SELECTION_DISTANCE, ZLTextRegion.HyperlinkFilter);
	if (region != null)
	{
		selectRegion(region);
		myReader.getViewWidget().reset();
		myReader.getViewWidget().repaint();
		myReader.runAction(ActionCode.PROCESS_HYPERLINK);
		return true;
	}

	final ZLTextHighlighting highlighting = findHighlighting(x, y, MAX_SELECTION_DISTANCE);
	if (highlighting instanceof BookmarkHighlighting)
	{
		myReader.runAction(ActionCode.SELECTION_BOOKMARK, ((BookmarkHighlighting) highlighting).Bookmark);
		return true;
	}

	myReader.runAction(
			getZoneMap().getActionByCoordinates(x, y, getContextWidth(), getContextHeight(),
					isDoubleTapSupported() ? TapZoneMap.Tap.singleNotDoubleTap : TapZoneMap.Tap.singleTap), x, y);

	return true;
}
 
开发者ID:AlixMing,项目名称:FBreader,代码行数:28,代码来源:FBView.java


示例3: onFingerMoveAfterLongPress

import org.geometerplus.zlibrary.text.view.ZLTextRegion; //导入依赖的package包/类
public boolean onFingerMoveAfterLongPress(int x, int y)
{
	if (super.onFingerMoveAfterLongPress(x, y)) { return true; }

	final ZLTextSelectionCursor cursor = getSelectionCursorInMovement();
	if (cursor != ZLTextSelectionCursor.None)
	{
		moveSelectionCursorTo(cursor, x, y);
		return true;
	}

	ZLTextRegion region = getSelectedRegion();
	if (region != null)
	{
		ZLTextRegion.Soul soul = region.getSoul();
		if (soul instanceof ZLTextHyperlinkRegionSoul || soul instanceof ZLTextWordRegionSoul)
		{
			if (myReader.WordTappingActionOption.getValue() != FBReaderApp.WordTappingAction.doNothing)
			{
				region = findRegion(x, y, MAX_SELECTION_DISTANCE, ZLTextRegion.AnyRegionFilter);
				if (region != null)
				{
					soul = region.getSoul();
					if (soul instanceof ZLTextHyperlinkRegionSoul || soul instanceof ZLTextWordRegionSoul)
					{
						selectRegion(region);
						myReader.getViewWidget().reset();
						myReader.getViewWidget().repaint();
					}
				}
			}
		}
	}
	return true;
}
 
开发者ID:AlixMing,项目名称:FBreader,代码行数:36,代码来源:FBView.java


示例4: onFingerReleaseAfterLongPress

import org.geometerplus.zlibrary.text.view.ZLTextRegion; //导入依赖的package包/类
public boolean onFingerReleaseAfterLongPress(int x, int y)
{
	if (super.onFingerReleaseAfterLongPress(x, y)) { return true; }

	final ZLTextSelectionCursor cursor = getSelectionCursorInMovement();
	if (cursor != ZLTextSelectionCursor.None)
	{
		releaseSelectionCursor();
		return true;
	}

	final ZLTextRegion region = getSelectedRegion();
	if (region != null)
	{
		final ZLTextRegion.Soul soul = region.getSoul();

		boolean doRunAction = false;
		if (soul instanceof ZLTextWordRegionSoul)
		{
			doRunAction = myReader.WordTappingActionOption.getValue() == FBReaderApp.WordTappingAction.openDictionary;
		}
		else if (soul instanceof ZLTextImageRegionSoul)
		{
			doRunAction = myReader.ImageTappingActionOption.getValue() == FBReaderApp.ImageTappingAction.openImageView;
		}

		if (doRunAction)
		{
			myReader.runAction(ActionCode.PROCESS_HYPERLINK);
			return true;
		}
	}

	return false;
}
 
开发者ID:AlixMing,项目名称:FBreader,代码行数:36,代码来源:FBView.java


示例5: onFingerSingleTap

import org.geometerplus.zlibrary.text.view.ZLTextRegion; //导入依赖的package包/类
public boolean onFingerSingleTap(int x, int y) {
	if (super.onFingerSingleTap(x, y)) {
		return true;
	}

	final ZLTextRegion region = findRegion(x, y, MAX_SELECTION_DISTANCE, ZLTextRegion.HyperlinkFilter);
	if (region != null) {
		selectRegion(region);
		myReader.getViewWidget().reset();
		myReader.getViewWidget().repaint();
		myReader.runAction(ActionCode.PROCESS_HYPERLINK);
		return true;
	}

	final ZLTextHighlighting highlighting = findHighlighting(x, y, MAX_SELECTION_DISTANCE);
	if (highlighting instanceof BookmarkHighlighting) {
		myReader.runAction(
			ActionCode.SELECTION_BOOKMARK,
			((BookmarkHighlighting)highlighting).Bookmark
		);
		return true;
	}

	myReader.runAction(getZoneMap().getActionByCoordinates(
		x, y, getContextWidth(), getContextHeight(),
		isDoubleTapSupported() ? TapZoneMap.Tap.singleNotDoubleTap : TapZoneMap.Tap.singleTap
	), x, y);

	return true;
}
 
开发者ID:liufeiit,项目名称:itmarry,代码行数:31,代码来源:FBView.java


示例6: onFingerMoveAfterLongPress

import org.geometerplus.zlibrary.text.view.ZLTextRegion; //导入依赖的package包/类
public boolean onFingerMoveAfterLongPress(int x, int y) {
	if (super.onFingerMoveAfterLongPress(x, y)) {
		return true;
	}

	final ZLTextSelectionCursor cursor = getSelectionCursorInMovement();
	if (cursor != ZLTextSelectionCursor.None) {
		moveSelectionCursorTo(cursor, x, y);
		return true;
	}

	ZLTextRegion region = getSelectedRegion();
	if (region != null) {
		ZLTextRegion.Soul soul = region.getSoul();
		if (soul instanceof ZLTextHyperlinkRegionSoul ||
			soul instanceof ZLTextWordRegionSoul) {
			if (myReader.WordTappingActionOption.getValue() !=
				FBReaderApp.WordTappingAction.doNothing) {
				region = findRegion(x, y, MAX_SELECTION_DISTANCE, ZLTextRegion.AnyRegionFilter);
				if (region != null) {
					soul = region.getSoul();
					if (soul instanceof ZLTextHyperlinkRegionSoul
						 || soul instanceof ZLTextWordRegionSoul) {
						selectRegion(region);
						myReader.getViewWidget().reset();
						myReader.getViewWidget().repaint();
					}
				}
			}
		}
	}
	return true;
}
 
开发者ID:liufeiit,项目名称:itmarry,代码行数:34,代码来源:FBView.java


示例7: onFingerReleaseAfterLongPress

import org.geometerplus.zlibrary.text.view.ZLTextRegion; //导入依赖的package包/类
public boolean onFingerReleaseAfterLongPress(int x, int y) {
	if (super.onFingerReleaseAfterLongPress(x, y)) {
		return true;
	}

	final ZLTextSelectionCursor cursor = getSelectionCursorInMovement();
	if (cursor != ZLTextSelectionCursor.None) {
		releaseSelectionCursor();
		return true;
	}

	final ZLTextRegion region = getSelectedRegion();
	if (region != null) {
		final ZLTextRegion.Soul soul = region.getSoul();

		boolean doRunAction = false;
		if (soul instanceof ZLTextWordRegionSoul) {
			doRunAction =
				myReader.WordTappingActionOption.getValue() ==
				FBReaderApp.WordTappingAction.openDictionary;
		} else if (soul instanceof ZLTextImageRegionSoul) {
			doRunAction =
				myReader.ImageTappingActionOption.getValue() ==
				FBReaderApp.ImageTappingAction.openImageView;
		}

		if (doRunAction) {
			myReader.runAction(ActionCode.PROCESS_HYPERLINK);
			return true;
		}
	}

	return false;
}
 
开发者ID:liufeiit,项目名称:itmarry,代码行数:35,代码来源:FBView.java


示例8: openWordInDictionary

import org.geometerplus.zlibrary.text.view.ZLTextRegion; //导入依赖的package包/类
public static void openWordInDictionary(Activity activity, ZLTextWord word, ZLTextRegion region) {
	openTextInDictionary(
		activity, word.toString(), true, region.getTop(), region.getBottom()
	);
}
 
开发者ID:AlixMing,项目名称:FBreader,代码行数:6,代码来源:DictionaryUtil.java


示例9: onFingerLongPress

import org.geometerplus.zlibrary.text.view.ZLTextRegion; //导入依赖的package包/类
public boolean onFingerLongPress(int x, int y)
{
	if (super.onFingerLongPress(x, y)) { return true; }

	final ZLTextRegion region = findRegion(x, y, MAX_SELECTION_DISTANCE, ZLTextRegion.AnyRegionFilter);
	if (region != null)
	{
		final ZLTextRegion.Soul soul = region.getSoul();
		boolean doSelectRegion = false;
		if (soul instanceof ZLTextWordRegionSoul)
		{
			switch (myReader.WordTappingActionOption.getValue())
			{
			case startSelecting:
				myReader.runAction(ActionCode.SELECTION_HIDE_PANEL);
				initSelection(x, y);
				final ZLTextSelectionCursor cursor = findSelectionCursor(x, y);
				if (cursor != ZLTextSelectionCursor.None)
				{
					moveSelectionCursorTo(cursor, x, y);
				}
				return true;
			case selectSingleWord:
			case openDictionary:
				doSelectRegion = true;
				break;
			}
		}
		else if (soul instanceof ZLTextImageRegionSoul)
		{
			doSelectRegion = myReader.ImageTappingActionOption.getValue() != FBReaderApp.ImageTappingAction.doNothing;
		}
		else if (soul instanceof ZLTextHyperlinkRegionSoul)
		{
			doSelectRegion = true;
		}

		if (doSelectRegion)
		{
			selectRegion(region);
			myReader.getViewWidget().reset();
			myReader.getViewWidget().repaint();
			return true;
		}
	}

	return false;
}
 
开发者ID:AlixMing,项目名称:FBreader,代码行数:49,代码来源:FBView.java


示例10: run

import org.geometerplus.zlibrary.text.view.ZLTextRegion; //导入依赖的package包/类
@Override
protected void run(Object ... params) {
	final ZLTextRegion region = Reader.getTextView().getSelectedRegion();
	if (region == null) {
		return;
	}

	final ZLTextRegion.Soul soul = region.getSoul();
	if (soul instanceof ZLTextHyperlinkRegionSoul) {
		Reader.getTextView().hideSelectedRegionBorder();
		Reader.getViewWidget().repaint();
		final ZLTextHyperlink hyperlink = ((ZLTextHyperlinkRegionSoul)soul).Hyperlink;
		switch (hyperlink.Type) {
			case FBHyperlinkType.EXTERNAL:
				//openInBrowser(hyperlink.Id);
				break;
			case FBHyperlinkType.INTERNAL:
				Reader.Collection.markHyperlinkAsVisited(Reader.Model.Book, hyperlink.Id);
				Reader.tryOpenFootnote(hyperlink.Id);
				break;
		}
	} else if (soul instanceof ZLTextImageRegionSoul) {
		Reader.getTextView().hideSelectedRegionBorder();
		Reader.getViewWidget().repaint();
		final String url = ((ZLTextImageRegionSoul)soul).ImageElement.URL;
		if (url != null) {
			try {
				final Intent intent = new Intent();
				intent.setClass(BaseActivity, ImageViewActivity.class);
				intent.setData(Uri.parse(url));
				intent.putExtra(
					ImageViewActivity.BACKGROUND_COLOR_KEY,
					Reader.ImageViewBackgroundOption.getValue().intValue()
				);
				OrientationUtil.startActivity(BaseActivity, intent);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	} else if (soul instanceof ZLTextWordRegionSoul) {
		//DictionaryUtil.openWordInDictionary(
			//BaseActivity, ((ZLTextWordRegionSoul)soul).Word, region
		//);
	}
}
 
开发者ID:liufeiit,项目名称:itmarry,代码行数:46,代码来源:ProcessHyperlinkAction.java


示例11: onFingerLongPress

import org.geometerplus.zlibrary.text.view.ZLTextRegion; //导入依赖的package包/类
public boolean onFingerLongPress(int x, int y) {
	if (super.onFingerLongPress(x, y)) {
		return true;
	}

	final ZLTextRegion region = findRegion(x, y, MAX_SELECTION_DISTANCE, ZLTextRegion.AnyRegionFilter);
	if (region != null) {
		final ZLTextRegion.Soul soul = region.getSoul();
		boolean doSelectRegion = false;
		if (soul instanceof ZLTextWordRegionSoul) {
			switch (myReader.WordTappingActionOption.getValue()) {
				case startSelecting:
					myReader.runAction(ActionCode.SELECTION_HIDE_PANEL);
					initSelection(x, y);
					final ZLTextSelectionCursor cursor = findSelectionCursor(x, y);
					if (cursor != ZLTextSelectionCursor.None) {
						moveSelectionCursorTo(cursor, x, y);
					}
					return true;
				case selectSingleWord:
				case openDictionary:
					doSelectRegion = true;
					break;
			}
		} else if (soul instanceof ZLTextImageRegionSoul) {
			doSelectRegion =
				myReader.ImageTappingActionOption.getValue() !=
				FBReaderApp.ImageTappingAction.doNothing;
		} else if (soul instanceof ZLTextHyperlinkRegionSoul) {
			doSelectRegion = true;
		}

		if (doSelectRegion) {
			selectRegion(region);
			myReader.getViewWidget().reset();
			myReader.getViewWidget().repaint();
			return true;
		}
	}

	return false;
}
 
开发者ID:liufeiit,项目名称:itmarry,代码行数:43,代码来源:FBView.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RuleTemplateService类代码示例发布时间:2022-05-16
下一篇:
Java ClusteringIndexFilter类代码示例发布时间:2022-05-16
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap