所有类


javax.swing.text
类 AsyncBoxView

java.lang.Object
  继承者 javax.swing.text.View
      继承者 javax.swing.text.AsyncBoxView
所有已实现的接口:
SwingConstants

public class AsyncBoxView
   
   
   
   
extends View

异步执行布局处理的框。此类很有用,因为它可通过不在 GUI 事件线程中执行任何布局处理来保持该线程的持续活动。布局是在子视图的操作粒度上完成的。访问某部分布局的每个子视图后(可能是耗时的操作),可放弃剩余的任务,或者可执行新的、具有更高优先级的任务(如响应一个同步请求或对一个可见区域进行操作)。

访问子视图的同时,要获得关联文档上的读取锁定,这样该模型在被访问时是稳定的。

从以下版本开始:
1.3

嵌套类摘要
 classAsyncBoxView.ChildLocator
          该类在本地化区域发生更改时,管理该本地化区域中子视图的有效位置。
 classAsyncBoxView.ChildState
          表示子视图布局状态的记录。
 
字段摘要
protected  AsyncBoxView.ChildLocatorlocator
          这是管理子视图偏移量的对象。
 
从类 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
 
构造方法摘要
AsyncBoxView(Element elem, int axis)
          构造执行异步布局处理的 BoxView。
 
方法摘要
protected  AsyncBoxView.ChildStatecreateChildState(View v)
          通过此方法创建新的 ChildState 记录,以允许扩展 ChildState 记录的子类执行/保存更多状态。
protected  voidflushRequirementChanges()
          将首选项中的更改向上发布到父视图。
 floatgetBottomInset()
          获得视图四周底部的空白部分。
 ShapegetChildAllocation(int index, Shape a)
          获取给定子视图的分配区域。
protected  AsyncBoxView.ChildStategetChildState(int index)
          获取对象,该对象表示在给定索引位置的子视图的布局状态。
protected  booleangetEstimatedMajorSpan()
          主跨距当前是估计值吗?
protected  floatgetInsetSpan(int axis)
          获取 insets 所占据的沿某个轴的跨距。
protected  LayoutQueuegetLayoutQueue()
          获取用于布局处理的队列。
 floatgetLeftInset()
          获得视图四周左侧的空白部分。
 intgetMajorAxis()
          获取主轴(即子级平铺时沿用的轴)。
 floatgetMaximumSpan(int axis)
          确定此视图沿某轴的最大跨距。
 floatgetMinimumSpan(int axis)
          确定此视图沿某轴的最小跨距。
 intgetMinorAxis()
          获取辅轴(与平铺轴垂直的轴)。
 intgetNextVisualPositionFrom(int pos, Position.Bias b, Shape a, int direction, Position.Bias[] biasRet)
          提供确定下一个以可视化形式表示的模型位置的方法,用户可以在此位置放置一个插入符。
 floatgetPreferredSpan(int axis)
          确定此视图沿某轴的首选跨距。
 floatgetRightInset()
          获得视图四周右侧的空白部分。
 floatgetTopInset()
          获得视图四周顶部的空白部分。
 ViewgetView(int n)
          获得第 n 个子视图。
 intgetViewCount()
          返回此视图中的视图数。
 intgetViewIndex(int pos, Position.Bias b)
          返回该模型中表示给定位置的子视图索引。
protected  intgetViewIndexAtPosition(int pos, Position.Bias b)
          获取此模型中表示给定位置的子视图索引。
protected  voidloadChildren(ViewFactory f)
          加载初始化该视图的所有子级。
protected  voidmajorRequirementChange(AsyncBoxView.ChildState cs, float delta)
          沿主轴上的要求更改。
protected  voidminorRequirementChange(AsyncBoxView.ChildState cs)
          沿辅轴上的要求更改。
 ShapemodelToView(int pos, Shape a, Position.Bias b)
          提供从文档模型坐标空间到所映射的视图坐标空间的映射。
 voidpaint(Graphics g, Shape alloc)
          使用给定的分配和呈现表面呈现该视图。
 voidpreferenceChanged(View child, boolean width, boolean height)
          子视图可以在父级上调用此方法,以指示首选项已更改并且应该重新考虑布局。
 voidreplace(int offset, int length, View[] views)
          调用超类以更新子视图,并且更新子视图的状态记录。
 voidsetBottomInset(float i)
          设置视图四周底部的空白部分。
protected  voidsetEstimatedMajorSpan(boolean isEstimated)
          设置 estimatedMajorSpan 属性,它确定是否应该将主跨距视为估计值。
 voidsetLeftInset(float i)
          设置视图四周左侧的空白部分。
 voidsetParent(View parent)
          设置视图的父级。
 voidsetRightInset(float i)
          设置视图四周右侧的空白部分。
 voidsetSize(float width, float height)
          设置视图的大小。
 voidsetTopInset(float i)
          设置视图四周顶部的空白部分。
protected  voidupdateLayout(DocumentEvent.ElementChange ec, DocumentEvent e, Shape a)
          更新布局,以响应从模型接收的更改通知。
 intviewToModel(float x, float y, Shape a, Position.Bias[] biasReturn)
          提供从视图坐标空间到模型逻辑坐标空间的映射。
 
从类 javax.swing.text.View 继承的方法
append, breakView, changedUpdate, createFragment, forwardUpdate, forwardUpdateToView, getAlignment, getAttributes, getBreakWeight, getContainer, getDocument, getElement, getEndOffset, getGraphics, getParent, getResizeWeight, getStartOffset, getToolTipText, getViewFactory, getViewIndex, insert, insertUpdate, isVisible, modelToView, modelToView, remove, removeAll, removeUpdate, updateChildren, viewToModel
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

locator

protected AsyncBoxView.ChildLocator locator
这是管理子视图偏移量的对象。用于管理子视图位置的所有锁定都位于此对象上。

构造方法详细信息

AsyncBoxView

public AsyncBoxView(Element elem,
                    int axis)
构造执行异步布局处理的 BoxView。

参数:
elem - 要表示的模型元素
axis - 平铺时沿用的轴。这可以是 X_AXIS 或 Y_AXIS 之一。
方法详细信息

getMajorAxis

public int getMajorAxis()
获取主轴(即子级平铺时沿用的轴)。这将是 X_AXIS 或 Y_AXIS 值之一。


getMinorAxis

public int getMinorAxis()
获取辅轴(与平铺轴垂直的轴)。这将是 X_AXIS 或 Y_AXIS 值之一。


getTopInset

public float getTopInset()
获得视图四周顶部的空白部分。


setTopInset

public void setTopInset(float i)
设置视图四周顶部的空白部分。

参数:
i - inset 值

getBottomInset

public float getBottomInset()
获得视图四周底部的空白部分。


setBottomInset

public void setBottomInset(float i)
设置视图四周底部的空白部分。

参数:
i - inset 值

getLeftInset

public float getLeftInset()
获得视图四周左侧的空白部分。