| 
 | org.netbeans.modules.editor.lib/1 1.14.0 3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.netbeans.editor.BaseCaret
public class BaseCaret
Caret implementation
| Field Summary | |
|---|---|
| protected  Font | afterCaretFontFont of the text underlying the caret. | 
| protected  Font | beforeCaretFontFont of the text right before the caret | 
| static String | BLOCK_CARETCaret type representing block covering current character | 
| protected  ChangeEvent | changeEventChange event. | 
| protected  JTextComponent | componentComponent this caret is bound to | 
| protected  char[] | dotCharDot array of one character under caret | 
| protected  Timer | flasherTimer used for blinking the caret | 
| static String | LINE_CARETDefault caret type | 
| protected  EventListenerList | listenerListListeners | 
| protected  Color | textBackColorBackground color of the text underlying the caret. | 
| protected  Color | textForeColorForeground color of the text underlying the caret. | 
| static String | THIN_LINE_CARETOne dot thin line compatible with Swing default caret | 
| Constructor Summary | |
|---|---|
| BaseCaret() | |
| Method Summary | |
|---|---|
|  void | actionPerformed(ActionEvent evt)Fired when blink timer fires | 
|  void | addChangeListener(ChangeListener l)Adds listener to track when caret position was changed | 
|  void | atomicLock(AtomicLockEvent evt) | 
|  void | atomicUnlock(AtomicLockEvent evt) | 
|  void | changedUpdate(DocumentEvent evt) | 
|  void | deinstall(JTextComponent c)Called when UI is being removed from JTextComponent | 
|  boolean | equals(Object o)Redefine to Object.equals() to prevent defaulting to Rectangle.equals() which would cause incorrect firing | 
| protected  void | fireStateChanged()Notifies listeners that caret position has changed | 
|  void | foldHierarchyChanged(FoldHierarchyEvent evt) | 
|  int | getBlinkRate()Returns blink rate of the caret or 0 if caret doesn't blink | 
|  int | getDot()Gets the current position of the caret | 
| protected  JComponent | getEventComponent(MouseEvent e) | 
|  Point | getMagicCaretPosition()Get position used to mark begining of the selected block | 
|  int | getMark()Gets the current position of the selection mark. | 
|  void | insertUpdate(DocumentEvent evt) | 
|  void | install(JTextComponent c)Called when UI is being installed into JTextComponent | 
| protected  boolean | isDragPossible(MouseEvent e)Determines if the following are true: the press event is located over a selection the dragEnabled property is true A TranferHandler is installed | 
|  boolean | isSelectionVisible()Is the selection visible? | 
|  boolean | isVisible()Whether the caret currently visible. | 
| protected  int | mapDragOperationFromModifiers(MouseEvent e) | 
| protected  void | modelChanged(BaseDocument oldDoc,
             BaseDocument newDoc) | 
|  void | mouseClicked(MouseEvent evt) | 
|  void | mouseDragged(MouseEvent evt) | 
|  void | mouseEntered(MouseEvent evt) | 
|  void | mouseExited(MouseEvent evt) | 
|  void | mouseMoved(MouseEvent evt) | 
|  void | mousePressed(MouseEvent evt) | 
|  void | mouseReleased(MouseEvent evt) | 
|  void | moveDot(int offset) | 
|  void | moveDot(int offset,
        Rectangle scrollRect,
        int scrollPolicy)Deprecated. use #setDot(int) preceded by JComponent.scrollRectToVisible(). | 
|  void | paint(Graphics g)Renders the caret | 
| protected  void | paintCustomCaret(Graphics g) | 
|  void | propertyChange(PropertyChangeEvent evt) | 
|  void | removeChangeListener(ChangeListener l)Removes listeners to caret position changes | 
|  void | removeUpdate(DocumentEvent evt) | 
|  void | setBlinkRate(int rate)Sets the caret blink rate. | 
|  void | setDot(int offset)Assign the caret a new offset in the underlying document. | 
|  void | setDot(int offset,
       boolean expandFold) | 
|  void | setDot(int offset,
       Rectangle scrollRect,
       int scrollPolicy)Deprecated. use #setDot(int) preceded by JComponent.scrollRectToVisible(). | 
|  void | setDot(int offset,
       Rectangle scrollRect,
       int scrollPolicy,
       boolean expandFold)Deprecated. use #setDot(int, boolean) preceded by JComponent.scrollRectToVisible(). | 
