java.lang.Object | |||
↳ | javax.swing.text.View | ||
↳ | javax.swing.text.GlyphView | ||
↳ | javax.swing.text.LabelView |
![]() |
A LabelView
is a styled chunk of text
that represents a view mapped over an element in the
text model. It caches the character level attributes
used for rendering.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new view wrapped on an element.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Gives notification from the document that attributes were changed
in a location that this view is responsible for.
| |||||||||||
Fetches the background color to use to render the glyphs.
| |||||||||||
Fetches the font that the glyphs should be based upon.
| |||||||||||
Fetches the foreground color to use to render the glyphs.
| |||||||||||
Determines if the glyphs should have a strikethrough
line.
| |||||||||||
Determines if the glyphs should be rendered as superscript.
| |||||||||||
Determines if the glyphs should be rendered as subscript.
| |||||||||||
Determines if the glyphs should be underlined.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This method is deprecated.
FontMetrics are not used for glyph rendering
when running in the JDK.
| |||||||||||
Sets the background color for the view.
| |||||||||||
Sets the cached properties from the attributes.
| |||||||||||
Sets whether or not the view has a strike/line
through it.
| |||||||||||
Sets whether or not the view represents a
subscript.
| |||||||||||
Sets whether or not the view represents a
superscript.
| |||||||||||
Sets whether or not the view is underlined.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Constructs a new view wrapped on an element.
elem | the element |
---|
Gives notification from the document that attributes were changed in a location that this view is responsible for.
e | the change information from the associated document |
---|---|
a | the current allocation of the view |
f | the factory to use to rebuild if the view has children |
Fetches the background color to use to render the glyphs.
This is implemented to return a cached background color,
which defaults to null
.
Fetches the font that the glyphs should be based upon. This is implemented to return a cached font.
Fetches the foreground color to use to render the glyphs.
This is implemented to return a cached foreground color,
which defaults to null
.
Determines if the glyphs should have a strikethrough
line. If true, a line should be drawn through the center
of the glyphs. This is implemented to return the
cached strikeThrough
property.
When you request this property, LabelView
re-syncs its state with the properties of the
Element
's AttributeSet
.
If Element
's AttributeSet
does not have this property set, it will revert to false.
strikeThrough
propertyDetermines if the glyphs should be rendered as superscript.
When you request this property, LabelView
re-syncs its state with the properties of the
Element
's AttributeSet
.
If Element
's AttributeSet
does not have this property set, it will revert to false.the value of the cached
subscript
property
Determines if the glyphs should be rendered as subscript.
When you request this property, LabelView
re-syncs its state with the properties of the
Element
's AttributeSet
.
If Element
's AttributeSet
does not have this property set, it will revert to false.
superscript
propertyDetermines if the glyphs should be underlined. If true, an underline should be drawn through the baseline. This is implemented to return the cached underline property.
When you request this property, LabelView
re-syncs its state with the properties of the
Element
's AttributeSet
.
If Element
's AttributeSet
does not have this property set, it will revert to false.
underline
property
This method is deprecated.
FontMetrics are not used for glyph rendering
when running in the JDK.
Fetches the FontMetrics
used for this view.
Sets the background color for the view. This method is typically
invoked as part of configuring this View
. If you need
to customize the background color you should override
setPropertiesFromAttributes
and invoke this method. A
value of null indicates no background should be rendered, so that the
background of the parent View
will show through.
bg | background color, or null |
---|
Sets the cached properties from the attributes.
Sets whether or not the view has a strike/line through it. Note that this setter is protected and is really only meant if you need to update some additional state when set.
s | true if the view has a strike/line through it, otherwise false |
---|
Sets whether or not the view represents a subscript. Note that this setter is protected and is really only meant if you need to update some additional state when set.
s | true if the view represents a subscript, otherwise false |
---|
Sets whether or not the view represents a superscript. Note that this setter is protected and is really only meant if you need to update some additional state when set.
s | true if the view represents a superscript, otherwise false |
---|
Sets whether or not the view is underlined. Note that this setter is protected and is really only meant if you need to update some additional state when set.
u | true if the view is underlined, otherwise false |
---|