Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
javax.swing.text.View
javax.swing.text.GlyphView
javax.swing.text.LabelView
GlyphView
that caches the textattributes for most effective
rendering.
Nested Class Summary |
Nested classes/interfaces inherited from class javax.swing.text.GlyphView | |
GlyphView.GlyphPainter |
Field Summary |
Fields inherited from class javax.swing.text.View | |
BadBreakWeight , ExcellentBreakWeight , ForcedBreakWeight , GoodBreakWeight , X_AXIS , Y_AXIS |
Fields inherited from interface javax.swing.SwingConstants | |
BOTTOM , CENTER , EAST , HORIZONTAL , LEADING , LEFT , NEXT , NORTH , NORTH_EAST , NORTH_WEST , PREVIOUS , RIGHT , SOUTH , SOUTH_EAST , SOUTH_WEST , TOP , TRAILING , VERTICAL , WEST |
Method Summary | |
void |
|
Color |
|
Font |
|
protected FontMetrics |
|
Color |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
protected void |
|
protected void |
|
protected void |
|
protected void |
|
protected void |
|
protected void |
|
Methods inherited from class javax.swing.text.GlyphView | |
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 |
Methods inherited from class java.lang.Object | |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
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()
Returnstrue
if the glyphs are rendered strike-through,false
otherwise.
- Overrides:
- isStrikeThrough in interface GlyphView
- Returns:
true
if the glyphs are rendered strike-through,false
otherwise
public boolean isSubscript()
Returnstrue
if the glyphs are rendered as subscript,false
otherwise.
- Overrides:
- isSubscript in interface GlyphView
- Returns:
true
if the glyphs are rendered as subscript,false
otherwise
public boolean isSuperscript()
Returnstrue
if the glyphs are rendered as superscript,false
otherwise.
- Overrides:
- isSuperscript in interface GlyphView
- Returns:
true
if the glyphs are rendered as superscript,false
otherwise
public boolean isUnderline()
Returnstrue
if the glyphs are rendered underlined,false
otherwise.
- Overrides:
- isUnderline in interface GlyphView
- Returns:
true
if the glyphs are rendered underlined,false
otherwise
protected void setBackground(Color bg)
Sets the background color for the glyphs. A value ofnull
means 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
-true
if the glyphs are rendered strike-through,false
otherwise
protected void setSubscript(boolean flag)
Sets the subscript flag.
- Parameters:
flag
-true
if the glyphs are rendered as subscript,false
otherwise
protected void setSuperscript(boolean flag)
Sets the superscript flag.
- Parameters:
flag
-true
if the glyphs are rendered as superscript,false
otherwise
protected void setUnderline(boolean flag)
Sets the underline flag.
- Parameters:
flag
-true
if the glyphs are rendered underlined,false
otherwise