public abstract class TextView extends KComponent implements Scrollable
TextView class is an abstract base class that views
the TextLayout object.| 修飾子とタイプ | フィールドと説明 |
|---|---|
protected TextPositionInfo |
_visibleBegin |
protected TextPositionInfo |
_visibleEnd |
static java.awt.Color |
DEFAULT_BACKGROUND
The default background color.
|
static java.awt.Color |
DEFAULT_FOREGROUND
The default foreground color.
|
static java.awt.Color |
DEFAULT_SELECTION_BACKGROUND
The default selection background color.
|
static java.awt.Color |
DEFAULT_SELECTION_FOREGROUND
The default selection foreground color.
|
protected TextLayout |
layout |
protected int |
lineWrap |
protected java.awt.Point |
offset |
protected boolean |
scrolledDown |
protected boolean |
scrolledLeft |
protected boolean |
scrolledRight |
protected boolean |
scrolledUp |
protected java.util.Vector |
scrollListeners |
protected java.awt.Color |
selectionBackground |
protected java.awt.Color |
selectionForeground |
protected boolean |
selectionShowing |
protected boolean |
selectionVisible |
DefaultToolkit, doubleBuffered, focusTraversable, offscreenBuffer, toolTip| コンストラクタと説明 |
|---|
TextView(int lineWrap)
Constructs a text view with the specified line wrapping style.
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
void |
addScrollListener(ScrollListener l)
Add a listener to recieve scroll events when the value
of the scroll component changes.
|
protected TextLayout |
createTextLayout()
Creates a new
TextLayout object. |
int |
getColumns()
Returns the number of columns.
|
int |
getHBlockIncrement()
Gets the horizontal block value increment for the scrollable object.
|
int |
getHMaximum()
Gets the horizontal maximum value of the scrollable object.
|
int |
getHMinimum()
Gets the horizontal minimum value of the scrollable object.
|
int |
getHUnitIncrement()
Gets the horizontal unit value increment for the scrollable object.
|
int |
getHValue()
Gets the horizontal current value of the scrollable object.
|
int |
getHVisibleAmount()
Gets the horizontal length of the propertional indicator.
|
int |
getLineWrap()
Returns the line wrapping style.
|
java.awt.Point |
getLocationOfText()
Returns the location of the
TextLayout object. |
java.awt.Dimension |
getMinimumSize()
Returns the minimum size of this view.
|
int |
getPreferredHeight(int rows)
Returns the preferred height of this view with the specified number
of rows.
|
java.awt.Dimension |
getPreferredSize()
Returns the preferred size of this view.
|
java.awt.Dimension |
getPreferredSize(int rows,
int columns)
Returns the preferred size of this view with the specified number
of rows and columns.
|
int |
getPreferredWidth(int columns)
Returns the preferred width of this view with the specified number
of columns.
|
abstract RichText |
getRichText()
Returns the
RichText object being viewed. |
int |
getRows()
Returns the number of rows.
|
protected int |
getScrollXTo(TextPositionInfo posInfo)
Returns the preferred x-position for the specified text position.
|
protected int |
getScrollYTo(TextPositionInfo posInfo)
Returns the preferred y-position for the specified text position.
|
java.awt.Color |
getSelectionBackground()
Returns the selection background color.
|
java.awt.Color |
getSelectionForeground()
Returns the selection foreground color.
|
protected TextLineInfo |
getTextLineAt(int lineIndex)
Returns the text line at the specified line index.
|
protected TextPositionInfo |
getTextPositionAt(int textIndex)
Returns the text position at the specified text index.
|
protected TextPositionInfo |
getTextPositionAt(java.awt.Point point)
Returns the text position at the specified point.
|
protected TextPositionInfo |
getTextPositionNearby(TextPositionInfo posInfo,
int textIndex)
Returns the text position at the specified text index nearby the
specified text position.
|
protected TextPositionInfo |
getTextPositionNearby(TextPositionInfo posInfo,
java.awt.Point point)
Returns the text position at the specified point nearby the specified
text position.
|
protected TextPositionInfo |
getTextPositionNextTo(TextPositionInfo posInfo)
Returns the text position next to the specified text position.
|
protected TextPositionInfo |
getTextPositionPrevTo(TextPositionInfo posInfo)
Returns the text position previous to the specified text position.
|
int |
getVBlockIncrement()
Gets the vertical block value increment for the scrollable object.
|
protected TextPositionInfo |
getVisibleBegin()
Returns the beginning text position of the view port.
|
protected TextPositionInfo |
getVisibleEnd()
Returns the ending text position of the view port.
|
int |
getVMaximum()
Gets the vertical maximum value of the scrollable object.
|
int |
getVMinimum()
Gets the vertical minimum value of the scrollable object.
|
int |
getVUnitIncrement()
Gets the vertical unit value increment for the scrollable object.
|
int |
getVValue()
Gets the vertical current value of the scrollable object.
|
int |
getVVisibleAmount()
Gets the vertical length of the propertional indicator.
|
protected void |
hideSelection()
Hides the selection.
|
boolean |
isFocusTraversable()
Tests if the view can be traversed using Tab or Shift-Tab keyboard
focus traversal.
|
boolean |
isSelectionVisible()
Tests if the selection is visible.
|
protected void |
layoutResized(int oldLayoutWidth,
int oldLayoutHeight)
Informs scroll listeners that the text layout of this view is resized.
|
protected boolean |
needsToRedrawSelection()
Tests if the selection is needed to be redrawn.
|
protected void |
notifyScrollListeners(ScrollEvent event)
Notifies the specified scroll event to the scroll listeners.
|
protected void |
paint(java.awt.Graphics g,
TextPositionInfo begin,
TextPositionInfo end)
Paints this view with the specified range.
|
protected void |
paintOn(java.awt.Graphics _g)
Paints this view.
|
void |
removeScrollListener(ScrollListener l)
Removes an scroll listener.
|
protected void |
resetLocationOfText()
Resets the location of the layout text.
|
protected boolean |
scrollTo(java.awt.Point p)
Scrolls this view to the specified point, if possible.
|
protected boolean |
scrollTo(TextPositionInfo posInfo)
Scrolls this view to the specified text position, if possible.
|
protected void |
scrollX(int x)
Scrolls this component horizontally to the specified x-position.
|
protected void |
scrollX(int x,
boolean emitEvent)
Scrolls this component horizontally to the specified x-position.
|
protected boolean |
scrollXTo(int x)
Scrolls this view horizontally to the specified x-position, if possible.
|
protected boolean |
scrollXTo(TextPositionInfo posInfo)
Scrolls this view horizontally to the specified text position,
if possible.
|
protected void |
scrollY(int y)
Scrolls this component vertically to the specified y-position.
|
protected void |
scrollY(int y,
boolean emitEvent)
Scrolls this component vertically to the specified y-position.
|
protected boolean |
scrollYTo(int y)
Scrolls this view vertically to the specified y-position, if possible.
|
protected boolean |
scrollYTo(TextPositionInfo posInfo)
Scrolls this view vertically to the specified text position,
if possible.
|
void |
setBounds(int x,
int y,
int width,
int height)
Moves and resizes this view.
|
void |
setHValue(int v)
Sets the horizontal current value of the scrollable object.
|
void |
setLineWrap(int lineWrap)
Sets the line wrapping style.
|
protected void |
setLineWrapInner(int lineWrap) |
void |
setLocale(java.util.Locale l)
Sets the locale of this view.
|
void |
setLocationOfText(java.awt.Point p)
Sets the location of the
TextLayout object. |
void |
setSelectionBackground(java.awt.Color c)
Sets the selection background color.
|
void |
setSelectionForeground(java.awt.Color c)
Sets the selection foreground color.
|
void |
setSelectionVisible(boolean b)
Makes the selection visible.
|
protected void |
setTextLayout(TextLayout layout)
Sets the
TextLayout object of this view. |
void |
setVValue(int v)
Sets the vertical current value of the scrollable object.
|
protected void |
showSelection()
Shows the selection.
|
addNotify, bounds, disable, doLayout, enable, enable, getBounds, getFrame, getLocation, getPreferredGraphics, getPreferredGraphics, getSize, getToolTipText, getToolTipVisual, hide, isDirectNotification, isDoubleBuffered, layout, location, minimumSize, paint, postOldEvent, preferredSize, processMouseEvent, processMouseMotionEvent, repaintNow, requestFocus, reshape, setBackground, setDoubleBuffered, setEnabled, 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, getInputMethodRequests, 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, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setIgnoreRepaint, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validateprotected TextLayout layout
protected int lineWrap
protected java.awt.Point offset
protected boolean selectionVisible
protected boolean selectionShowing
protected java.awt.Color selectionForeground
protected java.awt.Color selectionBackground
protected transient java.util.Vector scrollListeners
protected transient TextPositionInfo _visibleBegin
protected transient TextPositionInfo _visibleEnd
protected boolean scrolledUp
protected boolean scrolledDown
protected boolean scrolledLeft
protected boolean scrolledRight
public static final java.awt.Color DEFAULT_FOREGROUND
public static final java.awt.Color DEFAULT_BACKGROUND
public static final java.awt.Color DEFAULT_SELECTION_FOREGROUND
public static final java.awt.Color DEFAULT_SELECTION_BACKGROUND
public TextView(int lineWrap)
lineWrap - the line wrapping style.RichTextStyle.CHAR_WRAP,
RichTextStyle.WORD_WRAP,
RichTextStyle.NO_WRAPpublic abstract RichText getRichText()
RichText object being viewed.protected TextLayout createTextLayout()
TextLayout object.protected void setTextLayout(TextLayout layout)
TextLayout object of this view.public int getLineWrap()
setLineWrap(int)public void setLineWrap(int lineWrap)
lineWrap - the line wrapping style.getLineWrap(),
RichTextStyle.CHAR_WRAP,
RichTextStyle.WORD_WRAP,
RichTextStyle.NO_WRAPprotected void setLineWrapInner(int lineWrap)
public void setLocale(java.util.Locale l)
setLocale クラス内 java.awt.Componentpublic boolean isFocusTraversable()
isFocusTraversable クラス内 KComponentpublic java.awt.Point getLocationOfText()
TextLayout object.public void setLocationOfText(java.awt.Point p)
TextLayout object.getLocationOfText()public boolean isSelectionVisible()
public void setSelectionVisible(boolean b)
isSelectionVisible()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.Dimension getPreferredSize()
getPreferredSize クラス内 KComponentpublic java.awt.Dimension getMinimumSize()
getMinimumSize クラス内 KComponentpublic java.awt.Dimension getPreferredSize(int rows,
int columns)
rows - the number of rows.columns - the number of columns.public int getPreferredWidth(int columns)
columns - the number of columns.public int getPreferredHeight(int rows)
rows - the number of rows.public int getRows()
public int getColumns()
public void setBounds(int x,
int y,
int width,
int height)
setBounds クラス内 KComponentx - The new x-coordinate of this view.y - The new y-coordinate of this view.width - The new width of this view.height - The new height of this view.protected void resetLocationOfText()
protected void paintOn(java.awt.Graphics _g)
paintOn クラス内 KComponentprotected void paint(java.awt.Graphics g,
TextPositionInfo begin,
TextPositionInfo end)
protected void showSelection()
protected void hideSelection()
public int getVMinimum()
getVMinimum インタフェース内 ScrollableScrollablepublic int getHMinimum()
getHMinimum インタフェース内 ScrollableScrollablepublic int getVMaximum()
getVMaximum インタフェース内 ScrollableScrollablepublic int getHMaximum()
getHMaximum インタフェース内 ScrollableScrollablepublic int getVUnitIncrement()
getVUnitIncrement インタフェース内 ScrollableScrollablepublic int getHUnitIncrement()
getHUnitIncrement インタフェース内 ScrollableScrollablepublic int getVBlockIncrement()
getVBlockIncrement インタフェース内 ScrollableScrollablepublic int getHBlockIncrement()
getHBlockIncrement インタフェース内 ScrollableScrollablepublic int getVVisibleAmount()
getVVisibleAmount インタフェース内 ScrollableScrollablepublic int getHVisibleAmount()
getHVisibleAmount インタフェース内 ScrollableScrollablepublic int getVValue()
getVValue インタフェース内 ScrollableScrollablepublic int getHValue()
getHValue インタフェース内 ScrollableScrollablepublic void setVValue(int v)
setVValue インタフェース内 Scrollablev - the current value.Scrollablepublic void setHValue(int v)
setHValue インタフェース内 Scrollablev - the current value.Scrollablepublic void addScrollListener(ScrollListener l)
addScrollListener インタフェース内 Scrollablel - the listener to recieve events.Scrollablepublic void removeScrollListener(ScrollListener l)
removeScrollListener インタフェース内 Scrollablel - the listener being removed.Scrollableprotected void notifyScrollListeners(ScrollEvent event)
protected void scrollX(int x)
protected void scrollX(int x,
boolean emitEvent)
x - the x-position.emitEvent - if true, emits a ScrollEvent object.protected void scrollY(int y)
protected void scrollY(int y,
boolean emitEvent)
x - the y-position.emitEvent - if true, emits a ScrollEvent object.protected boolean scrollTo(java.awt.Point p)
protected boolean scrollXTo(int x)
protected boolean scrollYTo(int y)
protected boolean scrollTo(TextPositionInfo posInfo)
protected boolean scrollXTo(TextPositionInfo posInfo)
protected boolean scrollYTo(TextPositionInfo posInfo)
protected int getScrollXTo(TextPositionInfo posInfo)
protected int getScrollYTo(TextPositionInfo posInfo)
protected void layoutResized(int oldLayoutWidth,
int oldLayoutHeight)
oldLayoutWidth - the old layout width.oldLayoutHeight - the old layout height.protected TextPositionInfo getVisibleBegin()
protected TextPositionInfo getVisibleEnd()
protected boolean needsToRedrawSelection()
protected TextPositionInfo getTextPositionAt(int textIndex)
protected TextPositionInfo getTextPositionAt(java.awt.Point point)
protected TextPositionInfo getTextPositionNearby(TextPositionInfo posInfo, int textIndex)
protected TextPositionInfo getTextPositionNearby(TextPositionInfo posInfo, java.awt.Point point)
protected TextPositionInfo getTextPositionNextTo(TextPositionInfo posInfo)
protected TextPositionInfo getTextPositionPrevTo(TextPositionInfo posInfo)
protected TextLineInfo getTextLineAt(int lineIndex)