All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.java.swing.text.JInsertPosition
java.lang.Object
|
+----java.awt.Component
|
+----com.sun.java.swing.text.JInsertPosition
- public class JInsertPosition
- extends Component
- implements InsertPosition, DocumentListener, ActionListener
An implementation of InsertPosition for a view that maps over
the entire portion of the model represented (ie there are no
holes in the area represented) and renders the insert position
as a vertical line.
The foreground color of the component is the color of the caret
and the background color of the component is the color of the
selections made by moving the caret. The Highlighter implementation
of the associated UI is used to actually render the selection.
- See Also:
- InsertPosition
-
changeEvent
-
-
changeListener
-
-
JInsertPosition(Color, Color)
- Construct a caret with given color settings.
-
actionPerformed(ActionEvent)
- Invoked when the blink timer fires
-
addChangeListener(ChangeListener)
-
-
adjustHorizontally(BoundedRangeModel, Rectangle, Rectangle)
- Scroll the associated view horizontally to make
the caret visible.
-
adjustVertically(BoundedRangeModel, Rectangle, Rectangle)
- Scroll the associated view vertically to make
the caret visible.
-
changedUpdate(DocumentEvent)
-
-
damage(Rectangle)
- Damages the area surrounding the caret to cause
it to be repainted.
-
deinstall(JTextComponent)
-
-
getActions()
-
-
getDot()
-
-
getMark()
-
-
insertUpdate(DocumentEvent)
- Update the dot and mark if they were changed by
the insertion.
-
install(JTextComponent)
-
-
isVisible()
-
-
moveDot(int)
-
-
paint(Graphics)
- Renders the caret as a vertical line.
-
removeChangeListener(ChangeListener)
-
-
removeUpdate(DocumentEvent)
- Update the dot and mark if they were changed
by the removal.
-
setBlinkRate(int)
-
-
setDot(int)
-
-
setVisible(boolean)
- If the caret is flashing, the flashing is terminated.
changeListener
protected ChangeListener changeListener
changeEvent
protected ChangeEvent changeEvent
JInsertPosition
public JInsertPosition(Color c,
Color h)
- Construct a caret with given color settings.
- Parameters:
- c - The caret color
- h - The highlight color for selections
(ie. indicating the range spaned by the dot/mark
combination).
damage
protected void damage(Rectangle r)
- Damages the area surrounding the caret to cause
it to be repainted. If paint() is reimplemented,
this method should also be reimplemented.
- Parameters:
- r - The current location of the caret.
- See Also:
- paint
adjustHorizontally
protected void adjustHorizontally(BoundedRangeModel vis,
Rectangle oloc,
Rectangle nloc)
- Scroll the associated view horizontally to make
the caret visible. Since how this should be done
is somewhat of a policy, this method can be
reimplemented to change the behavior. By default
an attempt will be made to scroll the view so the
caret is in it's previous location.
adjustVertically
protected void adjustVertically(BoundedRangeModel vis,
Rectangle oloc,
Rectangle nloc)
- Scroll the associated view vertically to make
the caret visible. Since how this should be done
is somewhat of a policy, this method can be
reimplemented to change the behavior. By default
an attempt will be made to scroll the view so the
caret is in it's previous location.
paint
public void paint(Graphics g)
- Renders the caret as a vertical line. If this is reimplemented
the damage method should also be reimplemented as it assumes the
shape of the caret is a vertical line.
- Overrides:
- paint in class Component
- See Also:
- damage
actionPerformed
public void actionPerformed(ActionEvent e)
- Invoked when the blink timer fires
insertUpdate
public void insertUpdate(DocumentEvent e)
- Update the dot and mark if they were changed by
the insertion.
- See Also:
- insertUpdate
removeUpdate
public void removeUpdate(DocumentEvent e)
- Update the dot and mark if they were changed
by the removal.
- See Also:
- removeUpdate
changedUpdate
public void changedUpdate(DocumentEvent e)
- See Also:
- changedUpdate
install
public void install(JTextComponent c)
- See Also:
- install
deinstall
public void deinstall(JTextComponent c)
- See Also:
- deinstall
addChangeListener
public void addChangeListener(ChangeListener l)
- See Also:
- addChangeListener
removeChangeListener
public void removeChangeListener(ChangeListener l)
- See Also:
- removeChangeListener
isVisible
public boolean isVisible()
- Overrides:
- isVisible in class Component
- See Also:
- isVisible
setVisible
public void setVisible(boolean e)
- If the caret is flashing, the flashing is terminated.
If the caret is not flashing, the flashing is started.
- Overrides:
- setVisible in class Component
- See Also:
- setVisible
setBlinkRate
public void setBlinkRate(int rate)
- See Also:
- setBlinkRate
getDot
public int getDot()
- See Also:
- getDot
getMark
public int getMark()
- See Also:
- getMark
setDot
public void setDot(int dot)
- See Also:
- setDot
moveDot
public void moveDot(int dot)
- See Also:
- moveDot
getActions
public Action[] getActions()
- See Also:
- getActions
All Packages Class Hierarchy This Package Previous Next Index