|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Objectjavax.swing.text.View
javax.swing.text.PlainView
public class PlainView
フォントと色が 1 種類ずつのテキストを含む単純な複数行テキストビューのために、View インタフェースを実装します。ビューは、子要素をそれぞれ 1 行のテキストで表します。
View| フィールドの概要 | |
|---|---|
protected FontMetrics |
metrics
現在のフォントのフォントメトリックスです。 |
| クラス javax.swing.text.View から継承されたフィールド |
|---|
BadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, X_AXIS, Y_AXIS |
| インタフェース javax.swing.SwingConstants から継承されたフィールド |
|---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| コンストラクタの概要 | |
|---|---|
PlainView(Element elem)
要素でラップされた新しい PlainView を構築します。 |
|
| メソッドの概要 | |
|---|---|
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()
ドキュメントに設定されたタブのサイズを返します。 |
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)
ビューの座標空間からモデルの論理座標空間へのマッピングを提供します。 |
| クラス java.lang.Object から継承されたメソッド |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| フィールドの詳細 |
|---|
protected 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 - モデル内の終了位置 >= 0
BadLocationException - 範囲が無効な場合
protected int drawSelectedText(Graphics g,
int x,
int y,
int p0,
int p1)
throws BadLocationException
g - グラフィックスコンテキストx - 開始 X 座標 >= 0y - 開始 Y 座標 >= 0p0 - モデル内の開始位置 >= 0p1 - モデル内の終了位置 >= 0
BadLocationException - 範囲が無効な場合protected final Segment getLineBuffer()
protected void updateMetrics()
public float getPreferredSpan(int axis)
View 内の getPreferredSpanaxis - View.X_AXIS または View.Y_AXIS
IllegalArgumentException - 軸が無効な場合View.getPreferredSpan(int)
public void paint(Graphics g,
Shape a)
View 内の paintg - 使用する描画表面a - 描画のために割り当てられた領域View.paint(java.awt.Graphics, java.awt.Shape)
public Shape modelToView(int pos,
Shape a,
Position.Bias b)
throws BadLocationException
View 内の modelToViewpos - 変換対象の位置 >= 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)
View 内の viewToModelfx - 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)
View 内の insertUpdatechanges - 関連するドキュメントからの変更情報a - ビューの現在の割り当てf - ビューが子を持つ場合に再構築に使用するファクトリView.insertUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)
public void removeUpdate(DocumentEvent changes,
Shape a,
ViewFactory f)
View 内の removeUpdatechanges - 関連するドキュメントからの変更情報a - ビューの現在の割り当てf - ビューが子を持つ場合に再構築に使用するファクトリView.removeUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)
public void changedUpdate(DocumentEvent changes,
Shape a,
ViewFactory f)
View 内の changedUpdatechanges - 関連するドキュメントからの変更情報a - ビューの現在の割り当てf - ビューが子を持つ場合に再構築に使用するファクトリView.changedUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)
public void setSize(float width,
float height)
View 内の setSizewidth - 幅 >= 0height - 高さ >= 0
public float nextTabStop(float x,
int tabOffset)
TabExpander 内の nextTabStopx - 現在位置 >= 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 - 再描画の終了行番号。モデル内の有効な行番号である必要がある
protected Rectangle lineToRect(Shape a,
int line)
a - 描画のためにビューに割り当てられた領域line - 範囲の検索に使用する行番号。モデル内の有効な行番号である必要がある
|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
Copyright 2009 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Documentation Redistribution Policy も参照してください。