Home » openjdk-7 » javax » swing » text » [javadoc | source]
javax.swing.text
public class: LabelView [javadoc | source]
java.lang.Object
   javax.swing.text.View
      javax.swing.text.GlyphView
         javax.swing.text.LabelView

All Implemented Interfaces:
    TabableView, Cloneable, SwingConstants

Direct Known Subclasses:
    InlineView, ImageLabelView, BRView

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.
Fields inherited from javax.swing.text.GlyphView:
offset,  length,  impliedCR,  skipWidth,  expander,  x,  painter,  defaultPainter
Fields inherited from javax.swing.text.View:
BadBreakWeight,  GoodBreakWeight,  ExcellentBreakWeight,  ForcedBreakWeight,  X_AXIS,  Y_AXIS,  sharedBiasReturn
Constructor:
 public LabelView(Element elem) 
    Constructs a new view wrapped on an element.
    Parameters:
    elem - the element
Method from javax.swing.text.LabelView Summary:
changedUpdate,   getBackground,   getFont,   getFontMetrics,   getForeground,   isStrikeThrough,   isSubscript,   isSuperscript,   isUnderline,   setBackground,   setPropertiesFromAttributes,   setStrikeThrough,   setSubscript,   setSuperscript,   setUnderline,   sync
Methods from javax.swing.text.GlyphView:
breakView,   changedUpdate,   checkPainter,   clone,   createFragment,   getAlignment,   getBackground,   getBreakWeight,   getEndOffset,   getFont,   getForeground,   getGlyphPainter,   getJustificationInfo,   getMinimumSpan,   getNextVisualPositionFrom,   getPartialSpan,   getPreferredSpan,   getStartOffset,   getTabExpander,   getTabbedSpan,   getText,   insertUpdate,   isStrikeThrough,   isSubscript,   isSuperscript,   isUnderline,   modelToView,   paint,   paintTextUsingColor,   removeUpdate,   setGlyphPainter,   viewToModel
Methods from javax.swing.text.View:
append,   breakView,   changedUpdate,   createFragment,   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
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.swing.text.LabelView Detail:
 public  void changedUpdate(DocumentEvent e,
    Shape a,
    ViewFactory f) 
    Gives notification from the document that attributes were changed in a location that this view is responsible for.
 public Color getBackground() 
    Fetches the background color to use to render the glyphs. This is implemented to return a cached background color, which defaults to null.
 public Font getFont() 
    Fetches the font that the glyphs should be based upon. This is implemented to return a cached font.
 protected FontMetrics getFontMetrics() 
Deprecated! FontMetrics - are not used for glyph rendering when running in the JDK.

    Fetches the FontMetrics used for this view.
 public Color getForeground() 
    Fetches the foreground color to use to render the glyphs. This is implemented to return a cached foreground color, which defaults to null.
 public boolean isStrikeThrough() 
    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.

 public boolean isSubscript() 
    Determines if the glyphs should be rendered as superscript.
 public boolean isSuperscript() 
    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.

 public boolean isUnderline() 
    Determines 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.

 protected  void setBackground(Color bg) 
    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.
 protected  void setPropertiesFromAttributes() 
    Sets the cached properties from the attributes.
 protected  void setStrikeThrough(boolean s) 
    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.
 protected  void setSubscript(boolean s) 
    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.
 protected  void setSuperscript(boolean s) 
    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.
 protected  void setUnderline(boolean u) 
    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.
 final  void sync() 
    Synchronize the view's cached values with the model. This causes the font, metrics, color, etc to be re-cached if the cache has been invalidated.