|
Java プラットフォーム 1.2 |
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Object | +--javax.swing.text.View | +--javax.swing.text.CompositeView | +--javax.swing.text.BoxView | +--javax.swing.text.ParagraphView
複数のフォント、色、コンポーネント、アイコンなどをサポートする単純な行折り返し段落のビューです。これは基本的に、周囲にマージンがある垂直ボックスです。ボックスのコンテンツは、特殊な水平ボックスである行の集まりです。このビューは、段落要素の子要素を表すビューのコレクションを作成します。こうした各ビューは、ビューが 1 行に収まる場合には行に直接配置され、そうでない場合には breakView
メソッドが呼び出されて各行に分割して収めるように試みられます。
View
フィールドの概要 | |
protected int |
firstLineIndent
左側からのインセットによる先頭行のインデントです。 |
クラス javax.swing.text.View から継承したフィールド |
BadBreakWeight,
ExcellentBreakWeight,
ForcedBreakWeight,
GoodBreakWeight,
X_AXIS,
Y_AXIS |
コンストラクタの概要 | |
ParagraphView(Element elem)
指定された要素の ParagraphView を構築します。 |
メソッドの概要 | |
protected void |
adjustRow(javax.swing.text.ParagraphView.Row r,
int desiredSpan,
int x)
指定された行を可能であれば調整して、配置スパン内に収めるようにします。 |
View |
breakView(int axis,
float len,
Shape a)
このビューを指定された軸に沿って指定された長さで分割します。 |
protected SizeRequirements |
calculateMinorAxisRequirements(int axis,
SizeRequirements r)
|
void |
changedUpdate(DocumentEvent changes,
Shape a,
ViewFactory f)
このビューが担当する位置で属性が変更されたということをドキュメントから通知します。 |
protected int |
findOffsetToCharactersInString(char[] string,
int start)
ドキュメント内の次の文字を string 内の任意の文字を使って検索します。 |
protected boolean |
flipEastAndWestAtEnds(int position,
Position.Bias bias)
|
float |
getAlignment(int axis)
このビューの望ましい配置を軸に沿って指定します。 |
int |
getBreakWeight(int axis,
float len)
指定された位置の分割ウェイトを取得します。 |
protected int |
getClosestPositionTo(int pos,
Position.Bias b,
Shape a,
int direction,
Position.Bias[] biasRet,
int rowIndex,
int x)
x にもっとも近接したモデル内の位置を返します。 |
protected View |
getLayoutView(int index)
段落の子ビューは、子要素を表すビューの各部分を配列するために使用されたいくつかの行です。 |
protected int |
getLayoutViewCount()
段落の子ビューは、子要素を表すビューの各部分を配列するために使用されたいくつかの行です。 |
protected int |
getNextNorthSouthVisualPositionFrom(int pos,
Position.Bias b,
Shape a,
int direction,
Position.Bias[] biasRet)
CompositeView クラスの同名のメソッドのオーバーライドです。 |
protected float |
getPartialSize(int startOffset,
int endOffset)
startOffset と endOffset の間のビューが使うサイズを返します。 |
protected float |
getTabBase()
|
protected TabSet |
getTabSet()
タブの計算で使う TabSet を取得します。 |
protected View |
getViewAtPosition(int pos,
Rectangle a)
モデル内の指定された位置を表す子ビューを取得します。 |
protected int |
getViewIndexAtPosition(int pos)
モデル内の指定された位置を表す子ビューのインデックスを取得します。 |
void |
insertUpdate(DocumentEvent changes,
Shape a,
ViewFactory f)
このビューが担当するドキュメント内の位置に何かが挿入されたということを通知します。 |
protected void |
layout(int width,
int height)
複数の子を配置します。 |
protected void |
loadChildren(ViewFactory f)
子をすべてロードしてビューを初期化します。 |
float |
nextTabStop(float x,
int tabOffset)
参照位置を指定された次のタブストップ位置を返します。 |
void |
paint(Graphics g,
Shape a)
指定された描画表面とその領域を使って描画します。 |
void |
removeUpdate(DocumentEvent changes,
Shape a,
ViewFactory f)
このビューが担当するドキュメント内の位置から何かが削除されたということを通知します。 |
protected void |
setFirstLineIndent(float fi)
先頭行のインデントを設定します。 |
protected void |
setJustification(int j)
行揃えのタイプを設定します。 |
protected void |
setLineSpacing(float ls)
行間隔を設定します。 |
protected void |
setPropertiesFromAttributes()
|
クラス javax.swing.text.CompositeView から継承したメソッド |
append,
getBottomInset,
getChildAllocation,
getInsideAllocation,
getLeftInset,
getNextEastWestVisualPositionFrom,
getNextVisualPositionFrom,
getRightInset,
getTopInset,
getView,
getViewCount,
insert,
modelToView,
removeAll,
setInsets,
setParagraphInsets,
setParent |
クラス javax.swing.text.View から継承したメソッド |
breakView,
createFragment,
getAttributes,
getBreakWeight,
getContainer,
getDocument,
getElement,
getEndOffset,
getParent,
getStartOffset,
getViewFactory,
isVisible,
modelToView,
viewToModel |
クラス java.lang.Object から継承したメソッド |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
フィールドの詳細 |
protected int firstLineIndent
コンストラクタの詳細 |
public ParagraphView(Element elem)
elem
- このビューが担当する要素メソッドの詳細 |
protected void setJustification(int j)
protected void setLineSpacing(float ls)
ls
- ポイント単位の値protected void setFirstLineIndent(float fi)
ls
- ポイント単位の値protected void setPropertiesFromAttributes()
protected int getLayoutViewCount()
protected View getLayoutView(int index)
protected void loadChildren(ViewFactory f)
setParent
メソッドによって呼び出されます。このメソッドを再実装すると、どの子も (書式設定のプロセスで作成されるので) 直接ロードしないようにできます。子要素を表すビューを作成しますが、書式設定のプロセスで使われるプールに配置されます。f
- ビューファクトリprotected View getViewAtPosition(int pos, Rectangle a)
pos
- 検索位置 >= 0a
- 入り口での、ボックスへの割り当て。および、出口での、位置を含むビューの割り当てprotected int getViewIndexAtPosition(int pos)
pos
- 位置 >= 0protected void layout(int width, int height)
preferenceChanged
メソッドが親で呼び出されます。width
- 配置する幅 >= 0。インセット領域内部の幅height
- 配置する高さ >= 0 (段落では使われず、スーパークラスによって使われる)。インセット領域内部の高さprotected void adjustRow(javax.swing.text.ParagraphView.Row r, int desiredSpan, int x)
r
- 現在の配置スパンに調整される行desiredSpan
- 現在の配置スパン >= 0x
- r の開始位置public float nextTabStop(float x, int tabOffset)
getTabbedSpan
を呼び出して子ビューの望ましいスパンを決定します。論理子ビューは、タブの展開方法を認識している段落に対してそのタブ展開を委譲します。そのタブ展開の必要性を段落に委譲するビューには、LabelView
などがあります。
このメソッドを実装すると、段落要素の属性セットで TabSet
を見つけようとします。1 つ見かるとその設定が使われ、それ以外の場合にはデフォルトの展開が提供されます。タブ展開のベース位置は、段落のもっとも近い割り当てからの左インセット (子の配置の基準) です。
x
- X 参照座標tabOffset
- タブが発生するテキストストリーム内の位置 >= 0TabSet
,
TabStop
,
LabelView
protected TabSet getTabSet()
protected float getPartialSize(int startOffset, int endOffset)
startOffset
と endOffset
の間のビューが使うサイズを返します。子ビューが TabableView インタフェースを実装する場合に、これは getPartialView を使ってサイズを計算します。サイズが必要で、View が TabableView インタフェースを実装しない場合は、preferredSpan が使われます。startOffset
- ドキュメントの開始オフセット >= 0endOffset
- ドキュメントの終了オフセット >= startOffsetprotected int findOffsetToCharactersInString(char[] string, int start)
string
内の任意の文字を使って検索します。検索はオフセット start
から開始します。どの文字も見つからない場合は、-1 が返されます。string
- 文字を並べた文字列start
- モデル内の開始位置 >= 0protected float getTabBase()
protected boolean flipEastAndWestAtEnds(int position, Position.Bias bias)
public void paint(Graphics g, Shape a)
g
- 使用する描画表面a
- 描画対象の割り当て領域View.paint(java.awt.Graphics, java.awt.Shape)
protected SizeRequirements calculateMinorAxisRequirements(int axis, SizeRequirements r)
public float getAlignment(int axis)
axis
- View.X_AXIS または View.Y_AXISpublic View breakView(int axis, float len, Shape a)
len
が先頭行の後に位置する場合にのみ分割可能です。axis
- View.X_AXIS または View.Y_AXISlen
- 分割が望まれる位置を、指定された軸に沿って指定する >= 0a
- ビューの現在の割り当てView.breakView(int, int, float, float)
public int getBreakWeight(int axis, float len)
len
が先頭行の後に位置する場合にのみ分割可能です。長さが 1 行に満たない場合は、BadBreakWeight の値が返されます。axis
- View.X_AXIS または View.Y_AXISlen
- 分割が望まれる位置を指定する >= 0View.getBreakWeight(int, float, float)
public void insertUpdate(DocumentEvent changes, Shape a, ViewFactory f)
changes
- 関連付けられているドキュメントからの変更情報a
- ビューの現在の割り当てf
- ビューが子を持つ場合に再構築に使うファクトリView.insertUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)
public void removeUpdate(DocumentEvent changes, Shape a, ViewFactory f)
changes
- 関連付けられているドキュメントからの変更情報a
- ビューの現在の割り当てf
- ビューが子を持つ場合に再構築に使うファクトリView.removeUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)
public void changedUpdate(DocumentEvent changes, Shape a, ViewFactory f)
changes
- 関連付けられているドキュメントからの変更情報a
- ビューの現在の割り当てf
- ビューが子を持つ場合に再構築に使うファクトリView.changedUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)
protected int getNextNorthSouthVisualPositionFrom(int pos, Position.Bias b, Shape a, int direction, Position.Bias[] biasRet) throws BadLocationException
protected int getClosestPositionTo(int pos, Position.Bias b, Shape a, int direction, Position.Bias[] biasRet, int rowIndex, int x) throws BadLocationException
x
にもっとも近接したモデル内の位置を返します。rowIndex
は、検索対象のビューのインデックスを指定します。
|
Java プラットフォーム 1.2 |
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |