public class TextCaret
extends java.lang.Object
implements java.awt.event.ActionListener, java.io.Serializable
TextCaret class implements a caret showing in the
TextEditView object.TextEditView,
直列化された形式| 修飾子とタイプ | フィールドと説明 |
|---|---|
static int |
BAR_CARET
The caret style constant for the bar caret.
|
static int |
BLINK_INTERVAL
The default interval of blinking.
|
protected boolean |
caretShowing |
protected Timer |
caretTimer |
protected jp.kyasu.awt.text.TextCaret.CaretContext |
context |
static java.awt.Color |
DEFAULT_CARET_COLOR
The default caret color.
|
static int |
DEFAULT_CARET_STYLE
The default caret style.
|
static boolean |
DEFAULT_DO_BLINK
The default flag that determines to blink the caret.
|
protected static java.awt.Toolkit |
DefaultToolkit |
protected boolean |
doBlink |
static int |
HAT_CARET
The caret style constant for the hat caret.
|
protected int |
style |
protected java.awt.Component |
target |
| コンストラクタと説明 |
|---|
TextCaret()
Constructs a text caret with the default style and the default
flag determining to do blink.
|
TextCaret(boolean doBlink)
Constructs a text caret with the default style and the specified
flag determining to do blink.
|
TextCaret(int style)
Constructs a text caret with the specified style and the default
flag determining to do blink.
|
TextCaret(int style,
boolean doBlink)
Constructs a text caret with the specified style and flag determining
to do blink.
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Invoked when a timer action occurs.
|
boolean |
doBlink()
Tests if this caret does blinking.
|
int |
getStyle()
Returns the style of this caret.
|
protected java.awt.Component |
getTarget()
Returns the target component into whitch the caret shows.
|
void |
hideCaret(java.awt.Graphics g,
java.awt.Point offset,
TextPositionInfo posInfo,
java.awt.Color caretColor)
Hides this caret with the specified graphics, offset, text position,
and color.
|
boolean |
isBlinking()
Tests if this caret is blinking.
|
protected void |
safeToggleCaret()
Shows or hides this caret safely with the caret context.
|
protected void |
safeToggleCaret(java.awt.Graphics g,
java.awt.Point offset,
TextPositionInfo posInfo,
java.awt.Color caretColor)
Shows ot hides this caret safely with the specified graphics, offset,
text position, and color.
|
protected void |
setStyle(int style)
Sets the style of this caret.
|
protected void |
setTarget(java.awt.Component target)
Sets the target component into whitch the caret shows.
|
void |
showCaret(java.awt.Graphics g,
java.awt.Point offset,
TextPositionInfo posInfo,
java.awt.Color caretColor)
Shows this caret with the specified graphics, offset, text position,
and color.
|
void |
start()
Starts the blinking.
|
void |
stop()
Stops the blinking.
|
protected void |
toggleBarCaret(java.awt.Graphics g,
java.awt.Point offset,
TextPositionInfo posInfo,
java.awt.Color caretColor)
Shows ot hides this caret as a bar caret with the specified graphics,
offset, text position, and color.
|
protected void |
toggleCaret(java.awt.Graphics g,
java.awt.Point offset,
TextPositionInfo posInfo,
java.awt.Color caretColor)
Shows ot hides this caret with the specified graphics, offset, text
position, and color.
|
protected void |
toggleHatCaret(java.awt.Graphics g,
java.awt.Point offset,
TextPositionInfo posInfo,
java.awt.Color caretColor)
Shows ot hides this caret as a hat caret with the specified graphics,
offset, text position, and color.
|
protected int style
protected boolean doBlink
protected boolean caretShowing
protected Timer caretTimer
protected java.awt.Component target
protected transient jp.kyasu.awt.text.TextCaret.CaretContext context
protected static java.awt.Toolkit DefaultToolkit
public static final int BAR_CARET
public static final int HAT_CARET
public static final int DEFAULT_CARET_STYLE
public static final java.awt.Color DEFAULT_CARET_COLOR
public static final boolean DEFAULT_DO_BLINK
public static final int BLINK_INTERVAL
public TextCaret()
public TextCaret(int style)
style - the caret style.public TextCaret(boolean doBlink)
doBlink - the flag determining to do blink.public TextCaret(int style,
boolean doBlink)
style - the caret style.doBlink - the flag determining to do blink.public boolean doBlink()
public int getStyle()
protected void setStyle(int style)
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed インタフェース内 java.awt.event.ActionListenerpublic void start()
public void stop()
public boolean isBlinking()
public void showCaret(java.awt.Graphics g,
java.awt.Point offset,
TextPositionInfo posInfo,
java.awt.Color caretColor)
g - the graphics object.offset - the offset of the graphics object.posInfo - the text position to show the caret.caretColor - the caret color.public void hideCaret(java.awt.Graphics g,
java.awt.Point offset,
TextPositionInfo posInfo,
java.awt.Color caretColor)
g - the graphics object.offset - the offset of the graphics object.posInfo - the text position to hide the caret.caretColor - the caret color.protected java.awt.Component getTarget()
protected void setTarget(java.awt.Component target)
protected void safeToggleCaret()
protected void safeToggleCaret(java.awt.Graphics g,
java.awt.Point offset,
TextPositionInfo posInfo,
java.awt.Color caretColor)
protected void toggleCaret(java.awt.Graphics g,
java.awt.Point offset,
TextPositionInfo posInfo,
java.awt.Color caretColor)
protected void toggleBarCaret(java.awt.Graphics g,
java.awt.Point offset,
TextPositionInfo posInfo,
java.awt.Color caretColor)
protected void toggleHatCaret(java.awt.Graphics g,
java.awt.Point offset,
TextPositionInfo posInfo,
java.awt.Color caretColor)