|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.text.View
javax.swing.text.GlyphView
javax.swing.text.LabelView
public class LabelView
A 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 |
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()
Deprecated. this is not used anymore |
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. |
Methods inherited from class javax.swing.text.GlyphView |
---|
breakView, checkPainter, clone, createFragment, getAlignment, getBreakWeight, getEndOffset, getGlyphPainter, getNextVisualPositionFrom, getPartialSpan, getPreferredSpan, getStartOffset, getTabbedSpan, getTabExpander, getText, insertUpdate, modelToView, paint, removeUpdate, setGlyphPainter, viewToModel |
Methods inherited from class javax.swing.text.View |
---|
append, dump, forwardUpdate, forwardUpdateToView, getAttributes, getChildAllocation, getContainer, getDocument, getElement, getGraphics, getMaximumSpan, getMinimumSpan, getParent, getResizeWeight, getToolTipText, getView, getViewCount, getViewFactory, getViewIndex, getViewIndex, insert, isVisible, modelToView, modelToView, preferenceChanged, remove, removeAll, replace, setParent, setSize, updateChildren, updateLayout, viewToModel |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LabelView(Element element)
GlyphView
for the given Element
.
element
- the element that is rendered by this GlyphViewMethod Detail |
---|
protected void setPropertiesFromAttributes()
changedUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)
method
public void changedUpdate(DocumentEvent e, Shape a, ViewFactory vf)
setPropertiesFromAttributes()
.
changedUpdate
in class GlyphView
e
- the document eventa
- the allocation of this viewvf
- the view factory to use for creating new viewspublic Color getBackground()
getBackground
in class GlyphView
protected void setBackground(Color bg)
null
means the background of the parent view should shine through.
bg
- the background to set or null
public Color getForeground()
getForeground
in class GlyphView
public Font getFont()
getFont
in class GlyphView
protected FontMetrics getFontMetrics()
public boolean isUnderline()
true
if the glyphs are rendered underlined,
false
otherwise.
isUnderline
in class GlyphView
true
if the glyphs are rendered underlined,
false
otherwiseprotected void setUnderline(boolean flag)
flag
- true
if the glyphs are rendered underlined,
false
otherwisepublic boolean isSubscript()
true
if the glyphs are rendered as subscript,
false
otherwise.
isSubscript
in class GlyphView
true
if the glyphs are rendered as subscript,
false
otherwiseprotected void setSubscript(boolean flag)
flag
- true
if the glyphs are rendered as subscript,
false
otherwisepublic boolean isSuperscript()
true
if the glyphs are rendered as superscript,
false
otherwise.
isSuperscript
in class GlyphView
true
if the glyphs are rendered as superscript,
false
otherwiseprotected void setSuperscript(boolean flag)
flag
- true
if the glyphs are rendered as superscript,
false
otherwisepublic boolean isStrikeThrough()
true
if the glyphs are rendered strike-through,
false
otherwise.
isStrikeThrough
in class GlyphView
true
if the glyphs are rendered strike-through,
false
otherwiseprotected void setStrikeThrough(boolean flag)
flag
- true
if the glyphs are rendered strike-through,
false
otherwise
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |