public class TextEditView extends TextView implements TextModelListener
TextEditView class implements a view of a MVC model for
the text editing. The model of the MVC model is a TextEditModel
object and the controller of the MVC model is a
TextEditController object.TextEditModel,
TextEditController,
直列化された形式| 修飾子とタイプ | フィールドと説明 |
|---|---|
protected java.awt.Color |
caretColor |
protected TextEditController |
controller |
static java.awt.Cursor |
DEFAULT_CURSOR
The default cursor.
|
protected boolean |
editable |
protected java.awt.im.InputMethodRequests |
inputMethodRequestsHandler |
protected TextEditModel |
model |
protected TextPositionInfo |
selectionBegin |
protected TextPositionInfo |
selectionEnd |
protected TextCaret |
textCaret |
protected java.util.Vector |
textPositionListeners |
_visibleBegin, _visibleEnd, DEFAULT_BACKGROUND, DEFAULT_FOREGROUND, DEFAULT_SELECTION_BACKGROUND, DEFAULT_SELECTION_FOREGROUND, layout, lineWrap, offset, scrolledDown, scrolledLeft, scrolledRight, scrolledUp, scrollListeners, selectionBackground, selectionForeground, selectionShowing, selectionVisibleDefaultToolkit, doubleBuffered, focusTraversable, offscreenBuffer, toolTip| コンストラクタと説明 |
|---|
TextEditView(TextEditModel textEditModel)
Constructs a text edit view with the specified text edit model.
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
void |
addNotify()
Notifies this view that it has been added to a container.
|
void |
addTextPositionListener(TextPositionListener l)
Add a listener to recieve text position events when the selection
of the text view changes.
|
protected void |
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
java.awt.Color |
getCaretColor()
Returns the caret color.
|
TextEditController |
getController()
Returns the controller of this view.
|
java.awt.im.InputMethodRequests |
getInputMethodRequests() |
TextEditModel |
getModel()
Returns the model of this view.
|
RichText |
getRichText()
Returns the
RichText object being viewed. |
Text |
getSelectedText()
Returns the selected text.
|
TextPositionInfo |
getSelectionBegin()
Returns the beginning text position of the selection, inclusive.
|
TextPositionInfo |
getSelectionEnd()
Returns the ending text position of the selection, exclusive.
|
TextCaret |
getTextCaret()
Returns the text caret of this view.
|
protected void |
hideSelection()
Hides the selection.
|
boolean |
isEditable()
Tests if this view is editable.
|
protected boolean |
needsToRedrawSelection()
Tests if the selection is needed to be redrawn.
|
protected void |
notifyTextPositionListeners()
Notifies the text position event to the text position listeners.
|
void |
paint(java.awt.Graphics g)
Paints this component.
|
protected void |
paint(java.awt.Graphics g,
TextPositionInfo begin,
TextPositionInfo end)
Paints this view with the specified range.
|
protected void |
paintAfterEdited(TextLayoutChange change)
Paints this view after the text edit model has been edited.
|
protected void |
paintSelection(java.awt.Color foreColor,
java.awt.Color backColor)
Paints the selection with the specified colors.
|
protected void |
paintSelection(TextPositionInfo selBegin,
TextPositionInfo selEnd,
java.awt.Color foreColor,
java.awt.Color backColor)
Paints the selection of the specified range with the specified colors.
|
protected void |
paintSelection(TextPositionInfo selBegin,
TextPositionInfo selEnd,
java.awt.Color foreColor,
java.awt.Color backColor,
boolean fullSelection)
Paints the selection of the specified range with the specified colors
and flag indicating that the specified range is a entire selection.
|
protected void |
performClickableTextAction(ClickableTextAction action) |
protected void |
processEvent(java.awt.AWTEvent e) |
void |
removeNotify()
Notifies this view that it has been removed from its container.
|
void |
removeTextPositionListener(TextPositionListener l)
Removes an text position listener.
|
protected void |
resetLocationOfText()
Resets the location of the layout text.
|
boolean |
selectionIsCaret()
Tests if the selection is caret, i.e., null selection.
|
void |
setCaretColor(java.awt.Color c)
Sets the caret color.
|
void |
setController(TextEditController controller)
Sets the controller of this view.
|
void |
setEditable(boolean b)
Makes this view editable.
|
void |
setEnabled(boolean b)
Enables or disables this view.
|
void |
setFont(java.awt.Font f)
Sets the font of this view.
|
void |
setRichText(RichText richText)
Sets the
RichText object of this view. |
protected void |
setSelectionBegin(TextPositionInfo posInfo)
Sets the beginning text position of the selection, inclusive.
|
protected void |
setSelectionBeginEnd(TextPositionInfo posInfo)
Sets the text position of the selection.
|
protected void |
setSelectionBeginEnd(TextPositionInfo begin,
TextPositionInfo end)
Sets the range of the selection.
|
protected void |
setSelectionEnd(TextPositionInfo posInfo)
Sets the ending text position of the selection, exclusive.
|
void |
setText(Text text)
Sets the
Text object of this view. |
void |
setTextCaret(TextCaret textCaret)
Sets the text caret of this view.
|
protected void |
setTextLayout(TextLayout layout)
Sets the
TextLayout object of this view. |
protected void |
showSelection()
Shows the selection.
|
protected void |
startTextCaret()
Starts the text caret of this view.
|
protected void |
stopTextCaret()
Stops the text caret of this view.
|
void |
textModelChanged(TextModelEvent event)
Invoked when the text model has been changed.
|
protected void |
updateAfterEdited(TextModelEvent event)
Updates this view after the text edit model has been edited.
|
addScrollListener, createTextLayout, getColumns, getHBlockIncrement, getHMaximum, getHMinimum, getHUnitIncrement, getHValue, getHVisibleAmount, getLineWrap, getLocationOfText, getMinimumSize, getPreferredHeight, getPreferredSize, getPreferredSize, getPreferredWidth, getRows, getScrollXTo, getScrollYTo, getSelectionBackground, getSelectionForeground, getTextLineAt, getTextPositionAt, getTextPositionAt, getTextPositionNearby, getTextPositionNearby, getTextPositionNextTo, getTextPositionPrevTo, getVBlockIncrement, getVisibleBegin, getVisibleEnd, getVMaximum, getVMinimum, getVUnitIncrement, getVValue, getVVisibleAmount, isFocusTraversable, isSelectionVisible, layoutResized, notifyScrollListeners, paintOn, removeScrollListener, scrollTo, scrollTo, scrollX, scrollX, scrollXTo, scrollXTo, scrollY, scrollY, scrollYTo, scrollYTo, setBounds, setHValue, setLineWrap, setLineWrapInner, setLocale, setLocationOfText, setSelectionBackground, setSelectionForeground, setSelectionVisible, setVValuebounds, disable, doLayout, enable, enable, getBounds, getFrame, getLocation, getPreferredGraphics, getPreferredGraphics, getSize, getToolTipText, getToolTipVisual, hide, isDirectNotification, isDoubleBuffered, layout, location, minimumSize, postOldEvent, preferredSize, processMouseEvent, processMouseMotionEvent, repaintNow, requestFocus, reshape, setBackground, setDoubleBuffered, setFocusTraversable, setForeground, setToolTipText, setToolTipText, setToolTipVisual, setVisible, show, show, size, syncGraphics, syncGraphics, syncGraphics, updateaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disableEvents, dispatchEvent, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getKeyListeners, getListeners, getLocale, getLocation, getLocationOnScreen, getMaximumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, list, list, locate, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, prepareImage, prepareImage, print, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, 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, setCursor, setDropTarget, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validateprotected TextEditModel model
protected TextEditController controller
protected boolean editable
protected java.awt.Color caretColor
protected TextCaret textCaret
protected transient TextPositionInfo selectionBegin
protected transient TextPositionInfo selectionEnd
protected transient java.util.Vector textPositionListeners
public static final java.awt.Cursor DEFAULT_CURSOR
protected java.awt.im.InputMethodRequests inputMethodRequestsHandler
public TextEditView(TextEditModel textEditModel)
textEditModel - the text edit model.public RichText getRichText()
RichText object being viewed.getRichText クラス内 TextViewpublic TextEditModel getModel()
public TextEditController getController()
public void setController(TextEditController controller)
public void textModelChanged(TextModelEvent event)
textModelChanged インタフェース内 TextModelListenerTextModelListenerprotected void setTextLayout(TextLayout layout)
TextLayout object of this view.setTextLayout クラス内 TextViewpublic void setText(Text text)
Text object of this view.text - the Text object.public void setRichText(RichText richText)
RichText object of this view.richText - the RichText object.public TextPositionInfo getSelectionBegin()
protected void setSelectionBegin(TextPositionInfo posInfo)
public TextPositionInfo getSelectionEnd()
protected void setSelectionEnd(TextPositionInfo posInfo)
protected void setSelectionBeginEnd(TextPositionInfo posInfo)
protected void setSelectionBeginEnd(TextPositionInfo begin, TextPositionInfo end)
public boolean isEditable()
public void setEditable(boolean b)
public void setEnabled(boolean b)
setEnabled クラス内 KComponentpublic java.awt.Color getCaretColor()
public void setCaretColor(java.awt.Color c)
getCaretColor()public TextCaret getTextCaret()
public void setTextCaret(TextCaret textCaret)
getTextCaret()protected void startTextCaret()
stopTextCaret()protected void stopTextCaret()
startTextCaret()public Text getSelectedText()
protected void resetLocationOfText()
resetLocationOfText クラス内 TextViewpublic void addNotify()
addNotify クラス内 KComponentAWTResources.checkComponentState(java.awt.Component)public void removeNotify()
removeNotify クラス内 java.awt.Componentpublic void setFont(java.awt.Font f)
setFont クラス内 java.awt.Componentpublic void addTextPositionListener(TextPositionListener l)
l - the listener to recieve events.public void removeTextPositionListener(TextPositionListener l)
l - the listener being removed.protected void notifyTextPositionListeners()
public void paint(java.awt.Graphics g)
paint クラス内 KComponentprotected void paint(java.awt.Graphics g,
TextPositionInfo begin,
TextPositionInfo end)
protected void showSelection()
showSelection クラス内 TextViewprotected void hideSelection()
hideSelection クラス内 TextViewprotected void paintSelection(java.awt.Color foreColor,
java.awt.Color backColor)
protected void paintSelection(TextPositionInfo selBegin, TextPositionInfo selEnd, java.awt.Color foreColor, java.awt.Color backColor)
protected void paintSelection(TextPositionInfo selBegin, TextPositionInfo selEnd, java.awt.Color foreColor, java.awt.Color backColor, boolean fullSelection)
protected void updateAfterEdited(TextModelEvent event)
protected void paintAfterEdited(TextLayoutChange change)
public boolean selectionIsCaret()
protected boolean needsToRedrawSelection()
needsToRedrawSelection クラス内 TextViewprotected void performClickableTextAction(ClickableTextAction action)
protected void processEvent(java.awt.AWTEvent e)
processEvent クラス内 java.awt.Componentprotected void finalize()
throws java.lang.Throwable
finalize クラス内 java.lang.Objectjava.lang.Throwable - if an error was occurred.public java.awt.im.InputMethodRequests getInputMethodRequests()
getInputMethodRequests クラス内 java.awt.Component