TextLayout createPartTextLayout(int shift, int length) {
checkTextLayoutValid();
if (breakInfo == null) {
breakInfo = new TextLayoutBreakInfo(textLayout.getCharacterCount());
}
TextLayout partTextLayout = breakInfo.findPartTextLayout(shift, length);
if (partTextLayout == null) {
DocumentView docView = getDocumentView();
Document doc = docView.getDocument();
CharSequence docText = DocumentUtilities.getText(doc);
int startOffset = getStartOffset();
String text = docText.subSequence(startOffset + shift, startOffset + shift + length).toString();
if (docView.op.isNonPrintableCharactersVisible()) {
text = text.replace(' ', DocumentViewOp.PRINTING_SPACE);
}
AttributeSet attrs = ViewUtils.getFirstAttributes(getAttributes());
Font font = ViewUtils.getFont(attrs, docView.op.getDefaultFont());
partTextLayout = docView.op.createTextLayout(text, font);
breakInfo.add(shift, length, partTextLayout);
}
return partTextLayout;
}
HighlightsView.java 文件源码
java
阅读 20
收藏 0
点赞 0
评论 0
项目:incubator-netbeans
作者:
评论列表
文章目录