|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
java.lang.Objectjavax.swing.text.View
javax.swing.text.CompositeView
javax.swing.text.BoxView
javax.swing.text.FlowView
public abstract class FlowView
試圖將其子級串流入某個部分受約束的空間的視圖。此視圖可用於建構段落、頁面等。該串流由以下幾項功能組成。
View| 巢狀類別摘要 | |
|---|---|
static class |
FlowView.FlowStrategy
維護串流的物理形式的策略。 |
| 欄位摘要 | |
|---|---|
protected View |
layoutPool
這些都是表示此視圖表示的元素(要轉換為物理視圖的邏輯視圖)的子元素的視圖。 |
protected int |
layoutSpan
創建串流所依靠的預設約束。 |
protected FlowView.FlowStrategy |
strategy
保持串流更新的行為。 |
| 從類別 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 |
| 建構子摘要 | |
|---|---|
FlowView(Element elem,
int axis)
建構給定元素的 FlowView。 |
|
| 方法摘要 | |
|---|---|
protected SizeRequirements |
calculateMinorAxisRequirements(int axis,
SizeRequirements r)
計算沿輔軸的要求。 |
void |
changedUpdate(DocumentEvent changes,
Shape a,
ViewFactory f)
發出通知,通知文檔中此視圖負責的某個位置的屬性已更改。 |
protected abstract View |
createRow()
創建應在保持串流中子級行值時使用的視圖。 |
int |
getFlowAxis()
獲取應沿其串流入視圖的軸。 |
int |
getFlowSpan(int index)
獲取給定子索引串流入的約束區域。 |
int |
getFlowStart(int index)
獲取沿串流軸的串流區域開始位置。 |
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)
載入初始化該視圖的所有子級。 |
void |
removeUpdate(DocumentEvent changes,
Shape a,
ViewFactory f)
發出通知,通知從文檔中此視圖負責的某個位置已移除內容。 |
void |
setParent(View parent)
設置此視圖的父級。 |
| 從類別 javax.swing.text.View 繼承的方法 |
|---|
append, breakView, createFragment, forwardUpdateToView, getAttributes, getBreakWeight, getContainer, getDocument, getElement, getEndOffset, getGraphics, getParent, getStartOffset, getToolTipText, getViewFactory, getViewIndex, insert, isVisible, modelToView, remove, removeAll, updateChildren, updateLayout, viewToModel |
| 從類別 java.lang.Object 繼承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 欄位詳細資訊 |
|---|
protected int layoutSpan
protected View layoutPool
protected FlowView.FlowStrategy strategy
| 建構子詳細資訊 |
|---|
public FlowView(Element elem,
int axis)
elem - 此視圖負責的元素axis - 可以是 View.X_AXIS 或 View.Y_AXIS 之一| 方法詳細資訊 |
|---|
public int getFlowAxis()
FlowStrategy 使用。
public int getFlowSpan(int index)
index - 正在更新的行的索引。這應該是一個 >= 0 且 < getViewCount() 的值。getFlowStart(int)public int getFlowStart(int index)
index - 正在更新的行的索引。這應該是一個 >= 0 且 < getViewCount() 的值。getFlowSpan(int)protected abstract View createRow()
protected void loadChildren(ViewFactory f)
setParent 方法調用。重新實作此方法,以便不直接載入任何子級(因為它們是在格式化進程中創建的)。如果 layoutPool 變數為 null,則創建一個 LogicalView 實例,表示在格式化進程中使用的邏輯視圖。
CompositeView 中的 loadChildrenf - 視圖處理器CompositeView.setParent(javax.swing.text.View)protected int getViewIndexAtPosition(int pos)
CompositeView 中的 getViewIndexAtPositionpos - 位置,該值 >= 0
protected void layout(int width,
int height)
BoxView 中的 layoutwidth - 要按其佈置的寬度,該值 >= 0。這是 inset 區域內的寬度。height - 按其佈置的高度,該值 >= 0。這是 inset 區域內的高度。
protected SizeRequirements calculateMinorAxisRequirements(int axis,
SizeRequirements r)
BoxView 中的 calculateMinorAxisRequirementsaxis - 所考察的軸r - SizeRequirements 物件;如果為 null,將創建一個物件
SizeRequirements 物件SizeRequirements
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 setParent(View parent)
loadChildren 方法。不應在建構子中載入子級,因為設置父級的動作可能引起它們試圖沿層次結構向上搜尋,例如,要獲得承載 Container。如果此視圖有子級(視圖從視圖層次結構中的一個位置移動到另一個位置),則不調用 loadChildren 方法。
CompositeView 中的 setParentparent - 視圖的父級,如果沒有則為 null
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。