public Bounds translate(Point offset) { return translate(offset.x, offset.y); }
public Bounds translate(Point offset) { return translate(offset.x, offset.y); }
@Override public Bounds getCharacterBounds(int offset) { Bounds characterBounds; if (documentView == null) { characterBounds = null; } else { characterBounds = documentView.getCharacterBounds(offset); if (characterBounds != null) { characterBounds = characterBounds.translate(margin.left, margin.top); } } return characterBounds; }
@Override public Bounds getCharacterBounds(int offset) { Bounds characterBounds; if (documentView == null) { characterBounds = null; } else { characterBounds = documentView.getCharacterBounds(offset); if (characterBounds != null) { characterBounds = characterBounds.translate(margin.left, margin.top); } } return characterBounds; }
@Override public Bounds getCharacterBounds(int offset) { Bounds characterBounds = null; for (int i = 0, n = nodeViews.getLength(); i < n; i++) { TextPaneSkinNodeView nodeView = nodeViews.get(i); int nodeViewOffset = nodeView.getOffset(); int characterCount = nodeView.getCharacterCount(); if (offset >= nodeViewOffset && offset < nodeViewOffset + characterCount) { characterBounds = nodeView.getCharacterBounds(offset - nodeViewOffset); if (characterBounds != null) { characterBounds = characterBounds.translate(nodeView.getX(), nodeView.getY()); } break; } } if (characterBounds != null) { characterBounds = characterBounds.intersect(0, 0, getWidth(), getHeight()); } return characterBounds; }
@Override public Bounds getCharacterBounds(int offset) { Bounds characterBounds = null; for (int i = 0, n = nodeViews.getLength(); i < n; i++) { TextPaneSkinNodeView nodeView = nodeViews.get(i); int nodeViewOffset = nodeView.getOffset(); int characterCount = nodeView.getCharacterCount(); if (offset >= nodeViewOffset && offset < nodeViewOffset + characterCount) { characterBounds = nodeView.getCharacterBounds(offset - nodeViewOffset); if (characterBounds != null) { characterBounds = characterBounds.translate(nodeView.getX(), nodeView.getY()); } break; } } if (characterBounds != null) { characterBounds = characterBounds.intersect(0, 0, getWidth(), getHeight()); } return characterBounds; }
@Override public Bounds getCharacterBounds(int offset) { Bounds characterBounds = null; if (offset == getCharacterCount() - 1) { characterBounds = terminatorBounds; } else { if (rows != null) { for (int i = 0, n = rows.getLength(); i < n; i++) { Row row = rows.get(i); for (RowSegment segment : row.rowSegments) { int nodeViewOffset = segment.offset; int characterCount = segment.nodeView.getCharacterCount(); if (offset >= nodeViewOffset && offset < nodeViewOffset + characterCount) { characterBounds = segment.nodeView.getCharacterBounds(offset - nodeViewOffset); if (characterBounds != null) { characterBounds = characterBounds.translate(segment.nodeView.getX(), segment.nodeView.getY()); } break; } } } } if (characterBounds != null) { characterBounds = characterBounds.intersect(0, 0, getWidth(), getHeight()); } } return characterBounds; }
@Override public Bounds getCharacterBounds(int offset) { Bounds characterBounds = null; if (offset == getCharacterCount() - 1) { characterBounds = terminatorBounds; } else { if (rows != null) { for (int i = 0, n = rows.getLength(); i < n; i++) { Row row = rows.get(i); for (RowSegment segment : row.rowSegments) { int nodeViewOffset = segment.offset; int characterCount = segment.nodeView.getCharacterCount(); if (offset >= nodeViewOffset && offset < nodeViewOffset + characterCount) { characterBounds = segment.nodeView.getCharacterBounds(offset - nodeViewOffset); if (characterBounds != null) { characterBounds = characterBounds.translate(segment.nodeView.getX(), segment.nodeView.getY()); } break; } } } } if (characterBounds != null) { characterBounds = characterBounds.intersect(0, 0, getWidth(), getHeight()); } } return characterBounds; }