public class TextComponent extends EventProxyContainer implements java.awt.event.TextListener, TextPositionListener
A TextComponent is an MVC-based component. The model of the
TextComponent is a TextEditModel object, the view of
the TextComponent is a TextEditView object, and the
controller of the TextComponent is a
TextEditController object.
The principal editing operations on a TextComponent are
the replaceRange (replaceSelection),
setRangeTextStyle (setSelectionTextStyle),
modifyRangeTextStyle (modifySelectionTextStyle),
setRangeParagraphStyle (setSelectionParagraphStyle) and
modifyRangeParagraphStyle (modifySelectionParagraphStyle)
methods:
replaceRange (replaceSelection) method replaces the
specified range (selection) of the text (model) with the specified
replacement text.
setRangeTextStyle (setSelectionTextStyle) method
sets the text style in the specified range (selection) of the text
(model) to be the specified text style.
>modifyRangeTextStyle (modifySelectionTextStyle)
method modifies the text style in the specified range (selection) of
the text (model) by using the specified TextStyleModifier
object.
setRangeParagraphStyle (setSelectionParagraphStyle)
method sets the paragraph style at the specified range (selection)
of the text (model) to be the specified paragraph style.
modifyRangeParagraphStyle
(modifySelectionParagraphStyle) method modifies the paragraph
style at the specified range (selection) of the text (model) by using
the specified ParagraphStyleModifier object.
An application should use the above editing operations and should not edit the text of the TextComponent directly.
| 修飾子とタイプ | フィールドと説明 |
|---|---|
static int |
CHAR_WRAP
The constant for the character line wrapping style.
|
protected int |
columns |
static RichTextStyle |
DEFAULT_HORIZONTAL_STYLE
The default rich text style when the horizontal scrollbar only.
|
static RichTextStyle |
DEFAULT_VERTICAL_STYLE
The default rich text style when the vertical scrollbar only.
|
protected TextEditController |
editController |
protected TextEditModel |
editModel |
protected TextEditView |
editView |
static int |
NO_WRAP
The constant for the no line wrapping style.
|
static java.awt.Color |
NOT_EDITABLE_BACKGROUND
The default background color for the not editable state.
|
static java.awt.Color |
NOT_EDITABLE_FOREGROUND
The default foreground color for the not editable state.
|
static java.awt.Color |
NOT_EDITABLE_SELECTION_BACKGROUND
The default selection background color for the not editable state.
|
static java.awt.Color |
NOT_EDITABLE_SELECTION_FOREGROUND
The default selection foreground color for the not editable state.
|
protected int |
rows |
protected java.awt.Color |
savedBackgroundColor |
protected java.awt.Color |
savedForegroundColor |
protected java.awt.Color |
savedSelectionBackgroundColor |
protected java.awt.Color |
savedSelectionForegroundColor |
static int |
SCROLLBARS_BOTH
Create and display both vertical and horizontal scrollbars.
|
static int |
SCROLLBARS_HORIZONTAL_ONLY
Create and display horizontal scrollbar only.
|
static int |
SCROLLBARS_NONE
Do not create or display any scrollbars.
|
static int |
SCROLLBARS_VERTICAL_ONLY
Create and display vertical scrollbar only.
|
protected java.awt.event.TextListener |
textListener |
protected static java.lang.String |
textListenerK
Internal constant for serialization
|
protected java.util.Vector |
textPositionListeners |
static int |
WORD_WRAP
The constant for the word line wrapping style.
|
focusTraversable| 修飾子 | コンストラクタと説明 |
|---|---|
protected |
TextComponent()
Constructs a text component.
|
|
TextComponent(RichText richText)
Constructs a new text component with the specified rich text.
|
|
TextComponent(RichText richText,
int scrollbars)
Constructs a new text component with the specified rich text and
scroll bar visibility.
|
|
TextComponent(java.lang.String string)
Constructs a new text component with the specified string.
|
|
TextComponent(java.lang.String string,
int scrollbars)
Constructs a new text component with the specified string and scroll
bar visibility.
|
|
TextComponent(java.lang.String string,
int scrollbars,
RichTextStyle rtStyle)
Constructs a new text component with the specified string, scroll bar
visibility, and rich text style.
|
|
TextComponent(TextEditModel textEditModel)
Constructs a new text component with the specified model.
|
|
TextComponent(TextEditModel textEditModel,
int scrollbars)
Constructs a new text component with the specified model and scroll
bar visibility.
|
|
TextComponent(TextEditModel textEditModel,
int scrollbars,
VBorder border)
Constructs a new text component with the specified model, scroll bar
visibility, and border visual.
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
void |
addKeyAction(KeyAction keyAction)
Adds the key action to the key binding of this text component.
|
void |
addTextListener(java.awt.event.TextListener l)
Adds the specified text event listener to recieve text events from
this text component.
|
void |
addTextPositionListener(TextPositionListener l)
Adds the specified text position event listener to recieve text
position events from this text component.
|
void |
append(java.lang.String str)
Appends the given string to the text component's current text.
|
void |
append(Text text)
Appends the given text to the current text.
|
void |
append(Text text,
boolean scroll)
Appends the given text to the current text.
|
void |
appendText(java.lang.String str)
非推奨です。
As of JDK version 1.1,
replaced by
append(String). |
void |
backward_character()
Moves the insertion cursor one character to the left.
|
void |
backward_word()
Moves the insertion cursor to the first non-whitespace character
after the first whitespace character to the left or the beginning of
the line.
|
void |
beep()
Causes the terminal to beep.
|
void |
beginning_of_file()
Moves the insertion cursor to the beginning of the text.
|
void |
beginning_of_line()
Moves the insertion cursor to the beginning of the line.
|
void |
clearSoftTab()
Disables soft tab.
|
void |
clearUndo()
Clears the undo of the last change.
|
void |
copy_clipboard()
Copies the current selection to the clipboard.
|
protected java.awt.Component |
createTextComponent(TextEditModel textEditModel,
int scrollbars) |
protected java.awt.Component |
createTextComponent(TextEditModel textEditModel,
int scrollbars,
VBorder border) |
void |
cut_clipboard()
Cuts the current selection to the clipboard.
|
void |
delete_next_character()
If the cursor is inside the selection, deletes the entire selection;
otherwise, deletes the character following the insert cursor.
|
void |
delete_next_word()
If the cursor is inside the selection, deletes the entire selection;
otherwise, deletes the characters following the insertion cursor to
the next space, tab or end of line character.
|
void |
delete_previous_character()
If the cursor is inside the selection, deletes the entire selection;
otherwise, deletes the character of text immediately preceding the
insertion cursor.
|
void |
delete_previous_word()
If the cursor is inside the selection, deletes the entire selection;
otherwise, deletes the characters preceding the insertion cursor to
the previous space, tab or beginning of line character.
|
void |
delete_selection()
Deletes the current selection.
|
void |
delete_to_end_of_line()
Deletes the characters following the insertion cursor to the next
end of line character.
|
void |
delete_to_start_of_line()
Deletes the characters preceding the insertion cursor to the previous
beginning of line character.
|
void |
deselect_all()
Deselects the current selection.
|
void |
end_of_file()
Moves the insertion cursor to the end of the text.
|
void |
end_of_line()
Moves the insertion cursor to the end of the line.
|
void |
find_word()
Finds the word and move the insertion cursor to the founded word.
|
void |
forward_character()
Moves the insertion cursor one character to the right.
|
void |
forward_word()
Moves the insertion cursor to the first whitespace character or
end of line following the next non-whitespace character.
|
java.awt.Color |
getCaretColor()
Returns the caret color.
|
int |
getCaretPosition()
Returns the position of the text insertion caret for this text component.
|
int |
getColumns()
Returns the number of columns in this text component.
|
TextEditController |
getController()
Returns the controller of this text component.
|
TextStyle |
getCurrentTextStyle()
Returns the current text style of this text component.
|
java.awt.Menu |
getEditMenu()
Returns the edit menu of this text component.
|
protected java.awt.Component |
getEventSource()
Gets the event source component.
|
KeyAction |
getKeyAction(java.lang.String actionName)
Returns the key action object associated with the specified name.
|
KeyBinding |
getKeyBinding()
Returns the key binding of this text component.
|
Keymap |
getKeymap()
Returns the keymap of this text component.
|
int |
getLineWrap()
Returns the line wrapping style.
|
java.awt.Point |
getLocationOfText()
Returns the location of the text of this text component.
|
java.awt.Dimension |
getMinimumSize()
Returns the minimum size of this text component.
|
java.awt.Dimension |
getMinimumSize(int rows,
int columns)
Returns the minimum size of a text component with the specified
number of rows and columns.
|
TextEditModel |
getModel()
Returns the model of this text component.
|
ParagraphStyle |
getParagraphStyleAt(int index)
Returns the paragraph style at the specified index in this text
component.
|
int |
getParagraphStyleCount()
Returns the number of the paragraph styles in the text of this text
component.
|
ParagraphStyle[] |
getParagraphStyles()
Returns all paragraph styles in the text of this text component.
|
ParagraphStyle[] |
getParagraphStyles(int begin,
int end)
Returns the paragraph styles in the text of this text component.
|
java.awt.PopupMenu |
getPopupMenu()
Returns the popup menu of this text component.
|
java.awt.Dimension |
getPreferredSize()
Returns the preferred size of this text component.
|
java.awt.Dimension |
getPreferredSize(int rows,
int columns)
Determines the preferred size of a text component with the specified
number of rows and columns.
|
RichText |
getRichText()
Returns the rich text of this text component.
|
int |
getRows()
Returns the number of rows in the text component.
|
int |
getScrollbarThickness()
Returns the thickness of the scroll bar.
|
int |
getScrollbarVisibility()
Returns an enumerated value that indicates which scroll bars
the text component uses.
|
java.lang.String |
getSelectedText()
Returns the selected string from the string that is presented by
this text component.
|
Text |
getSelectedTEXT()
Returns the selected text from this text component.
|
java.awt.Color |
getSelectionBackground()
Returns the selection background color.
|
int |
getSelectionEnd()
Returns the end position of the selected text in this text component.
|
java.awt.Color |
getSelectionForeground()
Returns the selection foreground color.
|
int |
getSelectionStart()
Returns the start position of the selected text in this text component.
|
int |
getSoftTab()
Returns the length of soft tab.
|
java.lang.String |
getText()
Returns the string that is presented by this text component.
|
Text |
getTEXT()
Returns the text of this text component.
|
java.lang.String |
getText(java.lang.String separator)
Returns the string that is presented by this text component.
|
TextCaret |
getTextCaret()
Returns the text caret of this text component.
|
TextStyle |
getTextStyleAt(int index)
Returns the text style at the specified index in this text component.
|
int |
getTextStyleCount()
Returns the number of the text styles in the text of this text component.
|
TextStyle[] |
getTextStyles()
Returns all text styles in the text of this text component.
|
TextStyle[] |
getTextStyles(int begin,
int end)
Returns the text styles in the text of this text component.
|
TextEditView |
getView()
Returns the view of this text component.
|
void |
goto_line()
Go to line.
|
void |
insert_character(char c)
If the cursor is inside the selection, deletes the entire selection.
|
void |
insert_string(java.lang.String str)
If the cursor is inside the selection, deletes the entire selection.
|
void |
insert(java.lang.String str,
int pos)
Inserts the specified string at the specified position in this
text component.
|
void |
insert(Text text,
int pos)
Inserts the specified text at the specified position in this text
component.
|
void |
insert(Text text,
int pos,
boolean scroll)
Inserts the specified text at the specified position in this text
component.
|
void |
insertText(java.lang.String str,
int pos)
非推奨です。
As of JDK version 1.1,
replaced by
insert(String, int). |
boolean |
isAutoIndentEnabled()
Checks if the auto indent is enabled.
|
boolean |
isClickable()
Tests if this text component handles
ClickableTextAction. |
boolean |
isClickToFocus()
Tests if the text component requests the focus when the mouse is clicked.
|
boolean |
isEditable()
Indicates whether or not this text component is editable.
|
boolean |
isMouseFocus()
Tests if the text component requests the focus when the mouse enters
the component.
|
boolean |
isShowMatchEnabled()
Checks if the show match is enabled.
|
boolean |
isSoftTab()
Checks if this text component allows soft tab.
|
void |
kill_next_character()
If the cursor is inside the selection, deletes the entire selection.
|
void |
kill_next_word()
If the cursor is inside the selection, deletes the entire selection.
|
void |
kill_previous_character()
If the cursor is inside the selection, deletes the entire selection.
|
void |
kill_previous_word()
If the cursor is inside the selection, deletes the entire selection.
|
void |
kill_selection()
Kills the currently selected text and stores the text in the cut buffer.
|
void |
kill_to_end_of_line()
Kills the characters following the insertion cursor to the next end
of line character and stores the characters in the cut buffer.
|
void |
kill_to_start_of_line()
Kills the characters preceding the insertion cursor to the next
beginning of line character and stores the characters in the cut buffer.
|
java.awt.Dimension |
minimumSize(int rows,
int columns)
非推奨です。
As of JDK version 1.1,
replaced by
getMinimumSize(int, int). |
void |
modifyRangeParagraphStyle(ParagraphStyleModifier modifier,
int start,
int end)
Modifies the paragraph style between the indicated start and end
positions by the specified paragraph style modifier.
|
void |
modifyRangeParagraphStyle(ParagraphStyleModifier modifier,
int start,
int end,
boolean scroll)
Modifies the paragraph style between the indicated start and end
positions by the specified paragraph style modifier.
|
void |
modifyRangeTextStyle(TextStyleModifier modifier,
int start,
int end)
Modifies the text style between the indicated start and end positions
by the specified text style modifier.
|
void |
modifyRangeTextStyle(TextStyleModifier modifier,
int start,
int end,
boolean scroll)
Modifies the text style between the indicated start and end positions
by the specified text style modifier.
|
void |
modifySelectionParagraphStyle(ParagraphStyleModifier modifier)
Modifies the paragraph style in the range of the current selection by
the specified paragraph style modifier.
|
void |
modifySelectionParagraphStyle(ParagraphStyleModifier modifier,
boolean scroll)
Modifies the paragraph style in the range of the current selection by
the specified paragraph style modifier.
|
void |
modifySelectionTextStyle(TextStyleModifier modifier)
Modifies the text style in the range of the current selection by the
specified text style modifier.
|
void |
modifySelectionTextStyle(TextStyleModifier modifier,
boolean scroll)
Modifies the text style in the range of the current selection by the
specified text style modifier.
|
void |
newbreak()
If the cursor is inside the selection, deletes the entire selection.
|
void |
newline_and_indent()
If the cursor is inside the selection, deletes the entire selection.
|
void |
newline()
If the cursor is inside the selection, deletes the entire selection.
|
void |
next_line()
Moves the insertion cursor to the next line.
|
void |
next_page()
Moves the insertion cursor forward one page.
|
java.util.Enumeration |
paragraphStyles()
Returns an enumeration of the paragraph styles of the text of this
text component.
|
java.util.Enumeration |
paragraphStyles(int begin,
int end)
Returns an enumeration of the paragraph styles of the text of this
text component.
|
void |
paste_clipboard()
Pastes the the clipboard before the insertion cursor.
|
void |
performKeyAction(java.lang.String actionName)
Performs the key action named the specified name.
|
void |
performKeyAction(java.lang.String actionName,
char keyChar)
Performs the key action named the specified name.
|
java.awt.Dimension |
preferredSize(int rows,
int columns)
非推奨です。
As of JDK version 1.1,
replaced by
getPreferredSize(int, int). |
void |
previous_line()
Moves the insertion cursor to the previous line.
|
void |
previous_page()
Moves the insertion cursor back one page.
|
void |
print(boolean printPageNum)
Prints the text of this text component with the specified flag
determining to print a page number in footer.
|
void |
print(java.awt.Insets insets,
java.lang.String header,
boolean printPageNum)
Prints the text of this text component with the specified insets,
header string, and flag determining to print a page number in footer.
|
void |
print(java.awt.PrintJob job,
java.awt.Insets insets,
java.lang.String header,
boolean printPageNum)
Prints the text of this text component to a print device provided from
the specified print job, with the specified insets, header string, and
flag determining to print a page number in footer.
|
void |
print(java.awt.PrintJob job,
java.lang.String header,
boolean printPageNum)
Prints the text of this text component to a print device provided from
the specified print job, with the specified header string and flag
determining to print a page number in footer.
|
void |
print(java.lang.String header,
boolean printPageNum)
Prints the text of this text component with the specified header
string and flag determining to print a page number in footer.
|
protected void |
processEvent(java.awt.AWTEvent e) |
void |
redraw_display()
Redraw the display.
|
void |
removeKeyAction(KeyAction keyAction)
Removes the key action from the key binding of this text component.
|
void |
removeKeyActionNamed(java.lang.String actionName)
Removes the key action named the specified name from the key binding
of this text component.
|
void |
removeTextListener(java.awt.event.TextListener l)
Removes the specified text event listener so that it no longer
receives text events from this textcomponent
|
void |
removeTextPositionListener(TextPositionListener l)
Removes the specified text position event listener so that it no
longer receives text position events from this text component
|
void |
replaceRange(java.lang.String str,
int start,
int end)
Replaces text between the indicated start and end positions
with the specified replacement text.
|
void |
replaceRange(Text text,
int start,
int end)
Replaces text between the indicated start and end positions
with the specified replacement text.
|
void |
replaceRange(Text text,
int start,
int end,
boolean scroll)
Replaces text between the indicated start and end positions
with the specified replacement text.
|
void |
replaceSelection(java.lang.String str)
Replaces string in the range of the current selection with the
specified replacement string.
|
void |
replaceSelection(Text text)
Replaces text in the range of the current selection with the
specified replacement text.
|
void |
replaceSelection(Text text,
boolean scroll)
Replaces text in the range of the current selection with the
specified replacement text.
|
void |
replaceText(java.lang.String str,
int start,
int end)
非推奨です。
As of JDK version 1.1,
replaced by
replaceRange(String, int, int). |
void |
select_all()
Select all text.
|
void |
select_line()
Select a line at the selection start position.
|
void |
select_word()
Select a word at the selection start position.
|
void |
select(int selectionStart,
int selectionEnd)
Selects the text between the specified start and end positions.
|
void |
select(int selectionStart,
int selectionEnd,
boolean scroll)
Selects the text between the specified start and end positions.
|
void |
select(int selectionStart,
int selectionEnd,
boolean scroll,
boolean top)
Selects the text between the specified start and end positions.
|
void |
selectAll()
Selects all the text in this text component.
|
boolean |
selectionIsCaret()
Tests if the selection is caret, i.e., null selection.
|
void |
setAutoIndentEnabled(boolean autoIndent)
Enables the auto indent.
|
void |
setBackground(java.awt.Color c)
Sets the background color of this text component.
|
void |
setCaretColor(java.awt.Color c)
Sets the caret color.
|
void |
setCaretPosition(int position)
Sets the position of the text insertion caret for this text component.
|
void |
setCaretPosition(int position,
boolean top)
Sets the position of the text insertion caret.
|
void |
setClickable(boolean b)
Makes this text component handle
ClickableTextAction. |
void |
setClickToFocus()
Makes the text component request the focus when the mouse is clicked.
|
void |
setColumns(int columns)
Sets the number of columns for this text component.
|
void |
setCursor(java.awt.Cursor c)
Sets the cursor of this text component.
|
void |
setEditable(boolean b)
Sets the flag that determines whether or not this text component is
editable.
|
void |
setEditable(boolean b,
boolean changeColor)
Sets the flag that determines whether or not this text component is
editable.
|
void |
setEnabled(boolean b)
Enables or disables this text component.
|
void |
setFont(java.awt.Font font)
Sets the font of this text component.
|
void |
setForeground(java.awt.Color c)
Sets the foreground color of this text component.
|
void |
setKeymap(Keymap keymap)
Sets the keymap of this text component.
|
void |
setLineWrap(int lineWrap)
Sets the line wrapping style.
|
void |
setLocationOfText(java.awt.Point p)
Sets the location of the text of this text component.
|
void |
setMouseFocus()
Makes the text component request the focus when the mouse enters the
component.
|
void |
setPopupMenu(java.awt.PopupMenu menu)
Sets the popup menu of this text component.
|
void |
setRangeParagraphStyle(ParagraphStyle style,
int start,
int end)
Sets the paragraph style between the indicated start and end positions
to the specified paragraph style.
|
void |
setRangeParagraphStyle(ParagraphStyle style,
int start,
int end,
boolean scroll)
Sets the paragraph style between the indicated start and end positions
to the specified paragraph style.
|
void |
setRangeTextStyle(TextStyle style,
int start,
int end)
Sets the text style between the indicated start and end positions
to the specified text style.
|
void |
setRangeTextStyle(TextStyle style,
int start,
int end,
boolean scroll)
Sets the text style between the indicated start and end positions
to the specified text style.
|
void |
setRichText(RichText richText)
Sets the rich text of this text component.
|
void |
setRows(int rows)
Sets the number of rows for this text component.
|
void |
setScrollbarThickness(int thickness)
Sets the thickness of the scroll bar.
|
void |
setSelectionBackground(java.awt.Color c)
Sets the selection background color.
|
void |
setSelectionEnd(int selectionEnd)
Sets the selection end for this text component to the specified position.
|
void |
setSelectionForeground(java.awt.Color c)
Sets the selection foreground color.
|
void |
setSelectionParagraphStyle(ParagraphStyle style)
Sets the paragraph style in the range of the current selection to the
specified paragraph style.
|
void |
setSelectionParagraphStyle(ParagraphStyle style,
boolean scroll)
Sets the paragraph style in the range of the current selection to the
specified paragraph style.
|
void |
setSelectionStart(int selectionStart)
Sets the selection start for this text component to the specified
position.
|
void |
setSelectionTextStyle(TextStyle style)
Sets the text style in the range of the current selection to the
specified text style.
|
void |
setSelectionTextStyle(TextStyle style,
boolean scroll)
Sets the text style in the range of the current selection to the
specified text style.
|
void |
setShowMatchEnabled(boolean showMatch)
Enables the show match.
|
void |
setSoftTab(int i)
Sets the length of soft tab.
|
void |
setText(java.lang.String str)
Sets the string that is presented by this text component to be the
specified string.
|
void |
setTEXT(Text text)
Sets the text of this text component.
|
void |
setTextCaret(TextCaret textCaret)
Sets the text caret of this text component.
|
void |
tab()
If the cursor is inside the selection, deletes the entire selection.
|
void |
textPositionChanged(TextPositionEvent te)
Invoked when the position of the text has changed.
|
java.util.Enumeration |
textStyles()
Returns an enumeration of the text styles of the text of this text
component.
|
java.util.Enumeration |
textStyles(int begin,
int end)
Returns an enumeration of the text styles of the text of this text
component.
|
void |
textValueChanged(java.awt.event.TextEvent e)
Invoked when the value of the text has changed.
|
void |
undo()
Undo the last change.
|
void |
unkill()
Restores last killed text to the position of the insertion cursor.
|
addFocusListener, addKeyListener, addMouseListener, addMouseMotionListener, delegateFocusEvent, delegateKeyEvent, delegateMouseEvent, focusGained, focusLost, getToolTipText, getToolTipVisual, keyPressed, keyReleased, keyTyped, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, setToolTipText, setToolTipText, setToolTipVisualaddNotify, bounds, disable, doLayout, enable, enable, getBounds, getFrame, getInsets, getLocation, getSize, hide, insets, isDirectNotification, isFocusTraversable, layout, location, minimumSize, postOldEvent, preferredSize, repaintNow, requestFocus, reshape, setBounds, setFocusTraversable, setVisible, show, show, size, updateadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getListeners, getMaximumSize, getMousePosition, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, isValidateRoot, list, list, locate, paint, paintComponents, paramString, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addMouseWheelListener, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setBounds, setComponentOrientation, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, toString, transferFocus, transferFocusBackward, transferFocusUpCycleprotected TextEditModel editModel
protected TextEditView editView
protected TextEditController editController
protected int rows
protected int columns
protected transient java.awt.event.TextListener textListener
protected transient java.util.Vector textPositionListeners
protected java.awt.Color savedForegroundColor
protected java.awt.Color savedBackgroundColor
protected java.awt.Color savedSelectionForegroundColor
protected java.awt.Color savedSelectionBackgroundColor
public static final int SCROLLBARS_BOTH
public static final int SCROLLBARS_VERTICAL_ONLY
public static final int SCROLLBARS_HORIZONTAL_ONLY
public static final int SCROLLBARS_NONE
public static final int CHAR_WRAP
public static final int WORD_WRAP
public static final int NO_WRAP
public static final java.awt.Color NOT_EDITABLE_FOREGROUND
public static final java.awt.Color NOT_EDITABLE_BACKGROUND
public static final java.awt.Color NOT_EDITABLE_SELECTION_FOREGROUND
public static final java.awt.Color NOT_EDITABLE_SELECTION_BACKGROUND
public static final RichTextStyle DEFAULT_VERTICAL_STYLE
public static final RichTextStyle DEFAULT_HORIZONTAL_STYLE
protected static final java.lang.String textListenerK
public TextComponent(java.lang.String string)
string - the initial string that the component presents.public TextComponent(java.lang.String string,
int scrollbars)
string - the initial string that the component presents.scrollbars - a constant that determines what scrollbars are
created to view the text component.public TextComponent(java.lang.String string,
int scrollbars,
RichTextStyle rtStyle)
string - the initial string that the component presents.scrollbars - a constant that determines what scrollbars are
created to view the text component.rtStyle - the rich text style.public TextComponent(RichText richText)
richText - the initial rich text that the component presents.public TextComponent(RichText richText, int scrollbars)
richText - the initial rich text that the component presents.scrollbars - a constant that determines what scrollbars are
created to view the text component.public TextComponent(TextEditModel textEditModel)
textEditModel - the initial model of the MVC component.public TextComponent(TextEditModel textEditModel, int scrollbars)
textEditModel - the initial model of the MVC component.scrollbars - a constant that determines what scrollbars are
created to view the text component.public TextComponent(TextEditModel textEditModel, int scrollbars, VBorder border)
textEditModel - the initial model of the MVC component.scrollbars - a constant that determines what scrollbars are
created to view the text component.border - the border visual of the text component.protected TextComponent()
protected java.awt.Component createTextComponent(TextEditModel textEditModel, int scrollbars)
protected java.awt.Component createTextComponent(TextEditModel textEditModel, int scrollbars, VBorder border)
protected java.awt.Component getEventSource()
getEventSource クラス内 EventProxyContainerpublic void addTextListener(java.awt.event.TextListener l)
l - the text event listener.public void removeTextListener(java.awt.event.TextListener l)
l - the text event listener.public void textValueChanged(java.awt.event.TextEvent e)
textValueChanged インタフェース内 java.awt.event.TextListenerTextListenerpublic void addTextPositionListener(TextPositionListener l)
l - the text position event listener.public void removeTextPositionListener(TextPositionListener l)
l - the text position event listener.public void textPositionChanged(TextPositionEvent te)
textPositionChanged インタフェース内 TextPositionListenerjava.awt.event.TextPositionListenerprotected void processEvent(java.awt.AWTEvent e)
processEvent クラス内 java.awt.Containerpublic void setForeground(java.awt.Color c)
setForeground クラス内 java.awt.Componentpublic void setBackground(java.awt.Color c)
setBackground クラス内 java.awt.Componentpublic void setFont(java.awt.Font font)
setFont クラス内 java.awt.Containerpublic void setCursor(java.awt.Cursor c)
setCursor クラス内 java.awt.Componentpublic void setEnabled(boolean b)
setEnabled クラス内 KContainerpublic void setText(java.lang.String str)
str - the new string.getText()public java.lang.String getText()
public java.lang.String getText(java.lang.String separator)
separator - the preferred line separator string.setText(java.lang.String),
getText()public java.lang.String getSelectedText()
select(int, int)public boolean isEditable()
true if this text component is editable;
false otherwise.setEditable(boolean)public void setEditable(boolean b)
b - a flag indicating whether this text component should be user
editable.isEditable(),
setEditable(boolean, boolean)public int getSelectionStart()
setSelectionStart(int),
getSelectionEnd()public void setSelectionStart(int selectionStart)
selectionStart - the start position of the selected text.getSelectionStart(),
setSelectionEnd(int)public int getSelectionEnd()
setSelectionEnd(int),
getSelectionStart()public void setSelectionEnd(int selectionEnd)
selectionEnd - the end position of the selected text.getSelectionEnd(),
setSelectionStart(int)public void select(int selectionStart,
int selectionEnd)
selectionStart - the start position of the text to select.selectionEnd - the end position of the text to select.setSelectionStart(int),
setSelectionEnd(int),
selectAll()public void selectAll()
select(int, int)public void setCaretPosition(int position)
position - the position of the text insertion caret.getCaretPosition()public int getCaretPosition()
setCaretPosition(int)public boolean selectionIsCaret()
public void insert(java.lang.String str,
int pos)
str - the string to insert.pos - the position at which to insert.setText(java.lang.String),
replaceRange(java.lang.String, int, int),
append(java.lang.String)public void insertText(java.lang.String str,
int pos)
insert(String, int).public void append(java.lang.String str)
str - the text to append.insert(java.lang.String, int)public void appendText(java.lang.String str)
append(String).public void replaceRange(java.lang.String str,
int start,
int end)
str - the string to use as the replacement.start - the start position.end - the end position.insert(java.lang.String, int)public void replaceText(java.lang.String str,
int start,
int end)
replaceRange(String, int, int).public int getRows()
setRows(int),
getColumns()public void setRows(int rows)
rows - the number of rows.getRows(),
setColumns(int)public int getColumns()
setColumns(int),
getRows()public void setColumns(int columns)
columns - the number of columns.getColumns(),
setRows(int)public int getScrollbarVisibility()
SCROLLBARS_BOTH,
SCROLLBARS_VERTICAL_ONLY,
SCROLLBARS_HORIZONTAL_ONLY,
SCROLLBARS_NONEpublic java.awt.Dimension getPreferredSize(int rows,
int columns)
rows - the number of rows.columns - the number of columns.public java.awt.Dimension preferredSize(int rows,
int columns)
getPreferredSize(int, int).public java.awt.Dimension getPreferredSize()
getPreferredSize クラス内 KContainerpublic java.awt.Dimension getMinimumSize(int rows,
int columns)
rows - the number of rows.columns - the number of columns.public java.awt.Dimension minimumSize(int rows,
int columns)
getMinimumSize(int, int).public java.awt.Dimension getMinimumSize()
getMinimumSize クラス内 KContainerpublic TextEditModel getModel()
public TextEditView getView()
public TextEditController getController()
public RichText getRichText()
public void setRichText(RichText richText)
public int getLineWrap()
setLineWrap(int),
CHAR_WRAP,
WORD_WRAP,
NO_WRAPpublic void setLineWrap(int lineWrap)
lineWrap - the line wrapping style.getLineWrap(),
CHAR_WRAP,
WORD_WRAP,
NO_WRAPpublic java.awt.Point getLocationOfText()
public void setLocationOfText(java.awt.Point p)
getLocationOfText()public java.awt.Color getSelectionForeground()
public void setSelectionForeground(java.awt.Color c)
getSelectionForeground()public java.awt.Color getSelectionBackground()
public void setSelectionBackground(java.awt.Color c)
getSelectionBackground()public java.awt.Color getCaretColor()
public void setCaretColor(java.awt.Color c)
getCaretColor()public TextCaret getTextCaret()
#setCaretColor(jp.kyasu.awt.text.TextCaret)public void setTextCaret(TextCaret textCaret)
getTextCaret()public java.awt.Menu getEditMenu()
public java.awt.PopupMenu getPopupMenu()
public void setPopupMenu(java.awt.PopupMenu menu)
getPopupMenu()public void setEditable(boolean b,
boolean changeColor)
b - a flag indicating whether this text component should be user
editable.changeColor - if true, change the color of the text component
according to the editable state.isEditable(),
setEditable(boolean)public boolean isClickToFocus()
true if the text component requests the focus when
the mouse is clicked, false if the text component
requests the focus when the mouse enters the view.isMouseFocus()public boolean isMouseFocus()
isClickToFocus()public void setClickToFocus()
isClickToFocus(),
setMouseFocus()public void setMouseFocus()
isMouseFocus(),
setClickToFocus()public Keymap getKeymap()
public void setKeymap(Keymap keymap)
getKeymap()public KeyBinding getKeyBinding()
public KeyAction getKeyAction(java.lang.String actionName)
actionName - the name of the key action.null if no associated
action exists.addKeyAction(jp.kyasu.awt.text.KeyAction),
removeKeyAction(jp.kyasu.awt.text.KeyAction),
removeKeyActionNamed(java.lang.String)public void addKeyAction(KeyAction keyAction)
keyAction - the key action object.getKeyAction(java.lang.String),
removeKeyAction(jp.kyasu.awt.text.KeyAction),
removeKeyActionNamed(java.lang.String)public void removeKeyAction(KeyAction keyAction)
keyAction - the key action object.getKeyAction(java.lang.String),
addKeyAction(jp.kyasu.awt.text.KeyAction),
removeKeyActionNamed(java.lang.String)public void removeKeyActionNamed(java.lang.String actionName)
actionName - the name of the key action.getKeyAction(java.lang.String),
addKeyAction(jp.kyasu.awt.text.KeyAction),
removeKeyAction(jp.kyasu.awt.text.KeyAction)public void performKeyAction(java.lang.String actionName)
actionName - the name of the key action.performKeyAction(java.lang.String, char)public void performKeyAction(java.lang.String actionName,
char keyChar)
actionName - the name of the key action.keyChar - the key character for the key action.performKeyAction(java.lang.String)public boolean isClickable()
ClickableTextAction.public void setClickable(boolean b)
ClickableTextAction.isClickable(),
ClickableTextActionpublic boolean isSoftTab()
public int getSoftTab()
setSoftTab(int),
isSoftTab(),
clearSoftTab()public void setSoftTab(int i)
i - the length of soft tab. if the length is less than 0, disables
soft tab.getSoftTab(),
isSoftTab(),
clearSoftTab()public void clearSoftTab()
isSoftTab(),
getSoftTab(),
setSoftTab(int)public TextStyle getCurrentTextStyle()
public TextStyle getTextStyleAt(int index)
null
if the index is out of range.public int getTextStyleCount()
public TextStyle[] getTextStyles()
public TextStyle[] getTextStyles(int begin, int end)
begin - the beginning index to get text styles, inclusive.end - the ending index to get text styles, exclusive.public java.util.Enumeration textStyles()
public java.util.Enumeration textStyles(int begin,
int end)
begin - the beginning index to get styles, inclusive.end - the ending index to get styles, exclusive.public ParagraphStyle getParagraphStyleAt(int index)
null
if the index is out of range.public int getParagraphStyleCount()
public ParagraphStyle[] getParagraphStyles()
public ParagraphStyle[] getParagraphStyles(int begin, int end)
begin - the beginning index of the text to get paragraph styles,
inclusive.end - the ending index of the text to get paragraph styles,
exclusive.public java.util.Enumeration paragraphStyles()
public java.util.Enumeration paragraphStyles(int begin,
int end)
begin - the beginning index to get styles, inclusive.end - the ending index to get styles, exclusive.public Text getTEXT()
public Text getSelectedTEXT()
public void select(int selectionStart,
int selectionEnd,
boolean scroll)
selectionStart - the start position of the text to select.selectionEnd - the end position of the text to select.scroll - if true, scrolls the view after selection done.select(int, int, boolean, boolean)public void select(int selectionStart,
int selectionEnd,
boolean scroll,
boolean top)
selectionStart - the start position of the text to select.selectionEnd - the end position of the text to select.scroll - if true, scrolls the view after selection done.top - if true, scrolls to the top of the view.select(int, int),
select(int, int, boolean)public void setCaretPosition(int position,
boolean top)
position - the position of the caret.top - if true, scrolls to the top of the view.setCaretPosition(int)public void insert(Text text, int pos)
text - the text to insert.pos - the position at which to insert.insert(jp.kyasu.graphics.Text, int, boolean)public void insert(Text text, int pos, boolean scroll)
text - the text to insert.pos - the position at which to insert.scroll - if true, scrolls the view after the insertion.insert(jp.kyasu.graphics.Text, int),
replaceRange(jp.kyasu.graphics.Text, int, int, boolean)public void append(Text text)
text - the text to append.append(jp.kyasu.graphics.Text, boolean)public void append(Text text, boolean scroll)
text - the text to append.scroll - if true, scrolls the view after the appending.insert(jp.kyasu.graphics.Text, int, boolean)public void replaceRange(Text text, int start, int end)
text - the text to use as the replacement.start - the start position, inclusive.end - the end position, exclusive.replaceRange(jp.kyasu.graphics.Text, int, int, boolean)public void replaceRange(Text text, int start, int end, boolean scroll)
text - the text to use as the replacement.start - the start position, inclusive.end - the end position, exclusive.scroll - if true, scrolls the view after replace done.replaceRange(java.lang.String, int, int),
replaceRange(jp.kyasu.graphics.Text, int, int),
replaceSelection(jp.kyasu.graphics.Text, boolean)public void replaceSelection(java.lang.String str)
str - the string to use as the replacement.replaceSelection(jp.kyasu.graphics.Text)public void replaceSelection(Text text)
text - the text to use as the replacement.replaceSelection(jp.kyasu.graphics.Text, boolean)public void replaceSelection(Text text, boolean scroll)
text - the text to use as the replacement.scroll - if true, scrolls the view after replace done.replaceSelection(java.lang.String),
replaceSelection(jp.kyasu.graphics.Text),
replaceRange(jp.kyasu.graphics.Text, int, int, boolean)public void setRangeTextStyle(TextStyle style, int start, int end)
style - the text style to be set.start - the start position, inclusive.end - the end position, exclusive.setRangeTextStyle(jp.kyasu.graphics.TextStyle, int, int, boolean)public void setRangeTextStyle(TextStyle style, int start, int end, boolean scroll)
style - the text style to be set.start - the start position, inclusive.end - the end position, exclusive.scroll - if true, scrolls the view after set done.setRangeTextStyle(jp.kyasu.graphics.TextStyle, int, int),
setSelectionTextStyle(jp.kyasu.graphics.TextStyle, boolean)public void setSelectionTextStyle(TextStyle style)
style - the text style to be set.setSelectionTextStyle(jp.kyasu.graphics.TextStyle, boolean)public void setSelectionTextStyle(TextStyle style, boolean scroll)
style - the text style to be set.scroll - if true, scrolls the view after set done.setSelectionTextStyle(jp.kyasu.graphics.TextStyle),
setRangeTextStyle(jp.kyasu.graphics.TextStyle, int, int, boolean)public void modifyRangeTextStyle(TextStyleModifier modifier, int start, int end)
modifier - the text style modifier.start - the start position, inclusive.end - the end position, exclusive.modifyRangeTextStyle(jp.kyasu.graphics.TextStyleModifier, int, int, boolean)public void modifyRangeTextStyle(TextStyleModifier modifier, int start, int end, boolean scroll)
modifier - the text style modifier.start - the start position, inclusive.end - the end position, exclusive.scroll - if true, scrolls the view after set done.modifyRangeTextStyle(jp.kyasu.graphics.TextStyleModifier, int, int),
modifySelectionTextStyle(jp.kyasu.graphics.TextStyleModifier, boolean)public void modifySelectionTextStyle(TextStyleModifier modifier)
modifier - the text style modifier.modifySelectionTextStyle(jp.kyasu.graphics.TextStyleModifier, boolean)public void modifySelectionTextStyle(TextStyleModifier modifier, boolean scroll)
modifier - the text style modifier.scroll - if true, scrolls the view after set done.modifySelectionTextStyle(jp.kyasu.graphics.TextStyleModifier),
modifyRangeTextStyle(jp.kyasu.graphics.TextStyleModifier, int, int, boolean)public void setRangeParagraphStyle(ParagraphStyle style, int start, int end)
style - the paragraph style to be set.start - the start position, inclusive.end - the end position, exclusive.setRangeParagraphStyle(jp.kyasu.graphics.ParagraphStyle, int, int, boolean)public void setRangeParagraphStyle(ParagraphStyle style, int start, int end, boolean scroll)
style - the paragraph style to be set.start - the start position, inclusive.end - the end position, exclusive.scroll - if true, scrolls the view after set done.setRangeParagraphStyle(jp.kyasu.graphics.ParagraphStyle, int, int),
setSelectionParagraphStyle(jp.kyasu.graphics.ParagraphStyle, boolean)public void setSelectionParagraphStyle(ParagraphStyle style)
style - the paragraph style to be set.setSelectionParagraphStyle(jp.kyasu.graphics.ParagraphStyle, boolean)public void setSelectionParagraphStyle(ParagraphStyle style, boolean scroll)
style - the paragraph style to be set.scroll - if true, scrolls the view after set done.setSelectionParagraphStyle(jp.kyasu.graphics.ParagraphStyle),
setRangeParagraphStyle(jp.kyasu.graphics.ParagraphStyle, int, int, boolean)public void modifyRangeParagraphStyle(ParagraphStyleModifier modifier, int start, int end)
modifier - the paragraph style modifier.start - the start position, inclusive.end - the end position, exclusive.modifyRangeParagraphStyle(jp.kyasu.graphics.ParagraphStyleModifier, int, int, boolean)public void modifyRangeParagraphStyle(ParagraphStyleModifier modifier, int start, int end, boolean scroll)
modifier - the paragraph style modifier.start - the start position, inclusive.end - the end position, exclusive.scroll - if true, scrolls the view after set done.modifyRangeParagraphStyle(jp.kyasu.graphics.ParagraphStyleModifier, int, int),
modifySelectionParagraphStyle(jp.kyasu.graphics.ParagraphStyleModifier, boolean)public void modifySelectionParagraphStyle(ParagraphStyleModifier modifier)
modifier - the paragraph style modifier.modifySelectionParagraphStyle(jp.kyasu.graphics.ParagraphStyleModifier, boolean)public void modifySelectionParagraphStyle(ParagraphStyleModifier modifier, boolean scroll)
modifier - the paragraph style modifier.scroll - if true, scrolls the view after set done.modifySelectionParagraphStyle(jp.kyasu.graphics.ParagraphStyleModifier),
modifyRangeParagraphStyle(jp.kyasu.graphics.ParagraphStyleModifier, int, int, boolean)public int getScrollbarThickness()
public void setScrollbarThickness(int thickness)
#setScrollbarThickness()public void print(boolean printPageNum)
printPageNum - if true, prints a page number in footer.public void print(java.lang.String header,
boolean printPageNum)
header - the header string.printPageNum - if true, prints a page number in footer.public void print(java.awt.Insets insets,
java.lang.String header,
boolean printPageNum)
insets - the insets of a printing medium (paper).header - the header string.printPageNum - if true, prints a page number in footer.public void print(java.awt.PrintJob job,
java.lang.String header,
boolean printPageNum)
job - the print job.header - the header string.printPageNum - if true, prints a page number in footer.public void print(java.awt.PrintJob job,
java.awt.Insets insets,
java.lang.String header,
boolean printPageNum)
job - the print job.insets - the insets of a printing medium (paper).header - the header string.printPageNum - if true, prints a page number in footer.public boolean isAutoIndentEnabled()
public void setAutoIndentEnabled(boolean autoIndent)
public boolean isShowMatchEnabled()
public void setShowMatchEnabled(boolean showMatch)
public void clearUndo()
public void copy_clipboard()
public void cut_clipboard()
public void backward_character()
public void backward_word()
public void beep()
public void beginning_of_file()
public void beginning_of_line()
public void delete_next_character()
public void delete_next_word()
public void delete_previous_character()
public void delete_previous_word()
public void delete_selection()
public void delete_to_end_of_line()
public void delete_to_start_of_line()
public void deselect_all()
public void end_of_file()
public void end_of_line()
public void find_word()
public void forward_character()
public void forward_word()
public void goto_line()
public void insert_character(char c)
public void insert_string(java.lang.String str)
public void kill_next_character()
public void kill_next_word()
public void kill_previous_character()
public void kill_previous_word()
public void kill_selection()
public void kill_to_end_of_line()
public void kill_to_start_of_line()
public void newbreak()
public void newline()
public void newline_and_indent()
public void next_line()
public void next_page()
public void paste_clipboard()
public void previous_line()
public void previous_page()
public void redraw_display()
public void select_all()
public void select_line()
public void select_word()
public void tab()
public void undo()
public void unkill()