|
Java Platform 1.2 Beta 4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.java.swing.text.DefaultCaret
Warning: serialized objects of this class will not be compatible with future swing releases. The current serialization support is appropriate for short term storage or RMI between Swing1.0 applications. It will not be possible to load serialized Swing1.0 objects with future releases of Swing. The JDK1.2 release of Swing will be the compatibility baseline for the serialized form of Swing objects.
Caret
Field Summary | |
protected ChangeEvent | changeEvent
The change event for the model. |
protected EventListenerList | listenerList
The event listener list. |
Constructor Summary | |
DefaultCaret()
Constructs a default caret. |
Method Summary | |
void | addChangeListener(ChangeListener l)
Adds a listener to track whenever the caret position has been changed. |
protected void | adjustVisibility(Rectangle nloc)
Scrolls the associated view (if necessary) to make the caret visible. |
protected void | damage(Rectangle r)
Damages the area surrounding the caret to cause it to be repainted. |
void | deinstall(JTextComponent c)
Called when the UI is being removed from the interface of a JTextComponent. |
protected void | fireStateChanged()
Notifies all listeners that have registered interest for notification on this event type. |
void | focusGained(FocusEvent e)
Called when the component containing the caret gains focus. |
void | focusLost(FocusEvent e)
Called when the component containing the caret loses focus. |
int | getBlinkRate()
Gets the caret blink rate. |
protected JTextComponent | getComponent()
Gets the editor component that this caret is for. |
int | getDot()
Fetches the current position of the caret. |
Point | getMagicCaretPosition()
Gets the saved caret position. |
int | getMark()
Fetches the current position of the mark. |
protected Highlighter.HighlightPainter | getSelectionPainter()
Gets the painter for the Highlighter. |
void | install(JTextComponent c)
Called when the UI is being installed into the interface of a JTextComponent. |
boolean | isSelectionVisible()
Checks whether the current selection is visible. |
boolean | isVisible()
Determines if the caret is currently visible. |
void | mouseClicked(MouseEvent e)
Called when the mouse is clicked. |
void | mouseDragged(MouseEvent e)
Moves the caret position according to the mouse pointer's current location. |
void | mouseEntered(MouseEvent e)
Called when the mouse enters a region. |
void | mouseExited(MouseEvent e)
Called when the mouse exits a region. |
void | mouseMoved(MouseEvent e)
Called when the mouse is moved. |
void | mousePressed(MouseEvent e)
Requests focus on the associated text component, and tries to set the cursor position. |
void | mouseReleased(MouseEvent e)
Called when the mouse is released. |
protected void | moveCaret(MouseEvent e)
Tries to move the position of the caret from the coordinates of a mouse event, using viewToModel(). |
void | moveDot(int dot)
Moves the caret position to some other position. |
void | paint(Graphics g)
Renders the caret as a vertical line. |
protected void | positionCaret(MouseEvent e)
Tries to set the position of the caret from the coordinates of a mouse event, using viewToModel(). |
void | removeChangeListener(ChangeListener l)
Removes a listener that was tracking caret position changes. |
void | setBlinkRate(int rate)
Sets the caret blink rate. |
void | setDot(int dot)
Sets the caret position and mark to some position. |
void | setMagicCaretPosition(Point p)
Saves the current caret position. |
void | setSelectionVisible(boolean vis)
Changes the selection visibility. |
void | setVisible(boolean e)
Sets the caret visibility, and repaints the caret. |
Methods inherited from class java.lang.Object | |
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
Field Detail |
protected EventListenerList listenerList
protected transient ChangeEvent changeEvent
Constructor Detail |
public DefaultCaret()
Method Detail |
protected final JTextComponent getComponent()
protected void damage(Rectangle r)
r
- the current location of the caretpaint(java.awt.Graphics)
protected void adjustVisibility(Rectangle nloc)
nloc
- the new position to scroll toprotected Highlighter.HighlightPainter getSelectionPainter()
protected void positionCaret(MouseEvent e)
e
- the mouse eventprotected void moveCaret(MouseEvent e)
e
- the mouse eventpublic void focusGained(FocusEvent e)
e
- the focus eventFocusListener.focusGained(java.awt.event.FocusEvent)
public void focusLost(FocusEvent e)
e
- the focus eventFocusListener.focusLost(java.awt.event.FocusEvent)
public void mouseClicked(MouseEvent e)
e
- the mouse eventMouseListener.mouseClicked(java.awt.event.MouseEvent)
public void mousePressed(MouseEvent e)
e
- the mouse eventMouseListener.mousePressed(java.awt.event.MouseEvent)
public void mouseReleased(MouseEvent e)
e
- the mouse eventMouseListener.mouseReleased(java.awt.event.MouseEvent)
public void mouseEntered(MouseEvent e)
e
- the mouse eventMouseListener.mouseEntered(java.awt.event.MouseEvent)
public void mouseExited(MouseEvent e)
e
- the mouse eventMouseListener.mouseExited(java.awt.event.MouseEvent)
public void mouseDragged(MouseEvent e)
e
- the mouse eventMouseMotionListener.mouseDragged(java.awt.event.MouseEvent)
public void mouseMoved(MouseEvent e)
e
- the mouse eventMouseMotionListener.mouseMoved(java.awt.event.MouseEvent)
public void paint(Graphics g)
g
- the graphics contextdamage(java.awt.Rectangle)
public void install(JTextComponent c)
c
- the componentCaret.install(com.sun.java.swing.text.JTextComponent)
public void deinstall(JTextComponent c)
c
- the componentCaret.deinstall(com.sun.java.swing.text.JTextComponent)
public void addChangeListener(ChangeListener l)
l
- the listenerCaret.addChangeListener(com.sun.java.swing.event.ChangeListener)
public void removeChangeListener(ChangeListener l)
l
- the listenerCaret.removeChangeListener(com.sun.java.swing.event.ChangeListener)
protected void fireStateChanged()
EventListenerList
public void setSelectionVisible(boolean vis)
vis
- the new visibilitypublic boolean isSelectionVisible()
public boolean isVisible()
Caret.isVisible()
public void setVisible(boolean e)
e
- the visibility specifierCaret.setVisible(boolean)
public void setBlinkRate(int rate)
rate
- the rate in milliseconds, 0 to stop blinkingCaret.setBlinkRate(int)
public int getBlinkRate()
Caret.getBlinkRate()
public int getDot()
Caret.getDot()
public int getMark()
Caret.getMark()
public void setDot(int dot)
dot
- the position >= 0Caret.setDot(int)
public void moveDot(int dot)
dot
- the position >= 0Caret.moveDot(int)
public void setMagicCaretPosition(Point p)
p
- the positiongetMagicCaretPosition()
,
UpAction
,
DownAction
public Point getMagicCaretPosition()
|
Java Platform 1.2 Beta 4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |