public class PlainView extends View implements TabExpander
View| 修飾子と型 | フィールドと説明 |
|---|---|
protected FontMetrics |
metrics
現在のフォントのフォント・メトリックスです。
|
BadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, X_AXIS, Y_AXISBOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST| 修飾子と型 | メソッドと説明 |
|---|---|
void |
changedUpdate(DocumentEvent changes, Shape a, ViewFactory f)
このビューが扱う位置で属性が変更されたことをドキュメントから通知します。
|
protected void |
damageLineRange(int line0, int line1, Shape a, Component host)
指定された行範囲を再ペイントします。
|
protected void |
drawLine(int lineIndex, Graphics g, int x, int y)
末尾の余白を抑止し、タブを拡張しながら、1行のテキストをレンダリングします。
|
protected int |
drawSelectedText(Graphics g, int x, int y, int p0, int p1)
モデル内の指定された範囲を、選択されたテキストとしてレンダリングします。
|
protected int |
drawUnselectedText(Graphics g, int x, int y, int p0, int p1)
モデル内の指定された範囲を通常の選択されていないテキストとしてレンダリングします。
|
protected Segment |
getLineBuffer()
関連するドキュメントからテキストを取得するために使用できるバッファへのアクセスを提供します。
|
float |
getPreferredSpan(int axis)
このビューに適切なスパンを軸に沿って指定します。
|
protected int |
getTabSize()
ドキュメントに設定されたタブのサイズを返します。デフォルトは8です。
|
void |
insertUpdate(DocumentEvent changes, Shape a, ViewFactory f)
このビューが扱う位置でドキュメントに何かが挿入されたことを通知します。
|
protected Rectangle |
lineToRect(Shape a, int line)
指定した行を表す矩形を判別します。
|
Shape |
modelToView(int pos, Shape a, Position.Bias b)
ドキュメント・モデルの座標空間からビューの座標空間へのマッピングを提供します。
|
float |
nextTabStop(float x, int tabOffset)
指定された参照位置より後ろの次のタブストップ位置を返します。
|
void |
paint(Graphics g, Shape a)
指定されたレンダリング表面およびその表面上の領域を使ってレンダリングします。
|
void |
removeUpdate(DocumentEvent changes, Shape a, ViewFactory f)
このビューが扱うドキュメント内の位置から何かが削除されたということを通知します。
|
void |
setSize(float width, float height)
ビューのサイズを設定します。
|
protected void |
updateDamage(DocumentEvent changes, Shape a, ViewFactory f)
指定されたドキュメント・イベントでカバーされる変更領域を再ペイントします。
|
protected void |
updateMetrics()
フォント・メトリックスと最長の線が最新であるかどうかを確認します。
|
int |
viewToModel(float fx, float fy, Shape a, Position.Bias[] bias)
ビューの座標空間からモデルの論理座標空間へのマッピングを提供します。
|
append, breakView, createFragment, forwardUpdate, forwardUpdateToView, getAlignment, getAttributes, getBreakWeight, getChildAllocation, getContainer, getDocument, getElement, getEndOffset, getGraphics, getMaximumSpan, getMinimumSpan, getNextVisualPositionFrom, getParent, getResizeWeight, getStartOffset, getToolTipText, getView, getViewCount, getViewFactory, getViewIndex, getViewIndex, insert, isVisible, modelToView, modelToView, preferenceChanged, remove, removeAll, replace, setParent, updateChildren, updateLayout, viewToModelprotected FontMetrics metrics
public PlainView(Element elem)
elem - 要素protected int getTabSize()
protected void drawLine(int lineIndex,
Graphics g,
int x,
int y)
drawUnselectedTextおよびdrawSelectedTextメソッドを呼び出すために実装されます。lineIndex - 描画する行>= 0g - Graphicsコンテキストx - 開始X位置>= 0y - 開始Y位置>= 0drawUnselectedText(java.awt.Graphics, int, int, int, int), drawSelectedText(java.awt.Graphics, int, int, int, int)protected int drawUnselectedText(Graphics g, int x, int y, int p0, int p1) throws BadLocationException
g - グラフィックス・コンテキストx - 開始X座標>= 0y - 開始Y座標>= 0p0 - モデル内の開始位置>= 0p1 - モデル内の終了位置>= 0BadLocationException - 範囲が無効な場合protected int drawSelectedText(Graphics g, int x, int y, int p0, int p1) throws BadLocationException
g - グラフィックス・コンテキストx - 開始X座標>= 0y - 開始Y座標>= 0p0 - モデル内の開始位置>= 0p1 - モデル内の終了位置>= 0BadLocationException - 範囲が無効な場合protected final Segment getLineBuffer()
protected void updateMetrics()
public float getPreferredSpan(int axis)
getPreferredSpan、クラス: Viewaxis - View.X_AXISまたはView.Y_AXISIllegalArgumentException - 軸が無効な場合View.getPreferredSpan(int)public void paint(Graphics g, Shape a)
paint、クラス: Viewg - 使用する描画表面a - 描画するために割り当てられた領域View.paint(java.awt.Graphics, java.awt.Shape)public Shape modelToView(int pos, Shape a, Position.Bias b) throws BadLocationException
modelToView、クラス: Viewpos - 変換対象の位置>= 0a - 描画するために割り当てられた領域b - 位置が2つのビューの境界である場合に、オフセットによって表される直前の文字または次の文字へのバイアス。bの値は次のどれかになる。
Position.Bias.Forward
Position.Bias.Backward
BadLocationException - 指定された位置が、関連するドキュメント内の有効な位置を示さない場合View.modelToView(int, java.awt.Shape, javax.swing.text.Position.Bias)public int viewToModel(float fx,
float fy,
Shape a,
Position.Bias[] bias)
viewToModel、クラス: Viewfx - X座標>= 0fy - Y座標>= 0a - 描画するために割り当てられた領域View.viewToModel(float, float, java.awt.Shape, javax.swing.text.Position.Bias[])public void insertUpdate(DocumentEvent changes, Shape a, ViewFactory f)
insertUpdate、クラス: Viewchanges - 関連するドキュメントからの変更情報a - ビューの現在の割当てf - ビューが子を持つ場合に再構築に使用するファクトリView.insertUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)public void removeUpdate(DocumentEvent changes, Shape a, ViewFactory f)
removeUpdate、クラス: Viewchanges - 関連するドキュメントからの変更情報a - ビューの現在の割当てf - ビューが子を持つ場合に再構築に使用するファクトリView.removeUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)public void changedUpdate(DocumentEvent changes, Shape a, ViewFactory f)
changedUpdate、クラス: Viewchanges - 関連するドキュメントからの変更情報a - ビューの現在の割当てf - ビューが子を持つ場合に再構築に使用するファクトリView.changedUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)public void setSize(float width,
float height)
public float nextTabStop(float x,
int tabOffset)
nextTabStop、インタフェース: TabExpanderx - 現在位置>= 0tabOffset - タブが発生するテキスト・ストリーム内の位置>= 0。protected void updateDamage(DocumentEvent changes, Shape a, ViewFactory f)
protected void damageLineRange(int line0,
int line1,
Shape a,
Component host)
host - ビューを収容するコンポーネント(再描画の呼出しに使用)a - 描画のためにビューに割り当てられた領域line0 - 再描画の開始行番号。モデル内の有効な行番号である必要がある。line1 - 再描画の終了行番号。モデル内の有効な行番号である必要がある。 バグまたは機能を送信
詳細なAPIリファレンスおよび開発者ドキュメントについては、Java SEのドキュメントを参照してください。そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。
Copyright© 1993, 2014, Oracle and/or its affiliates. All rights reserved.