@Override public final void setFont(final Font f) { super.setFont(f); if (rend != null) { rend.setFont(f); rend.repaint(); } }
/** * Displays the currently edited text area. * * @param align vertical alignment */ final void showCursor(final int align) { // updates the visible area final int p = scroll.pos(); final int y = rend.cursorY(); final int m = y + rend.fontH() * 3 - getHeight(); if (p < m || p > y) { scroll.pos(align == 0 ? y : align == 1 ? y - getHeight() / 2 : m); rend.repaint(); } }
@Override public void run() { rend.calc(); rend.repaint(); }
@Override public final void mouseWheelMoved(final MouseWheelEvent e) { scroll.pos(scroll.pos() + e.getUnitsToScroll() * 20); rend.repaint(); }
/** * Handles the cursor thread; interrupts the old thread as soon as new one has been started. * * @param start start/stop flag */ final void cursor(final boolean start) { cursor.stop(); if (start) cursor.start(); rend.cursor(start); rend.repaint(); }
@Override public void actionPerformed(final ActionEvent e) { rend.cursor(!rend.cursor()); rend.repaint(); }
/** Selects the whole text. */ final void selectAll() { text.selectAll(); text.setCaret(); rend.repaint(); }
/** * Moves the error marker. {@code -1} removes the marker. * * @param s start of optional error mark */ public final void error(final int s) { text.error(s); rend.repaint(); }