@Override public void execute(final Object arg) { rend.updateScrollbar(); // update scrollbar to display value within valid range scroll.pos(scroll.pos()); rend.repaint(); }
/** * Jumps to the current, next or previous search string. * * @param dir search direction * @param select select hit */ protected final void jump(final SearchDir dir, final boolean select) { // updates the visible area final int y = rend.jump(dir, select); final int h = getHeight(); final int p = scroll.pos(); final int m = y + rend.fontHeight() * 3 - h; if (y != -1 && (p < m || p > y)) scroll.pos(y - h / 2); rend.repaint(); }
@Override public void execute(final Object algn) { // updates the visible area final int p = scroll.pos(); final int y = rend.cursorY(); final int m = y + rend.fontHeight() * 3 - getHeight(); if (p < m || p > y) { final int align = (Integer) algn; scroll.pos(align == 0 ? y : align == 1 ? y - getHeight() / 2 : m); } rend.repaint(); }
@Override public final void mouseWheelMoved(final MouseWheelEvent e) { scroll.pos(scroll.pos() + e.getUnitsToScroll() * 20); rend.repaint(); }
/** * Selects the text at the specified position. * * @param point mouse position * @param start states if selection has just been started */ private void select(final Point point, final boolean start) { editor.select(rend.jump(point).pos(), start); rend.repaint(); }
/** Selects the whole text. */ private void selectAll() { editor.selectAll(); rend.repaint(); }
/** * Sets the error marker. * * @param pos start of optional error mark */ public final void error(final int pos) { editor.error(pos); rend.repaint(); }
/** Removes the error marker. */ public final void resetError() { editor.error(-1); rend.repaint(); }