public class ParagraphView extends ParagraphView
FlowView.FlowStrategy
firstLineIndent
layoutPool, layoutSpan, strategy
BadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, X_AXIS, Y_AXIS
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
Constructor and Description |
---|
ParagraphView(Element elem)
为给定元素构造ParagraphView。
|
Modifier and Type | Method and Description |
---|---|
protected SizeRequirements |
calculateMinorAxisRequirements(int axis, SizeRequirements r)
计算沿着短轴的段落的需要。
|
AttributeSet |
getAttributes()
获取渲染时要使用的属性。
|
float |
getMaximumSpan(int axis)
确定沿着轴的该视图的最大跨度。
|
float |
getMinimumSpan(int axis)
确定此视图沿轴的最小跨度。
|
float |
getPreferredSpan(int axis)
确定此视图的首选跨度。
|
protected StyleSheet |
getStyleSheet() |
boolean |
isVisible()
指示是否显示此视图。
|
void |
paint(Graphics g, Shape a)
渲染使用给定的渲染表面和该表面上的区域。
|
void |
setParent(View parent)
建立此视图的父视图。
|
protected void |
setPropertiesFromAttributes()
从css属性中设置段落,而不是在StyleConstants中找到的值(即
|
breakView, changedUpdate, createRow, findOffsetToCharactersInString, flipEastAndWestAtEnds, getAlignment, getBreakWeight, getClosestPositionTo, getFlowSpan, getFlowStart, getLayoutView, getLayoutViewCount, getNextNorthSouthVisualPositionFrom, getPartialSize, getTabBase, getTabSet, nextTabStop, setFirstLineIndent, setJustification, setLineSpacing
getFlowAxis, getViewIndexAtPosition, insertUpdate, layout, loadChildren, removeUpdate
baselineLayout, baselineRequirements, calculateMajorAxisRequirements, childAllocation, forwardUpdate, getAxis, getChildAllocation, getHeight, getOffset, getResizeWeight, getSpan, getViewAtPoint, getWidth, isAfter, isAllocationValid, isBefore, isLayoutValid, layoutChanged, layoutMajorAxis, layoutMinorAxis, modelToView, paintChild, preferenceChanged, replace, setAxis, setSize, viewToModel
getBottomInset, getInsideAllocation, getLeftInset, getNextEastWestVisualPositionFrom, getNextVisualPositionFrom, getRightInset, getTopInset, getView, getViewAtPosition, getViewCount, getViewIndex, modelToView, setInsets, setParagraphInsets
append, breakView, createFragment, forwardUpdateToView, getBreakWeight, getContainer, getDocument, getElement, getEndOffset, getGraphics, getParent, getStartOffset, getToolTipText, getViewFactory, getViewIndex, insert, modelToView, remove, removeAll, updateChildren, updateLayout, viewToModel
public ParagraphView(Element elem)
elem
- 该视图负责的元素
public void setParent(View parent)
这被实现为转发到超类,以及调用setPropertiesFromAttributes
方法从css属性设置段属性。 此时通话是为了确保通过父母视图属性向上解决的能力。
public AttributeSet getAttributes()
getAttributes
在
View
protected void setPropertiesFromAttributes()
protected StyleSheet getStyleSheet()
protected SizeRequirements calculateMinorAxisRequirements(int axis, SizeRequirements r)
如果为段落明确指定了大小要求,请使用该要求。 否则,请使用超类的要求ParagraphView
。
如果axis
参数既不是View.X_AXIS
也不是View.Y_AXIS
,则抛出IllegalArgumentException
。 如果r
参数为null,
,则会创建一个新的SizeRequirements
对象,否则返回提供的SizeRequirements
对象。
calculateMinorAxisRequirements
在
ParagraphView
axis
- 短轴
r
- 输入
SizeRequirements
对象
SizeRequirements
对象
IllegalArgumentException
- 如果
axis
参数无效
SizeRequirements
public boolean isVisible()
public void paint(Graphics g, Shape a)
paint
在
ParagraphView
g
- 要使用的渲染表面
a
- 要分配的区域
View.paint(java.awt.Graphics, java.awt.Shape)
public float getPreferredSpan(int axis)
getPreferredSpan
在
BoxView
axis
- 可以是View.X_AXIS或View.Y_AXIS
BoxView.getPreferredSpan(int)
public float getMinimumSpan(int axis)
getMinimumSpan
在
BoxView
axis
- 可能是
View.X_AXIS
或
View.Y_AXIS
BoxView.getMinimumSpan(int)
public float getMaximumSpan(int axis)
getMaximumSpan
在
BoxView
axis
- 可能是
View.X_AXIS
或
View.Y_AXIS
BoxView.getMaximumSpan(int)