Geen cache-versie.

Caching uitgeschakeld. Standaardinstelling voor deze pagina:ingeschakeld (code LNG204)
Als het scherm te langzaam is, kunt u de gebruikersmodus uitschakelen om de cacheversie te bekijken.
javax.swing.text

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 Detail

      • LabelView

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

      • 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:
        isUnderline()
      • 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:
        isStrikeThrough()
      • 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:
        isSuperscript()
      • 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:
        isSubscript()
      • 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()
      • setPropertiesFromAttributes

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

        @Deprecated
        protected FontMetrics getFontMetrics()
        Deprecated. FontMetrics are not used for glyph rendering when running in the JDK.
        Fetches the FontMetrics used for this view.
      • getBackground

        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.
        Overrides:
        getBackground in class GlyphView
        Returns:
        the cached background color
        Since:
        1.3
      • getForeground

        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.
        Overrides:
        getForeground in class GlyphView
        Returns:
        the cached foreground color
        Since:
        1.3
      • getFont

        public Font getFont()
        Fetches the font that the glyphs should be based upon. This is implemented to return a cached font.
        Overrides:
        getFont in class GlyphView
        Returns:
        the cached font
      • isUnderline

        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.

        Overrides:
        isUnderline in class GlyphView
        Returns:
        the value of the cached underline property
        Since:
        1.3
      • isStrikeThrough

        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.

        Overrides:
        isStrikeThrough in class GlyphView
        Returns:
        the value of the cached strikeThrough property
        Since:
        1.3
      • isSubscript

        public boolean isSubscript()
        Determines if the glyphs should be rendered as superscript.
        Overrides:
        isSubscript in class GlyphView
        Returns:
        the value of the cached subscript 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.

        Since:
        1.3
      • isSuperscript

        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.

        Overrides:
        isSuperscript in class GlyphView
        Returns:
        the value of the cached superscript property
        Since:
        1.3

Nederlandse vertaling

U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.

Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.

Bij voorbaat dank.

Document heeft de 11/06/2005 gemaakt, de laatste keer de 04/03/2020 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-rf-javax/swing/text/labelview.html

De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.

Referenties

  1. Bekijk - html-document Taal van het document:fr Manuel PHP : https://docs.oracle.com

Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur Deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.

Inhoudsopgave Haut