javax.swing.text
public class LabelView extends GlyphView
| Constructor Summary | |
|---|---|
| LabelView(Element element)
Creates a new GlyphView for the given Element.
| |
| Method Summary | |
|---|---|
| void | changedUpdate(DocumentEvent e, Shape a, ViewFactory vf)
Receives notification when text attributes change in the chunk of
text that this view is responsible for. |
| Color | getBackground()
Returns the background color for the glyphs.
|
| Font | getFont()
Returns the font for the glyphs.
|
| protected FontMetrics | getFontMetrics()
Returns the font metrics of the current font.
|
| Color | getForeground()
Returns the foreground color for the glyphs.
|
| boolean | isStrikeThrough()
Returns true if the glyphs are rendered strike-through,
false otherwise.
|
| boolean | isSubscript()
Returns true if the glyphs are rendered as subscript,
false otherwise.
|
| boolean | isSuperscript()
Returns true if the glyphs are rendered as superscript,
false otherwise.
|
| boolean | isUnderline()
Returns true if the glyphs are rendered underlined,
false otherwise.
|
| protected void | setBackground(Color bg)
Sets the background color for the glyphs. |
| protected void | setPropertiesFromAttributes()
Loads the properties of this label view from the element's text
attributes. |
| protected void | setStrikeThrough(boolean flag)
Sets the strike-through flag.
|
| protected void | setSubscript(boolean flag)
Sets the subscript flag.
|
| protected void | setSuperscript(boolean flag)
Sets the superscript flag.
|
| protected void | setUnderline(boolean flag)
Sets the underline flag.
|
GlyphView for the given Element.
Parameters: element the element that is rendered by this GlyphView
Parameters: e the document event a the allocation of this view vf the view factory to use for creating new views
Returns: the background color for the glyphs
Returns: the font for the glyphs
Deprecated: this is not used anymore
Returns the font metrics of the current font.Returns: the font metrics of the current font
Returns: the foreground color for the glyphs
true if the glyphs are rendered strike-through,
false otherwise.
Returns: true if the glyphs are rendered strike-through,
false otherwise
true if the glyphs are rendered as subscript,
false otherwise.
Returns: true if the glyphs are rendered as subscript,
false otherwise
true if the glyphs are rendered as superscript,
false otherwise.
Returns: true if the glyphs are rendered as superscript,
false otherwise
true if the glyphs are rendered underlined,
false otherwise.
Returns: true if the glyphs are rendered underlined,
false otherwise
null
means the background of the parent view should shine through.
Parameters: bg the background to set or null
Since: 1.5
Parameters: flag true if the glyphs are rendered strike-through,
false otherwise
Parameters: flag true if the glyphs are rendered as subscript,
false otherwise
Parameters: flag true if the glyphs are rendered as superscript,
false otherwise
Parameters: flag true if the glyphs are rendered underlined,
false otherwise