java.lang.Object javax.swing.text.View javax.swing.text.GlyphView javax.swing.text.LabelViewGlyphView that caches the textattributes for most effective
rendering.
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST void changedUpdate(DocumentEvent e, Shape a, ViewFactory vf) Color getBackground()protected FontMetrics getFontMetrics() Color getForeground() boolean isStrikeThrough()true if the glyphs are rendered strike-through,
false otherwise.
boolean isSubscript()true if the glyphs are rendered as subscript,
false otherwise.
boolean isSuperscript()true if the glyphs are rendered as superscript,
false otherwise.
boolean isUnderline()true if the glyphs are rendered underlined,
false otherwise.
protected void setBackground(Color bg)protected void setPropertiesFromAttributes()protected void setStrikeThrough(boolean flag)protected void setSubscript(boolean flag)protected void setSuperscript(boolean flag)protected void setUnderline(boolean flag)breakView, changedUpdate, checkPainter, clone, createFragment, getAlignment, getBackground, getBreakWeight, getEndOffset, getFont, getForeground, getGlyphPainter, getNextVisualPositionFrom, getPartialSpan, getPreferredSpan, getStartOffset, getTabExpander, getTabbedSpan, getText, insertUpdate, isStrikeThrough, isSubscript, isSuperscript, isUnderline, modelToView, paint, removeUpdate, setGlyphPainter, viewToModel append, breakView, changedUpdate, createFragment, dump, forwardUpdate, forwardUpdateToView, getAlignment, getAttributes, getBreakWeight, getChildAllocation, getContainer, getDocument, getElement, getEndOffset, getGraphics, getMaximumSpan, getMinimumSpan, getNextVisualPositionFrom, getParent, getPreferredSpan, getResizeWeight, getStartOffset, getToolTipText, getView, getViewCount, getViewFactory, getViewIndex, getViewIndex, insert, insertUpdate, isVisible, modelToView, modelToView, modelToView, paint, preferenceChanged, remove, removeAll, removeUpdate, replace, setParent, setSize, updateChildren, updateLayout, viewToModel, viewToModel public 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. This simply callssetPropertiesFromAttributes().
- Overrides:
- changedUpdate in interface GlyphView
- Parameters:
e- the document eventa- the allocation of this viewvf- the view factory to use for creating new views
public Color getBackground()
Returns the background color for the glyphs.
- Overrides:
- getBackground in interface GlyphView
- Returns:
- the background color for the glyphs
protected FontMetrics getFontMetrics()
Deprecated. this is not used anymore
Returns the font metrics of the current font.
- Returns:
- the font metrics of the current font
public Color getForeground()
Returns the foreground color for the glyphs.
- Overrides:
- getForeground in interface GlyphView
- Returns:
- the foreground color for the glyphs
public boolean isStrikeThrough()
Returnstrueif the glyphs are rendered strike-through,falseotherwise.
- Overrides:
- isStrikeThrough in interface GlyphView
- Returns:
trueif the glyphs are rendered strike-through,falseotherwise
public boolean isSubscript()
Returnstrueif the glyphs are rendered as subscript,falseotherwise.
- Overrides:
- isSubscript in interface GlyphView
- Returns:
trueif the glyphs are rendered as subscript,falseotherwise
public boolean isSuperscript()
Returnstrueif the glyphs are rendered as superscript,falseotherwise.
- Overrides:
- isSuperscript in interface GlyphView
- Returns:
trueif the glyphs are rendered as superscript,falseotherwise
public boolean isUnderline()
Returnstrueif the glyphs are rendered underlined,falseotherwise.
- Overrides:
- isUnderline in interface GlyphView
- Returns:
trueif the glyphs are rendered underlined,falseotherwise
protected void setBackground(Color bg)
Sets the background color for the glyphs. A value ofnullmeans the background of the parent view should shine through.
- Parameters:
bg- the background to set ornull
- Since:
- 1.5
protected void setPropertiesFromAttributes()
Loads the properties of this label view from the element's text attributes. This method is called from the constructor and thechangedUpdate(DocumentEvent,Shape,ViewFactory)method
protected void setStrikeThrough(boolean flag)
Sets the strike-through flag.
- Parameters:
flag-trueif the glyphs are rendered strike-through,falseotherwise
protected void setSubscript(boolean flag)
Sets the subscript flag.
- Parameters:
flag-trueif the glyphs are rendered as subscript,falseotherwise
protected void setSuperscript(boolean flag)
Sets the superscript flag.
- Parameters:
flag-trueif the glyphs are rendered as superscript,falseotherwise
protected void setUnderline(boolean flag)
Sets the underline flag.
- Parameters:
flag-trueif the glyphs are rendered underlined,falseotherwise