public abstract class TextController
extends java.lang.Object
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.KeyListener, java.awt.event.FocusListener, java.awt.datatransfer.ClipboardOwner, java.io.Serializable
TextController class is an abstract base class that
controlls the TextView object.| 修飾子とタイプ | フィールドと説明 |
|---|---|
static java.lang.String |
A_COPY
The action name for the copy operation.
|
static java.lang.String |
A_CUT
The action name for the cut operation.
|
static java.lang.String |
A_FIND
The action name for the find operation.
|
static java.lang.String |
A_PASTE
The action name for the paste operation.
|
static java.lang.String |
A_PRINT
The action name for the print operation.
|
static java.lang.String |
A_UNDO
The action name for the undo operation.
|
protected static boolean |
CLICK_TO_FOCUS
If true, the controller requests the focus when the mouse is clicked.
|
protected boolean |
clickToFocus |
static java.lang.String |
L_COPY
The label name for the copy operation.
|
static java.lang.String |
L_CUT
The label name for the cut operation.
|
static java.lang.String |
L_EDIT
The label name for the edit menu.
|
static java.lang.String |
L_FIND
The label name for the find operation.
|
static java.lang.String |
L_PASTE
The label name for the paste operation.
|
static java.lang.String |
L_PRINT
The label name for the print operation.
|
static java.lang.String |
L_UNDO
The label name for the undo operation.
|
protected boolean |
lostClipboardOwnership |
protected boolean |
selectionVisibleAtFocus |
| コンストラクタと説明 |
|---|
TextController()
Constructs a text controller.
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
protected void |
addToView()
Adds this controller to the view.
|
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.
|
java.lang.String |
getClipboardString()
Returns the string in the clipboard.
|
Text |
getClipboardText()
Returns the text in the clipboard.
|
Text |
getClipboardText(TextStyle style)
Returns the text in the clipboard with the specified text style.
|
static Text |
getCutBufferText()
Returns the text in the cut buffer.
|
static java.lang.String |
getResourceString(java.lang.String s,
java.lang.String def)
Returns the resource string indicated by the specified key.
|
abstract TextView |
getView()
Returns the view of this controller.
|
boolean |
isClickToFocus()
Tests if the controller requests the focus when the mouse is clicked.
|
boolean |
isMouseFocus()
Tests if the controller requests the focus when the mouse enters
the view.
|
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 |
keyReleased(java.awt.event.KeyEvent e)
Invoked when a key has been released.
|
void |
keyTyped(java.awt.event.KeyEvent e)
Invoked when a key has been typed.
|
void |
lostOwnership(java.awt.datatransfer.Clipboard clipboard,
java.awt.datatransfer.Transferable contents)
Notifies this object that it is no longer the owner of the contents
of the clipboard.
|
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 |
mouseExited(java.awt.event.MouseEvent e)
Invoked when the mouse exits a component.
|
void |
mouseMoved(java.awt.event.MouseEvent e)
Invoked when the mouse button has been moved on 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 |
removeFromView()
Removes this controller from the view.
|
void |
setClickToFocus()
Makes the controller request the focus when the mouse is clicked.
|
void |
setClipboardString(java.lang.String str)
Sets the string to the clipboard.
|
void |
setClipboardText(Text text)
Sets the text to the clipboard.
|
static void |
setCutBuffer(Text text)
Sets the text to the cut buffer.
|
void |
setMouseFocus()
Makes the controller request the focus when the mouse enters the view.
|
void |
setSelectionVisibleAtFocus(boolean b)
Makes the selection become visible when the view is focused.
|
protected boolean clickToFocus
protected boolean selectionVisibleAtFocus
protected boolean lostClipboardOwnership
public static final java.lang.String L_EDIT
public static final java.lang.String L_COPY
public static final java.lang.String L_CUT
public static final java.lang.String L_PASTE
public static final java.lang.String L_FIND
public static final java.lang.String L_UNDO
public static final java.lang.String L_PRINT
public static final java.lang.String A_COPY
public static final java.lang.String A_CUT
public static final java.lang.String A_PASTE
public static final java.lang.String A_FIND
public static final java.lang.String A_UNDO
public static final java.lang.String A_PRINT
protected static final boolean CLICK_TO_FOCUS
public static java.lang.String getResourceString(java.lang.String s,
java.lang.String def)
public abstract TextView getView()
protected void addToView()
protected void removeFromView()
public boolean isClickToFocus()
true if the controller requests the focus when
the mouse is clicked, false if the controller
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 boolean isSelectionVisibleAtFocus()
public void setSelectionVisibleAtFocus(boolean b)
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked インタフェース内 java.awt.event.MouseListenerMouseListenerpublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed インタフェース内 java.awt.event.MouseListenerMouseListenerpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased インタフェース内 java.awt.event.MouseListenerMouseListenerpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered インタフェース内 java.awt.event.MouseListenerMouseListenerpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited インタフェース内 java.awt.event.MouseListenerMouseListenerpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged インタフェース内 java.awt.event.MouseMotionListenerMouseMotionListenerpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved インタフェース内 java.awt.event.MouseMotionListenerMouseMotionListenerpublic void keyTyped(java.awt.event.KeyEvent e)
keyTyped インタフェース内 java.awt.event.KeyListenerKeyListenerpublic void keyPressed(java.awt.event.KeyEvent e)
keyPressed インタフェース内 java.awt.event.KeyListenerKeyListenerpublic void keyReleased(java.awt.event.KeyEvent e)
keyReleased インタフェース内 java.awt.event.KeyListenerKeyListenerpublic void focusGained(java.awt.event.FocusEvent e)
focusGained インタフェース内 java.awt.event.FocusListenerFocusListenerpublic void focusLost(java.awt.event.FocusEvent e)
focusLost インタフェース内 java.awt.event.FocusListenerFocusListenerpublic void lostOwnership(java.awt.datatransfer.Clipboard clipboard,
java.awt.datatransfer.Transferable contents)
lostOwnership インタフェース内 java.awt.datatransfer.ClipboardOwnerClipboardOwnerpublic static Text getCutBufferText()
public static void setCutBuffer(Text text)
public Text getClipboardText()
public Text getClipboardText(TextStyle style)
public void setClipboardText(Text text)
public java.lang.String getClipboardString()
public void setClipboardString(java.lang.String str)