Module java.desktop

Class LabelView

All Implemented Interfaces:
Cloneable, SwingConstants, TabableView
Direct Known Subclasses:
InlineView

public class LabelView extends GlyphView implements TabableView
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.
  • Constructor Details

    • LabelView

      public LabelView(Element elem)
      Constructs a new view wrapped on an element.
      Parameters:
      elem - the element
  • Method Details

    • setUnderline

      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.
      Parameters:
      u - true if the view is underlined, otherwise false
      See Also:
    • setStrikeThrough

      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.
      Parameters:
      s - true if the view has a strike/line through it, otherwise false
      See Also:
    • setSuperscript

      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.
      Parameters:
      s - true if the view represents a superscript, otherwise false
      See Also:
    • setSubscript

      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.
      Parameters:
      s - true if the view represents a subscript, otherwise false
      See Also:
    • setBackground

      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.
      Parameters:
      bg - background color, or null
      Since:
      1.5
      See Also:
    • setPropertiesFromAttributes

      protected void setPropertiesFromAttributes()
      Sets the cached properties from the attributes.
    • getFontMetrics

      @Deprecated protected