public class LabelView extends GlyphView implements TabableView
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| Modifier and Type | Method and Description |
|---|---|
void |
changedUpdate(DocumentEvent e, Shape a, ViewFactory f)
从该视图负责的位置上更改属性的文档的通知。
|
Color |
getBackground()
把背景颜色来呈现的符号。
|
Font |
getFont()
取字体,字形应根据。
|
protected FontMetrics |
getFontMetrics()
过时的。
根据不用于字形渲染在JDK运行时。
|
Color |
getForeground()
把前景颜色来呈现的符号。
|
boolean |
isStrikeThrough()
确定符号应该有删除线。
|
boolean |
isSubscript()
确定是否应显示为上标符号。
|
boolean |
isSuperscript()
确定是否应作为下标符号。
|
boolean |
isUnderline()
确定是否应强调符号。
|
protected void |
setBackground(Color bg)
设置视图的背景颜色。
|
protected void |
setPropertiesFromAttributes()
从属性设置缓存属性。
|
protected void |
setStrikeThrough(boolean s)
设置是否视图有一个罢工/线通过它。
|
protected void |
setSubscript(boolean s)
设置是否视图表示一个下标。
|
protected void |
setSuperscript(boolean s)
设置是否视图表示一个上标。
|
protected void |
setUnderline(boolean u)
设置是否有下划线的视图。
|
breakView, checkPainter, clone, createFragment, getAlignment, getBreakWeight, getEndOffset, getGlyphPainter, getMinimumSpan, getNextVisualPositionFrom, getPartialSpan, getPreferredSpan, getStartOffset, getTabbedSpan, getTabExpander, getText, insertUpdate, modelToView, paint, removeUpdate, setGlyphPainter, viewToModelappend, forwardUpdate, forwardUpdateToView, getAttributes, 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 LabelView(Element elem)
elem -元素
protected void setUnderline(boolean u)
u -如果观点强调,否则为false
isUnderline()
protected void setStrikeThrough(boolean s)
s -如果视图有一个打击/线穿过,否则为false
isStrikeThrough()
protected void setSuperscript(boolean s)
s -如果真的观点代表了一种标,否则为false
isSuperscript()
protected void setSubscript(boolean s)
s -如果视图表示一个下标,否则为false
isSubscript()
protected void setBackground(Color bg)
View部分。如果你需要自定义背景颜色应该重写
setPropertiesFromAttributes和调用该方法。空值表示没有背景应该被渲染,这样母
View背景会显示通过。
bg背景颜色,或空
setPropertiesFromAttributes()
protected void setPropertiesFromAttributes()
@Deprecated protected FontMetrics getFontMetrics()
FontMetrics。
public Color getBackground()
null。
getBackground 方法重写,继承类
GlyphView
public Color getForeground()
null。
getForeground 方法重写,继承类
GlyphView
public boolean isUnderline()
当你请求这个属性,LabelView重新同步状态的Element的AttributeSet属性。如果Element的AttributeSet没有设置这个属性,它将恢复到假。
isUnderline 方法重写,继承类
GlyphView
underline属性的值
public boolean isStrikeThrough()
strikeThrough财产。
当你请求这个属性,LabelView重新同步状态的Element的AttributeSet属性。如果Element的AttributeSet没有设置这个属性,它将恢复到假。
isStrikeThrough 方法重写,继承类
GlyphView
strikeThrough属性的值
public boolean isSubscript()
isSubscript 方法重写,继承类
GlyphView
当你请求这个属性,LabelView重新同步状态的Element的AttributeSet性能。如果Element的AttributeSet没有设置这个属性,它将恢复到假。
public boolean isSuperscript()
当你请求这个属性,LabelView重新同步状态的Element的AttributeSet性能。如果Element的AttributeSet没有设置这个属性,它将恢复到假。
isSuperscript 方法重写,继承类
GlyphView
superscript属性的值
public void changedUpdate(DocumentEvent e, Shape a, ViewFactory f)
changedUpdate 方法重写,继承类
GlyphView
e -从相关文档的变更信息
a -视图的当前配置
f -工厂用重建如果视图有孩子
View.changedUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)
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.