|  void | setMagicCaretPosition(Point p)Saves the current caret position. | 
|  void | setSelectionVisible(boolean v)Sets the selection visibility | 
|  void | settingsChange(SettingsChangeEvent evt)Called when settings were changed. | 
|  void | setVisible(boolean v)Sets the caret visibility | 
| protected  void | setVisibleImpl(boolean v) | 
| protected  void | update(boolean scrollViewToCaret)Update the caret's visual position. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static final String BLOCK_CARET
public static final String LINE_CARET
public static final String THIN_LINE_CARET
protected JTextComponent component
protected EventListenerList listenerList
protected Timer flasher
protected ChangeEvent changeEvent
protected char[] dotChar
protected Font afterCaretFont
protected Font beforeCaretFont
protected Color textForeColor
protected Color textBackColor
| Constructor Detail | 
|---|
public BaseCaret()
| Method Detail | 
|---|
public void settingsChange(SettingsChangeEvent evt)
settingsChange in interface SettingsChangeListenerpublic void install(JTextComponent c)
public void deinstall(JTextComponent c)
protected void modelChanged(BaseDocument oldDoc, BaseDocument newDoc)
public void paint(Graphics g)
protected void paintCustomCaret(Graphics g)
protected void update(boolean scrollViewToCaret)
scrollViewToCaret - whether the view of the text component should be
  scrolled to the position of the caret.public boolean equals(Object o)
public void addChangeListener(ChangeListener l)
addChangeListener in interface Caretpublic void removeChangeListener(ChangeListener l)
removeChangeListener in interface Caretprotected void fireStateChanged()
public final boolean isVisible()
protected void setVisibleImpl(boolean v)
public void setVisible(boolean v)
setVisible in interface Caretpublic final boolean isSelectionVisible()
isSelectionVisible in interface Caretpublic void setSelectionVisible(boolean v)
setSelectionVisible in interface Caretpublic void setMagicCaretPosition(Point p)
setMagicCaretPosition in interface Caretp - the Point to use for the saved positionpublic final Point getMagicCaretPosition()
getMagicCaretPosition in interface Caretpublic void setBlinkRate(int rate)
setBlinkRate in interface Caretrate - blink rate in milliseconds, 0 means no blinkpublic int getBlinkRate()
getBlinkRate in interface Caretpublic int getDot()
public int getMark()
public void setDot(int offset)
public void setDot(int offset,
                   boolean expandFold)
public void setDot(int offset,
                   Rectangle scrollRect,
                   int scrollPolicy,
                   boolean expandFold)
JComponent.scrollRectToVisible().
Note: This method is deprecated and the present implementation ignores values of scrollRect and scrollPolicy parameters.
offset - offset in the document to which the caret should be positioned.scrollRect - rectangle to which the editor window should be scrolled.scrollPolicy - the way how scrolling should be done.
  One of EditorUI.SCROLL_* constants.expandFold - whether possible fold at the caret position should be expanded.
public void setDot(int offset,
                   Rectangle scrollRect,
                   int scrollPolicy)
JComponent.scrollRectToVisible().
Note: This method is deprecated and the present implementation ignores values of scrollRect and scrollPolicy parameters.
offset - offset in the document to which the caret should be positioned.scrollRect - rectangle to which the editor window should be scrolled.scrollPolicy - the way how scrolling should be done.
  One of EditorUI.SCROLL_* constants.public void moveDot(int offset)
public void moveDot(int offset,
                    Rectangle scrollRect,
                    int scrollPolicy)
JComponent.scrollRectToVisible().
Note: This method is deprecated and the present implementation ignores values of scrollRect and scrollPolicy parameters.
offset - offset in the document to which the caret should be positioned.scrollRect - rectangle to which the editor window should be scrolled.scrollPolicy - the way how scrolling should be done.
  One of EditorUI.SCROLL_* constants.public void insertUpdate(DocumentEvent evt)
insertUpdate in interface DocumentListenerpublic void removeUpdate(DocumentEvent evt)
removeUpdate in interface DocumentListenerpublic void atomicLock(AtomicLockEvent evt)
atomicLock in interface AtomicLockListenerpublic void atomicUnlock(AtomicLockEvent evt)
atomicUnlock in interface AtomicLockListenerpublic void changedUpdate(DocumentEvent evt)
changedUpdate in interface DocumentListenerpublic void mouseClicked(MouseEvent evt)
mouseClicked in interface MouseListenerpublic void mousePressed(MouseEvent evt)
mousePressed in interface MouseListenerpublic void mouseReleased(MouseEvent evt)
mouseReleased in interface MouseListenerpublic void mouseEntered(MouseEvent evt)
mouseEntered in interface MouseListenerpublic void mouseExited(MouseEvent evt)
mouseExited in interface MouseListenerprotected int mapDragOperationFromModifiers(MouseEvent e)
protected boolean isDragPossible(MouseEvent e)
This is implemented to check for a TransferHandler. Subclasses should perform the remaining conditions.
protected JComponent getEventComponent(MouseEvent e)
public void mouseDragged(MouseEvent evt)
mouseDragged in interface MouseMotionListenerpublic void mouseMoved(MouseEvent evt)
mouseMoved in interface MouseMotionListenerpublic void propertyChange(PropertyChangeEvent evt)
propertyChange in interface PropertyChangeListenerpublic void actionPerformed(ActionEvent evt)
actionPerformed in interface ActionListenerpublic void foldHierarchyChanged(FoldHierarchyEvent evt)
foldHierarchyChanged in interface FoldHierarchyListener| 
 | org.netbeans.modules.editor.lib/1 1.14.0 3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||