public class InlineView extends LabelView
GlyphView.GlyphPainterBadBreakWeight, 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 |
|---|
InlineView(Element elem)
构造一个包含在元素上的新视图。
|
| Modifier and Type | Method and Description |
|---|---|
View |
breakView(int axis, int offset, float pos, float len)
试图在给定的轴上打破这个视图。
|
void |
changedUpdate(DocumentEvent e, Shape a, ViewFactory f)
在该视图负责的位置向文档发出属性更改的通知。
|
AttributeSet |
getAttributes()
获取渲染时要使用的属性。
|
int |
getBreakWeight(int axis, float pos, float len)
确定这种观点的休息时机有多吸引人。
|
protected StyleSheet |
getStyleSheet() |
void |
insertUpdate(DocumentEvent e, Shape a, ViewFactory f)
在该视图负责的位置发出通知。
|
void |
removeUpdate(DocumentEvent e, Shape a, ViewFactory f)
在该视图负责的位置发出文档中已删除某些内容的通知。
|
protected void |
setPropertiesFromAttributes()
从属性设置缓存的属性。
|
getBackground, getFont, getFontMetrics, getForeground, isStrikeThrough, isSubscript, isSuperscript, isUnderline, setBackground, setStrikeThrough, setSubscript, setSuperscript, setUnderlinecheckPainter, clone, createFragment, getAlignment, getEndOffset, getGlyphPainter, getMinimumSpan, getNextVisualPositionFrom, getPartialSpan, getPreferredSpan, getStartOffset, getTabbedSpan, getTabExpander, getText, modelToView, paint, setGlyphPainter, viewToModelappend, forwardUpdate, forwardUpdateToView, getChildAllocation, getContainer, getDocument, getElement, getGraphics, getMaximumSpan, getParent, getResizeWeight, getToolTipText, getView, getViewCount, getViewFactory, getViewIndex, getViewIndex, insert, isVisible, modelToView, modelToView, preferenceChanged, remove, removeAll, replace, setParent, setSize, updateChildren, updateLayout, viewToModelequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetPartialSpan, getTabbedSpanpublic InlineView(Element elem)
elem - 元素
public void insertUpdate(DocumentEvent e, Shape a, ViewFactory f)
null ,则该方法的行为依赖于实现。
insertUpdate在
GlyphView
e - 相关文件的更改信息
a - 视图的当前分配
f - 工厂使用重建如果视图有孩子
View.insertUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)
public void removeUpdate(DocumentEvent e, Shape a, ViewFactory f)
null ,则该方法的行为依赖于实现。
removeUpdate在
GlyphView
e - 相关文件的变更信息
a - 视图的当前分配
f - 工厂使用重建如果视图有孩子
View.removeUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)
public void changedUpdate(DocumentEvent e, Shape a, ViewFactory f)
changedUpdate在
LabelView类
e - 相关文件的变更信息
a - 视图的当前分配
f - 工厂使用重建如果视图有孩子
View.changedUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)
public AttributeSet getAttributes()
getAttributes在类
View
public int getBreakWeight(int axis,
float pos,
float len)
breakView最有吸引力的视图。
例如,表示具有空格的文本的视图可能比没有空格的视图更有吸引力。
重量越高,休息时间越有吸引力。
等于或低于BadBreakWeight不应被视为休息。
大于等于ForcedBreakWeight应该被打破。
这是为了提供返回BadBreakWeight的默认行为,除非长度大于视图的长度,在这种情况下,整个视图表示片段。 除非写出支持破坏行为的观点,否则尝试违反观点是没有吸引力的。 支持破解的视图的示例是LabelView 。 使用重量的视图的例子是ParagraphView 。
getBreakWeight在
GlyphView
axis - 可以是View.X_AXIS或View.Y_AXIS
pos - 断开视图> = 0开始的潜在位置。这可能对计算制表位置有用。
len - 指定需要潜在中断的
位置的距离> = 0的相对长度。
LabelView , ParagraphView , View.BadBreakWeight , View.GoodBreakWeight , View.ExcellentBreakWeight , View.ForcedBreakWeight
public View breakView(int axis, int offset, float pos, float len)
View.breakView(int, int, float, float) 。
这种方法的行为是未指定的情况下, axis既不是View.X_AXIS也不View.Y_AXIS ,并且在壳体offset , pos ,或len为空。
breakView在
GlyphView
axis - 可能是
View.X_AXIS或
View.Y_AXIS
offset - 文档模型中破碎的片段将占用> = 0的位置。这将是返回的片段的起始偏移量
pos - 断开的视图将占据的轴的位置> = 0。这可能对标签计算
len - 指定要求潜在断点的轴的距离> = 0
View.breakView(int, int, float, float)
protected void setPropertiesFromAttributes()
protected StyleSheet getStyleSheet()
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.