本文整理了Java中com.koolearn.klibrary.text.view.ZLTextWordCursor.moveTo()
方法的一些代码示例,展示了ZLTextWordCursor.moveTo()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZLTextWordCursor.moveTo()
方法的具体详情如下:
包路径:com.koolearn.klibrary.text.view.ZLTextWordCursor
类名称:ZLTextWordCursor
方法名:moveTo
暂无
代码示例来源:origin: ydcx/KooReader
void moveStartCursor(int paragraphIndex, int wordIndex, int charIndex) { // 章节
if (StartCursor.isNull()) {
StartCursor.setCursor(EndCursor);
}
StartCursor.moveToParagraph(paragraphIndex);
StartCursor.moveTo(wordIndex, charIndex);
EndCursor.reset();
LineInfos.clear();
PaintState = PaintStateEnum.START_IS_KNOWN;
}
//
代码示例来源:origin: ydcx/KooReader
void moveEndCursor(int paragraphIndex, int wordIndex, int charIndex) {
if (EndCursor.isNull()) {
EndCursor.setCursor(StartCursor);
}
EndCursor.moveToParagraph(paragraphIndex);
if ((paragraphIndex > 0) && (wordIndex == 0) && (charIndex == 0)) {
EndCursor.previousParagraph();
EndCursor.moveToParagraphEnd();
} else {
EndCursor.moveTo(wordIndex, charIndex);
}
StartCursor.reset();
LineInfos.clear();
PaintState = PaintStateEnum.END_IS_KNOWN;
}
代码示例来源:origin: Jiangzqts/EpubRead
void findLineFromEnd(ZLTextWordCursor cursor, int overlappingValue) {
if (LineInfos.isEmpty() || (overlappingValue == 0)) {
cursor.reset();
return;
}
final ArrayList<ZLTextLineInfo> infos = LineInfos;
final int size = infos.size();
ZLTextLineInfo info = null;
for (int i = size - 1; i >= 0; --i) {
info = infos.get(i);
if (info.IsVisible) {
--overlappingValue;
if (overlappingValue == 0) {
break;
}
}
}
cursor.setCursor(info.ParagraphCursor);
cursor.moveTo(info.StartElementIndex, info.StartCharIndex);
}
代码示例来源:origin: Jiangzqts/EpubRead
void moveEndCursor(int paragraphIndex, int wordIndex, int charIndex) {
if (EndCursor.isNull()) {
EndCursor.setCursor(StartCursor);
}
EndCursor.moveToParagraph(paragraphIndex);
if ((paragraphIndex > 0) && (wordIndex == 0) && (charIndex == 0)) {
EndCursor.previousParagraph();
EndCursor.moveToParagraphEnd();
} else {
EndCursor.moveTo(wordIndex, charIndex);
}
StartCursor.reset();
LineInfos.clear();
PaintState = PaintStateEnum.END_IS_KNOWN;
}
代码示例来源:origin: Jiangzqts/EpubRead
void moveStartCursor(int paragraphIndex, int wordIndex, int charIndex) { // 章节
if (StartCursor.isNull()) {
StartCursor.setCursor(EndCursor);
}
StartCursor.moveToParagraph(paragraphIndex);
StartCursor.moveTo(wordIndex, charIndex);
EndCursor.reset();
LineInfos.clear();
PaintState = PaintStateEnum.START_IS_KNOWN;
}
//
代码示例来源:origin: ydcx/KooReader
void findLineFromEnd(ZLTextWordCursor cursor, int overlappingValue) {
if (LineInfos.isEmpty() || (overlappingValue == 0)) {
cursor.reset();
return;
}
final ArrayList<ZLTextLineInfo> infos = LineInfos;
final int size = infos.size();
ZLTextLineInfo info = null;
for (int i = size - 1; i >= 0; --i) {
info = infos.get(i);
if (info.IsVisible) {
--overlappingValue;
if (overlappingValue == 0) {
break;
}
}
}
cursor.setCursor(info.ParagraphCursor);
cursor.moveTo(info.StartElementIndex, info.StartCharIndex);
}
代码示例来源:origin: Jiangzqts/EpubRead
public void moveTo(ZLTextPosition position) {
LogUtil.i13("moveTo1:" + toString());
moveToParagraph(position.getParagraphIndex());
moveTo(position.getElementIndex(), position.getCharIndex());
}
代码示例来源:origin: Jiangzqts/EpubRead
void findLineFromStart(ZLTextWordCursor cursor, int overlappingValue) {
if (LineInfos.isEmpty() || (overlappingValue == 0)) {
cursor.reset();
return;
}
ZLTextLineInfo info = null;
for (ZLTextLineInfo i : LineInfos) {
info = i;
if (info.IsVisible) {
--overlappingValue;
if (overlappingValue == 0) {
break;
}
}
}
cursor.setCursor(info.ParagraphCursor);
cursor.moveTo(info.EndElementIndex, info.EndCharIndex);
}
代码示例来源:origin: ydcx/KooReader
public void moveTo(ZLTextPosition position) {
LogUtil.i13("moveTo1:" + toString());
moveToParagraph(position.getParagraphIndex());
moveTo(position.getElementIndex(), position.getCharIndex());
}
代码示例来源:origin: ydcx/KooReader
void findLineFromStart(ZLTextWordCursor cursor, int overlappingValue) {
if (LineInfos.isEmpty() || (overlappingValue == 0)) {
cursor.reset();
return;
}
ZLTextLineInfo info = null;
for (ZLTextLineInfo i : LineInfos) {
info = i;
if (info.IsVisible) {
--overlappingValue;
if (overlappingValue == 0) {
break;
}
}
}
cursor.setCursor(info.ParagraphCursor);
cursor.moveTo(info.EndElementIndex, info.EndCharIndex);
}
代码示例来源:origin: Jiangzqts/EpubRead
void findPercentFromStart(ZLTextWordCursor cursor, int percent) {
if (LineInfos.isEmpty()) {
cursor.reset();
return;
}
int height = myHeight * percent / 100;
boolean visibleLineOccured = false;
ZLTextLineInfo info = null;
for (ZLTextLineInfo i : LineInfos) {
info = i;
if (info.IsVisible) {
visibleLineOccured = true;
}
height -= info.Height + info.Descent + info.VSpaceAfter;
if (visibleLineOccured && (height <= 0)) {
break;
}
}
cursor.setCursor(info.ParagraphCursor);
cursor.moveTo(info.EndElementIndex, info.EndCharIndex);
}
}
代码示例来源:origin: ydcx/KooReader
void findPercentFromStart(ZLTextWordCursor cursor, int percent) {
if (LineInfos.isEmpty()) {
cursor.reset();
return;
}
int height = myHeight * percent / 100;
boolean visibleLineOccured = false;
ZLTextLineInfo info = null;
for (ZLTextLineInfo i : LineInfos) {
info = i;
if (info.IsVisible) {
visibleLineOccured = true;
}
height -= info.Height + info.Descent + info.VSpaceAfter;
if (visibleLineOccured && (height <= 0)) {
break;
}
}
cursor.setCursor(info.ParagraphCursor);
cursor.moveTo(info.EndElementIndex, info.EndCharIndex);
}
}
代码示例来源:origin: ydcx/KooReader
public void rebuild() {
if (!isNull()) {
myParagraphCursor.clear();
myParagraphCursor.fill();
moveTo(myElementIndex, myCharIndex);
}
}
代码示例来源:origin: Jiangzqts/EpubRead
public void rebuild() {
if (!isNull()) {
myParagraphCursor.clear();
myParagraphCursor.fill();
moveTo(myElementIndex, myCharIndex);
}
}
代码示例来源:origin: Jiangzqts/EpubRead
result.moveTo(info.EndElementIndex, info.EndCharIndex);
page.LineInfos.add(info);
if (textAreaHeight < 0) {
代码示例来源:origin: ydcx/KooReader
result.moveTo(info.EndElementIndex, info.EndCharIndex);
page.LineInfos.add(info);
if (textAreaHeight < 0) {
代码示例来源:origin: Jiangzqts/EpubRead
private void skip(ZLTextPage page, ZLTextWordCursor cursor, int unit, int size) {
final ZLTextParagraphCursor paragraphCursor = cursor.getParagraphCursor();
if (paragraphCursor == null) {
return;
}
final int endElementIndex = paragraphCursor.getParagraphLength();
resetTextStyle();
applyStyleChanges(paragraphCursor, 0, cursor.getElementIndex());
ZLTextLineInfo info = null;
while (!cursor.isEndOfParagraph() && size > 0) {
info = processTextLine(page, paragraphCursor, cursor.getElementIndex(), cursor.getCharIndex(), endElementIndex, info);
cursor.moveTo(info.EndElementIndex, info.EndCharIndex);
size -= infoSize(info, unit);
}
}
代码示例来源:origin: ydcx/KooReader
private void skip(ZLTextPage page, ZLTextWordCursor cursor, int unit, int size) {
final ZLTextParagraphCursor paragraphCursor = cursor.getParagraphCursor();
if (paragraphCursor == null) {
return;
}
final int endElementIndex = paragraphCursor.getParagraphLength();
resetTextStyle();
applyStyleChanges(paragraphCursor, 0, cursor.getElementIndex());
ZLTextLineInfo info = null;
while (!cursor.isEndOfParagraph() && size > 0) {
info = processTextLine(page, paragraphCursor, cursor.getElementIndex(), cursor.getCharIndex(), endElementIndex, info);
cursor.moveTo(info.EndElementIndex, info.EndCharIndex);
size -= infoSize(info, unit);
}
}
代码示例来源:origin: ydcx/KooReader
cursor.moveTo(bookmark);
代码示例来源:origin: Jiangzqts/EpubRead
cursor.moveTo(bookmark);
内容来源于网络,如有侵权,请联系作者删除!