public class ParagraphView extends ParagraphView
FlowView.FlowStrategyfirstLineIndentlayoutPool, layoutSpan, strategyBadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, X_AXIS, Y_AXISBOTTOM, 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, setLineSpacinggetFlowAxis, getViewIndexAtPosition, insertUpdate, layout, loadChildren, removeUpdatebaselineLayout, 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, viewToModelgetBottomInset, getInsideAllocation, getLeftInset, getNextEastWestVisualPositionFrom, getNextVisualPositionFrom, getRightInset, getTopInset, getView, getViewAtPosition, getViewCount, getViewIndex, modelToView, setInsets, setParagraphInsetsappend, breakView, createFragment, forwardUpdateToView, getBreakWeight, getContainer, getDocument, getElement, getEndOffset, getGraphics, getParent, getStartOffset, getToolTipText, getViewFactory, getViewIndex, insert, modelToView, remove, removeAll, updateChildren, updateLayout, viewToModelpublic 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)
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.