- java.lang.Object
-
- javax.swing.text.View
-
- javax.swing.text.CompositeView
-
- javax.swing.text.BoxView
-
- javax.swing.text.html.BlockView
-
- javax.swing.text.html.ListView
-
- All Implemented Interfaces:
-
SwingConstants
public class ListView extends BlockView
显示html列表的视图实现
-
-
Field Summary
-
Fields inherited from interface 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
-
Fields inherited from class javax.swing.text.View
BadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, X_AXIS, Y_AXIS
-
-
方法摘要
所有方法 接口方法 具体的方法 Modifier and Type 方法 描述 float
getAlignment(int axis)
计算列表所需的形状。void
paint(Graphics g, Shape allocation)
渲染使用给定的渲染表面和该表面上的区域。protected void
paintChild(Graphics g, Rectangle alloc, int index)
画一个孩子; 由paint()调用。protected void
setPropertiesFromAttributes()
更新来自属性的任何缓存值。-
Methods inherited from class javax.swing.text.html.BlockView
calculateMajorAxisRequirements, calculateMinorAxisRequirements, changedUpdate, getAttributes, getMaximumSpan, getMinimumSpan, getPreferredSpan, getResizeWeight, getStyleSheet, layoutMinorAxis, setParent
-
Methods inherited from class javax.swing.text.BoxView
baselineLayout, baselineRequirements, childAllocation, flipEastAndWestAtEnds, forwardUpdate, getAxis, getChildAllocation, getHeight, getOffset, getSpan, getViewAtPoint, getWidth, isAfter, isAllocationValid, isBefore, isLayoutValid, layout, layoutChanged, layoutMajorAxis, modelToView, preferenceChanged, replace, setAxis, setSize, viewToModel
-
Methods inherited from class javax.swing.text.CompositeView
getBottomInset, getInsideAllocation, getLeftInset, getNextEastWestVisualPositionFrom, getNextNorthSouthVisualPositionFrom, getNextVisualPositionFrom, getRightInset, getTopInset, getView, getViewAtPosition, getViewCount, getViewIndex, getViewIndexAtPosition, loadChildren, modelToView, setInsets, setParagraphInsets
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from class javax.swing.text.View
append, breakView, createFragment, forwardUpdateToView, getBreakWeight, getContainer, getDocument, getElement, getEndOffset, getGraphics, getParent, getStartOffset, getToolTipText, getViewFactory, getViewIndex, insert, insertUpdate, isVisible, modelToView, remove, removeAll, removeUpdate, updateChildren, updateLayout, viewToModel
-
-
-
-
构造方法详细信息
-
ListView
public ListView(Element elem)
创建一个表示列表元素的新视图。- 参数
-
elem
- 为...创建视图的元素
-
-
方法详细信息
-
getAlignment
public float getAlignment(int axis)
计算列表所需的形状。- 重写:
-
getAlignment
中的BlockView
- 参数
-
axis
- 可以是X_AXIS或Y_AXIS - 结果
- 期望的跨度
- 另请参见:
-
View.getPreferredSpan(int)
-
paint
public void paint(Graphics g, Shape allocation)
渲染使用给定的渲染表面和该表面上的区域。- 重写:
-
paint
在BlockView
- 参数
-
g
- 要使用的渲染表面 -
allocation
- 要分配的区域 - 另请参见:
-
View.paint(java.awt.Graphics, java.awt.Shape)
-
paintChild
protected void paintChild(Graphics g, Rectangle alloc, int index)
画一个孩子; 由paint()调用。 默认情况下,这是所有它,但是一个子类可以使用它来绘制相对于孩子的东西。- 重写:
-
paintChild
在BoxView
- 参数
-
g
- 图形上下文 -
alloc
- 分配的区域来渲染孩子 -
index
- 孩子的索引
-
setPropertiesFromAttributes
protected void setPropertiesFromAttributes()
描述从类复制:BlockView
更新来自属性的任何缓存值。
-
-