com.sun.kjava
Class Caret

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--com.sun.kjava.Caret

public class Caret
extends java.lang.Thread

Class Caret implements a caret ("|") for use as a marker for the current insertion point in a TextField. (Caret should probably be a private class, since it has no use independent of TextField.)


Field Summary
 boolean blinking
           
 boolean stop
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Caret(int delay, int x, int y)
          Create a Caret at a position, blinking at a given rate.
 
Method Summary
 void drawCaret(int drawMode)
          Draw the Caret at its current position.
 void eraseCaret()
           
 void run()
          Run: flash the Caret at the prescribed rate.
 void setPosition(int x, int y)
          Set the Caret's position.
 
Methods inherited from class java.lang.Thread
activeCount, currentThread, getPriority, isAlive, join, setPriority, sleep, start, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

blinking

public boolean blinking

stop

public boolean stop
Constructor Detail

Caret

public Caret(int delay,
             int x,
             int y)
Create a Caret at a position, blinking at a given rate.
Parameters:
x - X coordinate of position
y - Y coordinate of position
delay - delay between blinks, in milliseconds
Method Detail

setPosition

public void setPosition(int x,
                        int y)
Set the Caret's position.
Parameters:
x - new X coordinate
y - new Y coordinate

eraseCaret

public void eraseCaret()

drawCaret

public void drawCaret(int drawMode)
Draw the Caret at its current position.
Parameters:
drawMode - mode in which to draw

run

public void run()
Run: flash the Caret at the prescribed rate.
Overrides:
run in class java.lang.Thread
Tags copied from class: java.lang.Thread
See Also:
Thread.start(), Runnable.run()