public class BasicTextEditController extends TextController implements java.awt.event.ActionListener, java.awt.event.InputMethodListener
BasicTextEditController class implements a controller
of a MVC model for the text editing. The model of the MVC model is a
TextEditModel object and the view of the MVC model is a
TextEditView object.
The BasicTextEditController class implements basic operations
for the text editing. The TextEditController class (a
subclass of this class) implements full operations for the text editing.
The principal editing operations on a BasicTextEditController
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.
| 修飾子とタイプ | フィールドと説明 |
|---|---|
protected boolean |
clickable |
protected static java.lang.String |
CLOSE_BRACES |
protected TextPositionInfo |
composedTextBegin |
protected TextPositionInfo |
composedTextEnd |
protected TextPositionInfo |
dragCurrent |
protected TextPositionInfo |
dragOrigin |
protected java.awt.Menu |
editMenu |
protected KeyBinding |
keyBinding |
protected Undo |
lastUndo |
protected TextEditModel |
model |
protected static java.lang.String |
OPEN_BRACES |
protected java.awt.PopupMenu |
popupMenu |
protected TextStyle |
savedTypeInStyle |
protected TextStyle |
typeInStyle |
protected Text |
typeInText |
protected TextEditView |
view |
A_COPY, A_CUT, A_FIND, A_PASTE, A_PRINT, A_UNDO, CLICK_TO_FOCUS, clickToFocus, L_COPY, L_CUT, L_EDIT, L_FIND, L_PASTE, L_PRINT, L_UNDO, lostClipboardOwnership, selectionVisibleAtFocus| コンストラクタと説明 |
|---|
BasicTextEditController(TextEditView view)
Constructs a text edit controller with the specified text edit view.
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Invoked when an action occurs.
|
void |
addKeyAction(KeyAction keyAction)
Adds the key action to the key binding of this controller.
|
protected void |
addToView()
Adds this controller to the view.
|
void |
append(java.lang.String str)
Appends the given string to the 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 |
caretPositionChanged(java.awt.event.InputMethodEvent e)
Invoked when the caret within composed text has changed.
|
protected void |
changeParagraphStyle(ParagraphStyle style,
ParagraphStyleModifier modifier,
TextPositionInfo begin,
TextPositionInfo end,
boolean scroll)
Changes the paragraph style of the model with the specified style or
modifier.
|
protected void |
changeTextStyle(TextStyle style,
TextStyleModifier modifier,
TextPositionInfo begin,
TextPositionInfo end,
boolean scroll)
Changes the text style of the model with the specified style or modifier.
|
void |
clearUndo()
Clears the undo of the last change.
|
void |
copy_clipboard()
Copies the current selection to the clipboard.
|
protected java.awt.Menu |
createEditMenu()
Creates a menu for the editing.
|
protected Dialog |
createFindDialog(java.lang.String initStr)
Creates a dialog for finding a word.
|
protected java.awt.MenuItem |
createMenuItem(java.lang.String label,
java.lang.String action,
java.lang.String shortcut)
Creates a menu item.
|
protected java.awt.PopupMenu |
createPopupMenu()
Creates a popup menu.
|
void |
cut_clipboard()
Cuts the current selection to the clipboard.
|
protected void |
dragSelectionTo(TextPositionInfo posInfo)
Expands and moves the selection according to the specified text position.
|
boolean |
echoCharIsSet()
Indicates whether or not the view of this controller has a character
set for echoing.
|
void |
find_word()
Finds the word and move the insertion cursor to the founded word.
|
boolean |
find_word(java.lang.String find)
Finds the word and move the insertion cursor to the founded word.
|
boolean |
find_word(java.lang.String find,
java.lang.String rep)
Finds the word and move the insertion cursor to the founded word.
|
boolean |
find_word(java.lang.String find,
java.lang.String rep,
int startIndex)
Finds the word and move the insertion cursor to the founded word.
|
void |
focusGained(java.awt.event.FocusEvent e)
Invoked when a component gains the keyboard focus.
|
void |
focusLost(java.awt.event.FocusEvent e)
Invoked when a component loses the keyboard focus.
|
int |
getCaretPosition()
Returns the position of the text insertion caret.
|
Text |
getClipboardText()
Returns the text in the clipboard.
|
int |
getColumns()
Returns the number of columns in the view of this controller.
|
TextStyle |
getCurrentTextStyle()
Returns the current text style of this controller.
|
char |
getEchoChar()
Returns the character that is to be used for echoing.
|
java.awt.Menu |
getEditMenu()
Returns the edit menu of this controller.
|
KeyAction |
getKeyAction(java.lang.String actionName)
Returns the key action object associated with the specified name.
|
KeyBinding |
getKeyBinding()
Returns the key binding of this controller.
|
Keymap |
getKeymap()
Returns the keymap of this controller.
|
TextEditModel |
getModel()
Returns the model of this controller.
|
ParagraphStyle |
getParagraphStyleAt(int index)
Returns the paragraph style at the specified index in the view of
this controller.
|
int |
getParagraphStyleCount()
Returns the number of the paragraph styles in the text of the view
of this controller.
|
ParagraphStyle[] |
getParagraphStyles()
Returns all paragraph styles in the text of the view of this controller.
|
ParagraphStyle[] |
getParagraphStyles(int begin,
int end)
Returns the paragraph styles in the text of the view of this controller.
|
java.awt.PopupMenu |
getPopupMenu()
Returns the popup menu of this controller.
|
RichText |
getRichText()
Returns the rich text of the view of this controller.
|
int |
getRows()
Returns the number of rows in the view of this controller.
|
java.lang.String |
getSelectedString()
Returns the selected string from the view of this controller.
|
Text |
getSelectedText()
Returns the selected text from the view of this controller.
|
int |
getSelectionEnd()
Returns the end position of the selected text.
|
int |
getSelectionStart()
Returns the start position of the selected text.
|
java.lang.String |
getString()
Returns the string of the view of this controller.
|
java.lang.String |
getString(java.lang.String separator)
Returns the string of the view of this controller.
|
Text |
getText()
Returns the text of the view of this controller.
|
TextStyle |
getTextStyleAt(int index)
Returns the text style at the specified index in the view of this
controller.
|
int |
getTextStyleCount()
Returns the number of the text styles in the text of the view of
this controller.
|
TextStyle[] |
getTextStyles()
Returns all text styles in the text of the view of this controller.
|
TextStyle[] |
getTextStyles(int begin,
int end)
Returns the text styles in the text of the view of this controller.
|
TextView |
getView()
Returns the view of this controller.
|
void |
inputMethodTextChanged(java.awt.event.InputMethodEvent e)
Invoked when the text entered through an input method has changed.
|
void |
insert_character(char c)
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 the view
of this controller.
|
void |
insert(Text text,
int pos)
Inserts the specified text at the specified position in the view
of this controller.
|
void |
insert(Text text,
int pos,
boolean scroll)
Inserts the specified text at the specified position in the view
of this controller.
|
boolean |
isClickable()
Tests if this controller handles
ClickableTextAction. |
boolean |
isEditable()
Indicates whether or not the view of this controller is editable.
|
boolean |
isSelectionVisibleAtFocus()
Tests if the selection becomes visible when the view is focused.
|
void |
keyPressed(java.awt.event.KeyEvent e)
Invoked when a key has been pressed.
|
void |
keyTyped(java.awt.event.KeyEvent e)
Invoked when a key has been typed.
|
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 |
mouseClicked(java.awt.event.MouseEvent e)
Invoked when the mouse has been clicked on a component.
|
void |
mouseDragged(java.awt.event.MouseEvent e)
Invoked when the mouse button is pressed on a component and then dragged.
|
void |
mouseEntered(java.awt.event.MouseEvent e)
Invoked when the mouse enters a component.
|
void |
mousePressed(java.awt.event.MouseEvent e)
Invoked when the mouse has been pressed on a component.
|
void |
mouseReleased(java.awt.event.MouseEvent e)
Invoked when the mouse has been released on a component.
|
protected void |
notifyTextPositionListeners()
Notifies the text position event to the text position listeners.
|
java.util.Enumeration |
paragraphStyles()
Returns an enumeration of the paragraph styles of the text of the
view of this controller.
|
java.util.Enumeration |
paragraphStyles(int begin,
int end)
Returns an enumeration of the paragraph styles of the text of the
view of this controller.
|
void |
paste_clipboard()
Pastes the the clipboard before the insertion cursor.
|
void |
paste_cutbuffer()
Pastes the the cut buffer 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.
|
void |
print(boolean printPageNum)
Prints the text in the view of this controller 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 in the view of this controller 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 in the view of this controller 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 in the view of this controller 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 in the view of this controller with the specified
header string and flag determining to print a page number in footer.
|
void |
removeKeyAction(KeyAction keyAction)
Removes the key action from the key binding of this controller.
|
void |
removeKeyActionNamed(java.lang.String actionName)
Removes the key action named the specified name from the key binding
of this controller.
|
protected void |
replaceInputMethodText(java.awt.event.InputMethodEvent e) |
void |
replaceRange(java.lang.String str,
int start,
int end)
Replaces string between the indicated start and end positions
with the specified replacement string.
|
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.
|
protected void |
replaceRange(Text text,
TextPositionInfo begin,
TextPositionInfo end,
boolean scroll)
Replaces the text of the model with the specified 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 |
select_all()
Select all text.
|
boolean |
select_braces()
Select braces at the selection start position.
|
boolean |
select_braces(TextPositionInfo posInfo)
Select braces at the specified text position.
|
void |
select_line()
Select a line at the selection start position.
|
void |
select_line(TextPositionInfo posInfo)
Select a line at the specified text position.
|
void |
select_word()
Select a word at the selection start position.
|
void |
select_word(TextPositionInfo posInfo)
Select a word at the specified text 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.
|
protected void |
select(TextPositionInfo begin,
TextPositionInfo end,
boolean scroll,
boolean top) |
void |
selectAll()
Selects all the text.
|
boolean |
selectionIsCaret()
Tests if the selection is caret, i.e., null selection.
|
void |
setCaretPosition(int position)
Sets the position of the text insertion caret.
|
void |
setCaretPosition(int position,
boolean top)
Sets the position of the text insertion caret.
|
void |
setClickable(boolean b)
Makes this controller handle
ClickableTextAction. |
protected void |
setCurrentTypeIn(TextPositionInfo posInfo)
Sets the current (type in) text style from the specified text position.
|
void |
setEchoChar(char c)
Sets the echo character for the view of this controller.
|
void |
setEditable(boolean b)
Sets the flag that determines whether or not the view this controller
is editable.
|
protected void |
setInputMethodCaretPosition(java.awt.event.InputMethodEvent e) |
void |
setKeymap(Keymap keymap)
Sets the keymap of this controller.
|
protected void |
setMenuEnabled(java.awt.Menu menu,
boolean b)
Enables or disaples the specified menu.
|
void |
setPopupMenu(java.awt.PopupMenu menu)
Sets the popup menu of this controller.
|
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 the view of this controller.
|
protected void |
setSelectionBegin(TextPositionInfo posInfo)
Sets the beginning position of the selection.
|
protected void |
setSelectionBeginEnd(TextPositionInfo posInfo)
Sets the beginning and ending positions of the selection.
|
protected void |
setSelectionBeginEnd(TextPositionInfo begin,
TextPositionInfo end)
Sets the beginning and ending positions of the selection.
|
void |
setSelectionEnd(int selectionEnd)
Sets the selection end for the view of this controller to the
specified position.
|
protected void |
setSelectionEnd(TextPositionInfo posInfo)
Sets the ending position of the selection.
|
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 the view of this controller 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 |
setString(java.lang.String str)
Sets the string of the view of this controller.
|
void |
setText(Text text)
Sets the text of the view of this controller.
|
void |
setUndo(Undo undo)
Sets the undo.
|
java.util.Enumeration |
textStyles()
Returns an enumeration of the text styles of text of the view of
this controller.
|
java.util.Enumeration |
textStyles(int begin,
int end)
Returns an enumeration of the text styles of text of the view of
this controller.
|
void |
undo()
Undo the last change.
|
getClipboardString, getClipboardText, getCutBufferText, getResourceString, isClickToFocus, isMouseFocus, keyReleased, lostOwnership, mouseExited, mouseMoved, removeFromView, setClickToFocus, setClipboardString, setClipboardText, setCutBuffer, setMouseFocus, setSelectionVisibleAtFocusprotected TextEditModel model
protected TextEditView view
protected KeyBinding keyBinding
protected boolean clickable
protected Text typeInText
protected TextStyle typeInStyle
protected java.awt.Menu editMenu
protected java.awt.PopupMenu popupMenu
protected transient TextPositionInfo dragOrigin
protected transient TextPositionInfo dragCurrent
protected transient Undo lastUndo
protected static final java.lang.String OPEN_BRACES
protected static final java.lang.String CLOSE_BRACES
protected TextStyle savedTypeInStyle
protected TextPositionInfo composedTextBegin
protected TextPositionInfo composedTextEnd
public BasicTextEditController(TextEditView view)
view - the text edit view.public TextEditModel getModel()
public TextView getView()
getView クラス内 TextControllerpublic boolean isSelectionVisibleAtFocus()
public Text getClipboardText()
getClipboardText クラス内 TextControllerpublic 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.addKeyAction(jp.kyasu.awt.text.KeyAction),
getKeyAction(java.lang.String),
removeKeyActionNamed(java.lang.String)public void removeKeyActionNamed(java.lang.String actionName)
actionName - the name of the key action.addKeyAction(jp.kyasu.awt.text.KeyAction),
getKeyAction(java.lang.String),
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 java.awt.Menu getEditMenu()
public java.awt.PopupMenu getPopupMenu()
public void setPopupMenu(java.awt.PopupMenu menu)
getPopupMenu()public java.lang.String getString()
#getString(java.awt.String),
#setString(java.awt.String)public java.lang.String getString(java.lang.String separator)
separator - the separator string.getString(),
#setString(java.awt.String),
jp.kyasu.graphics.Text#getSystemString(java.awt.String, java.awt.String)public void setString(java.lang.String str)
getString()public java.lang.String getSelectedString()
public boolean isEditable()
setEditable(boolean)public void setEditable(boolean b)
isEditable()public int getSelectionStart()
public void setSelectionStart(int selectionStart)
public int getSelectionEnd()
public void setSelectionEnd(int selectionEnd)
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),
select(int, int, boolean, boolean),
selectAll()public void selectAll()
select(int, int)public int getCaretPosition()
setCaretPosition(int)public void setCaretPosition(int position)
public boolean selectionIsCaret()
public void insert(java.lang.String str,
int pos)
str - the string to insert.pos - the position at which to insert.replaceRange(java.lang.String, int, int)public void append(java.lang.String str)
str - the string to append.insert(java.lang.String, int)public void replaceRange(java.lang.String str,
int start,
int end)
str - the string to use as the replacement.start - the start position, inclusive.end - the end position, exclusive.replaceRange(jp.kyasu.graphics.Text, int, int)public int getRows()
getColumns()public int getColumns()
getRows()public char getEchoChar()
setEchoChar(char),
echoCharIsSet()public void setEchoChar(char c)
getEchoChar(),
echoCharIsSet()public boolean echoCharIsSet()
getEchoChar(),
setEchoChar(char)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 void setText(Text text)
getText()public RichText getRichText()
public void setRichText(RichText richText)
getRichText()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)protected void select(TextPositionInfo begin, TextPositionInfo end, boolean scroll, boolean top)
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 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 void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked インタフェース内 java.awt.event.MouseListenermouseClicked クラス内 TextControllerMouseListenerpublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed インタフェース内 java.awt.event.MouseListenermousePressed クラス内 TextControllerMouseListenerpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased インタフェース内 java.awt.event.MouseListenermouseReleased クラス内 TextControllerMouseListenerpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered インタフェース内 java.awt.event.MouseListenermouseEntered クラス内 TextControllerMouseListenerpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged インタフェース内 java.awt.event.MouseMotionListenermouseDragged クラス内 TextControllerMouseMotionListenerpublic void keyTyped(java.awt.event.KeyEvent e)
keyTyped インタフェース内 java.awt.event.KeyListenerkeyTyped クラス内 TextControllerKeyListenerpublic void keyPressed(java.awt.event.KeyEvent e)
keyPressed インタフェース内 java.awt.event.KeyListenerkeyPressed クラス内 TextControllerKeyListenerpublic void focusGained(java.awt.event.FocusEvent e)
focusGained インタフェース内 java.awt.event.FocusListenerfocusGained クラス内 TextControllerFocusListenerpublic void focusLost(java.awt.event.FocusEvent e)
focusLost インタフェース内 java.awt.event.FocusListenerfocusLost クラス内 TextControllerFocusListenerpublic void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed インタフェース内 java.awt.event.ActionListenerActionListenerpublic void insert_character(char c)
public void undo()
public void clearUndo()
public void setUndo(Undo undo)
public void copy_clipboard()
public void cut_clipboard()
public void paste_cutbuffer()
public void paste_clipboard()
public void select_all()
public boolean select_braces()
public boolean select_braces(TextPositionInfo posInfo)
select_braces()public void select_line()
public void select_line(TextPositionInfo posInfo)
select_line()public void select_word()
public void select_word(TextPositionInfo posInfo)
select_word()public void find_word()
public boolean find_word(java.lang.String find)
find - the word to be found.find_word(),
find_word(java.lang.String, java.lang.String),
find_word(java.lang.String, java.lang.String, int)public boolean find_word(java.lang.String find,
java.lang.String rep)
find - the word to be found.rep - the replacement string.find_word(),
find_word(java.lang.String),
find_word(java.lang.String, java.lang.String, int)public boolean find_word(java.lang.String find,
java.lang.String rep,
int startIndex)
find - the word to be found.rep - the replacement string.startIndex - the starting index to find.find_word(java.lang.String),
find_word(java.lang.String, java.lang.String),
find_word(java.lang.String, java.lang.String, int)protected Dialog createFindDialog(java.lang.String initStr)
initStr - the initial string to prompt.find_word()protected java.awt.Menu createEditMenu()
protected java.awt.PopupMenu createPopupMenu()
protected java.awt.MenuItem createMenuItem(java.lang.String label,
java.lang.String action,
java.lang.String shortcut)
protected void setMenuEnabled(java.awt.Menu menu,
boolean b)
protected void setSelectionBegin(TextPositionInfo posInfo)
protected void setSelectionEnd(TextPositionInfo posInfo)
protected void setSelectionBeginEnd(TextPositionInfo posInfo)
protected void setSelectionBeginEnd(TextPositionInfo begin, TextPositionInfo end)
protected void notifyTextPositionListeners()
protected void setCurrentTypeIn(TextPositionInfo posInfo)
protected void dragSelectionTo(TextPositionInfo posInfo)
protected void replaceRange(Text text, TextPositionInfo begin, TextPositionInfo end, boolean scroll)
text - the replacement text.begin - the beginning position to replace, inclusive.end - the endign position to replace, exclusive.scroll - if true, scrolls the view after replace done.protected void changeTextStyle(TextStyle style, TextStyleModifier modifier, TextPositionInfo begin, TextPositionInfo end, boolean scroll)
style - the new text style or null.modifier - the text style modifier or null.begin - the beginning position to change, inclusive.end - the endign position to change, exclusive.scroll - if true, scrolls the view after change done.protected void changeParagraphStyle(ParagraphStyle style, ParagraphStyleModifier modifier, TextPositionInfo begin, TextPositionInfo end, boolean scroll)
style - the new paragraph style or null.modifier - the paragraph style modifier or null.begin - the beginning position to change, inclusive.end - the endign position to change, exclusive.scroll - if true, scrolls the view after change done.protected void addToView()
addToView クラス内 TextControllerpublic void inputMethodTextChanged(java.awt.event.InputMethodEvent e)
inputMethodTextChanged インタフェース内 java.awt.event.InputMethodListenerpublic void caretPositionChanged(java.awt.event.InputMethodEvent e)
caretPositionChanged インタフェース内 java.awt.event.InputMethodListenerprotected void replaceInputMethodText(java.awt.event.InputMethodEvent e)
protected void setInputMethodCaretPosition(java.awt.event.InputMethodEvent e)