Example #1
0
 @Override
 public final void setFont(final Font f) {
   super.setFont(f);
   if (rend != null) {
     rend.setFont(f);
     rend.repaint();
   }
 }
Example #2
0
 /**
  * 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();
   }
 }
Example #3
0
 @Override
 public void run() {
   rend.calc();
   rend.repaint();
 }
Example #4
0
 @Override
 public final void mouseWheelMoved(final MouseWheelEvent e) {
   scroll.pos(scroll.pos() + e.getUnitsToScroll() * 20);
   rend.repaint();
 }
Example #5
0
 /**
  * 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();
 }
Example #6
0
 @Override
 public void actionPerformed(final ActionEvent e) {
   rend.cursor(!rend.cursor());
   rend.repaint();
 }
Example #7
0
 /** Selects the whole text. */
 final void selectAll() {
   text.selectAll();
   text.setCaret();
   rend.repaint();
 }
Example #8
0
 /**
  * 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();
 }