|
Java プラットフォーム 1.2 |
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Object | +--javax.swing.text.View | +--javax.swing.text.CompositeView
子ボックスを持つテキストモデルのビューです。行、あるいは段落のコレクションなどを表示するのに便利です。ボックスが水平方向の場合は、折り返しのない行の表示に使えます。
クラス javax.swing.text.View から継承したフィールド |
BadBreakWeight,
ExcellentBreakWeight,
ForcedBreakWeight,
GoodBreakWeight,
X_AXIS,
Y_AXIS |
コンストラクタの概要 | |
CompositeView(Element elem)
指定された要素の CompositeView を構築します。 |
メソッドの概要 | |
void |
append(View v)
子ビューを 1 つ追加します。 |
protected abstract void |
childAllocation(int index,
Rectangle a)
指定された子への割り当てを返します。 |
protected boolean |
flipEastAndWestAtEnds(int position,
Position.Bias bias)
サブクラスでは、位置に基づく条件を満たす場合に true を返すように、このメソッドをオーバーライドできます。 |
protected short |
getBottomInset()
下のインセットを取得します。 |
Shape |
getChildAllocation(int index,
Shape a)
指定された子ビューへの割り当てを取得します。 |
protected Rectangle |
getInsideAllocation(Shape a)
ビューに指定された割り当てを、内部の構成に使用する割り当てに変換します。 |
protected short |
getLeftInset()
左のインセットを取得します。 |
protected int |
getNextEastWestVisualPositionFrom(int pos,
Position.Bias b,
Shape a,
int direction,
Position.Bias[] biasRet)
カーソルを置くことのできる、次の視覚的な位置を返します。 |
protected int |
getNextNorthSouthVisualPositionFrom(int pos,
Position.Bias b,
Shape a,
int direction,
Position.Bias[] biasRet)
カーソルを置くことのできる、次の視覚的な位置を返します。 |
int |
getNextVisualPositionFrom(int pos,
Position.Bias b,
Shape a,
int direction,
Position.Bias[] biasRet)
キャレットを置くことのできる、次に視覚的に表示されるモデル内の位置を判断する方法を提供します。 |
protected short |
getRightInset()
右のインセットを取得します。 |
protected short |
getTopInset()
上のインセットを取得します。 |
View |
getView(int n)
コンテナ内の n 番目のビューを取得します。 |
protected abstract View |
getViewAtPoint(int x,
int y,
Rectangle alloc)
指定された点の子ビューを取得します。 |
protected View |
getViewAtPosition(int pos,
Rectangle a)
モデル内の指定された位置を示す子ビューを取得します。 |
int |
getViewCount()
このビューにあるビューの数を返します。 |
protected int |
getViewIndexAtPosition(int pos)
モデル内の指定された位置を表す、子ビューのインデックスを取得します。 |
void |
insert(int offs,
View v)
子ビューを 1 つ挿入します。 |
protected abstract boolean |
isAfter(int x,
int y,
Rectangle alloc)
ある点が、矩形範囲の後にあるかどうかを判定します。 |
protected abstract boolean |
isBefore(int x,
int y,
Rectangle alloc)
ある点が、矩形範囲の前にあるかどうかを判定します。 |
protected void |
loadChildren(ViewFactory f)
子をすべてロードして、ビューを初期化します。 |
Shape |
modelToView(int p0,
Position.Bias b0,
int p1,
Position.Bias b1,
Shape a)
ドキュメントモデルの座標空間から、ビューの座標空間へのマッピングを提供します。 |
Shape |
modelToView(int pos,
Shape a,
Position.Bias b)
ドキュメントモデルの座標空間から、それにマップされているビューの座標空間へのマッピングを提供します。 |
void |
removeAll()
子をすべて削除します。 |
void |
replace(int offset,
int length,
View[] views)
レイアウトを無効にし、要求/割り当てのキャッシュのサイズを変更して、子ビューの置き換えができるようにします。 |
protected void |
setInsets(short top,
short left,
short bottom,
short right)
ビューのインセットを設定します。 |
protected void |
setParagraphInsets(AttributeSet attr)
指定された属性から選ばれた段落属性から、インセットを設定します。 |
void |
setParent(View parent)
ビューの親を設定します。 |
int |
viewToModel(float x,
float y,
Shape a,
Position.Bias[] bias)
ビューの座標空間から、モデルの論理座標空間へのマッピングを提供します。 |
クラス javax.swing.text.View から継承したメソッド |
breakView,
changedUpdate,
createFragment,
getAlignment,
getAttributes,
getBreakWeight,
getContainer,
getDocument,
getElement,
getEndOffset,
getMaximumSpan,
getMinimumSpan,
getParent,
getPreferredSpan,
getResizeWeight,
getStartOffset,
getViewFactory,
insertUpdate,
isVisible,
modelToView,
paint,
preferenceChanged,
removeUpdate,
setSize,
viewToModel |
クラス java.lang.Object から継承したメソッド |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
コンストラクタの詳細 |
public CompositeView(Element elem)
elem
- このビューが扱う要素メソッドの詳細 |
protected void loadChildren(ViewFactory f)
setParent
メソッドによって呼び出されます。サブクラスは、これの実装をやり直して、子ビューを違った形に初期化することもできます。デフォルトの実装では、個々の子要素に子ビューが作成されます。f
- ビューファクトリpublic void removeAll()
public void insert(int offs, View v)
offs
- ビューを挿入する位置のオフセット >= 0v
- ビューpublic void append(View v)
v
- ビューpublic void replace(int offset, int length, View[] views)
offset
- 子ビューの挿入位置のオフセット >= 0length
- 影響を受ける子ビューの数 >= 0views
- 置き換えに使用する子ビューpublic void setParent(View parent)
loadChildren
メソッドの呼び出しとともにスーパークラスの動作を提供するために実装し直されます。子をコンストラクタの中にロードしないようにしてください。これは、親を設定する動作が原因となって、たとえば収容側コンテナを取得するために、子が階層をさかのぼって検索しようとするからです。parent
- ビューの親。ない場合は nullpublic int getViewCount()
getView(int)
public View getView(int n)
n
- 取得するビューの番号 >= 0 && < getViewCount()public Shape getChildAllocation(int index, Shape a)
index
- 子のインデックス >= 0 && < getViewCount()a
- ビューへの割り当てpublic Shape modelToView(int pos, Shape a, Position.Bias b) throws BadLocationException
pos
- 変換する位置 >= 0a
- 描画に割り当てられた領域View.modelToView(int, java.awt.Shape, javax.swing.text.Position.Bias)
public Shape modelToView(int p0, Position.Bias b0, int p1, Position.Bias b1, Shape a) throws BadLocationException
p0
- 変換する位置 >= 0b0
- p0 で表現される文字の直前または直後方向へのバイアス。位置が 2 つのビューの境界の場合に使用p1
- 変換する位置 >= 0b1
- p1 で表現される文字の直前または直後方向へのバイアス。位置が 2 つのビューの境界の場合に使用a
- 描画先として割り当てられた領域View.viewToModel(float, float, java.awt.Shape, javax.swing.text.Position.Bias[])
public int viewToModel(float x, float y, Shape a, Position.Bias[] bias)
x
- 変換するビュー位置の x 座標 >= 0y
- 変換するビュー位置の y 座標 >= 0a
- 描画に割り当てられた領域View.viewToModel(float, float, java.awt.Shape, javax.swing.text.Position.Bias[])
public int getNextVisualPositionFrom(int pos, Position.Bias b, Shape a, int direction, Position.Bias[] biasRet) throws BadLocationException
pos
- 変換する位置 >= 0a
- 描画先として割り当てられた領域direction
- キーボードにある矢印キーに対応する、現在位置からの方向。SwingConstants.WEST、SwingConstants.EAST、SwingConstants.NORTH、SwingConstants.SOUTH のどれかを指定するprotected abstract boolean isBefore(int x, int y, Rectangle alloc)
x
- x 座標 >= 0y
- y 座標 >= 0alloc
- 矩形protected abstract boolean isAfter(int x, int y, Rectangle alloc)
x
- x 座標 >= 0y
- y 座標 >= 0alloc
- 矩形protected abstract View getViewAtPoint(int x, int y, Rectangle alloc)
x
- x 座標 >= 0y
- y 座標 >= 0alloc
- 入り口での親の割り当て。出口では、子への割り当てに変更されるprotected abstract void childAllocation(int index, Rectangle a)
index
- 子のインデックス >= 0 && < getViewCount()a
- 入り口での、ボックスの内部への割り当て。および、出口での、割り当てられた位置を含むビューへの割り当てprotected View getViewAtPosition(int pos, Rectangle a)
pos
- 位置 >= 0a
- 入り口での、ボックスの内部への割り当て。および、出口での、割り当てられた位置を含むビューへの割り当てprotected int getViewIndexAtPosition(int pos)
pos
- 位置 >= 0protected Rectangle getInsideAllocation(Shape a)
a
- ビューに指定された割り当てprotected final void setParagraphInsets(AttributeSet attr)
attr
- 属性protected final void setInsets(short top, short left, short bottom, short right)
top
- 上のインセット >= 0left
- 左のインセット >= 0bottom
- 下のインセット >= 0right
- 右のインセット >= 0protected final short getLeftInset()
protected final short getRightInset()
protected final short getTopInset()
protected final short getBottomInset()
protected int getNextNorthSouthVisualPositionFrom(int pos, Position.Bias b, Shape a, int direction, Position.Bias[] biasRet) throws BadLocationException
protected int getNextEastWestVisualPositionFrom(int pos, Position.Bias b, Shape a, int direction, Position.Bias[] biasRet) throws BadLocationException
protected boolean flipEastAndWestAtEnds(int position, Position.Bias bias)
|
Java プラットフォーム 1.2 |
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |