synchronized int getLineCount() { int lineCnt; try { lineCnt = endMark.getLine() + 1; } catch (InvalidMarkException e) { if (Boolean.getBoolean("netbeans.debug.exceptions")) { // NOI18N e.printStackTrace(); } return 0; } return lineCnt; }
/** Compute and update main area height */ public void updateMainHeight() { LeafElement elem = (LeafElement) getElement(); // need leaf element try { int lineDiff = (elem.getEndMark().getLine() - elem.getStartMark().getLine() + 1); mainHeight = lineDiff * getEditorUI().getLineHeight(); } catch (InvalidMarkException e) { mainHeight = 0; } }
sb.append(mark.getOffset()); sb.append(", "); sb.append(mark.getLine()); sb.append(')');
/** Compute and update main area height */ public void updateMainHeight() { LeafElement elem = (LeafElement)getElement(); // need leaf element try { int lineDiff = (elem.getEndMark().getLine() - elem.getStartMark().getLine() + 1); mainHeight = lineDiff * getEditorUI().getLineHeight(); } catch (InvalidMarkException e) { Utilities.annotateLoggable(e); mainHeight = 0; } }
/** * Get y coordinate from position. The position can lay anywhere inside this * view. */ protected int getYFromPos(int pos) throws BadLocationException { int relLine = 0; try { relLine = ((BaseDocument) getDocument()).op.getLine(pos) - ((BaseElement) getElement()).getStartMark().getLine(); } catch (InvalidMarkException e) { if (Boolean.getBoolean("netbeans.debug.exceptions")) { // NOI18N e.printStackTrace(); } } return getStartY() + ((insets != null) ? insets.top : 0) + relLine * getEditorUI().getLineHeight(); }
private int cacheLoadLineByPos(int pos) throws BadLocationException { int markPos; int markLine; try { Mark mark = marks.getLeftMark(pos, null); markPos = mark.getOffset(); markLine = mark.getLine(); } catch (InvalidMarkException e) { return cacheLoadLineByPos(pos); // recall } beolPosFwdFinder.tgtPos = pos; markPos = cache.find(beolPosFwdFinder, markPos, -1, null); if (markPos == -1) { // correct eolPos markPos = docLen; } int bolPos = beolPosFwdFinder.bolPos; if (bolPos == -1) { // mark was on the same line with pos if (pos > 0) { bolPos = cache.find(bolBwdFinder, pos, 0, null) + 1; } else { bolPos = 0; } } int line = markLine + beolPosFwdFinder.line; lineCache[0].fill(bolPos, markPos, line); return line; }
Mark mark = marks.getMarkFromLine(line - 1); markPos = mark.getOffset(); markLine = mark.getLine(); } catch (InvalidMarkException e) { return cacheLoadLine(line); // try again
/** Get y coordinate from position. * The position can lay anywhere inside this view. */ protected int getYFromPos(int pos) throws BadLocationException { int relLine = 0; try { relLine = Utilities.getLineOffset(((BaseDocument)getDocument()), pos) - ((BaseElement)getElement()).getStartMark().getLine(); } catch (InvalidMarkException e) { Utilities.annotateLoggable(e); } return getStartY() + ((insets != null) ? insets.top : 0) + relLine * getEditorUI().getLineHeight(); }
line = ((BaseElement) getElement()).getStartMark().getLine(); } catch (InvalidMarkException e) { if (Boolean.getBoolean("netbeans.debug.exceptions")) { // NOI18N
line = ((BaseElement)getElement()).getStartMark().getLine(); } catch (InvalidMarkException e) { Utilities.annotateLoggable(e);