Keine Cache-Version

Caching deaktiviert Standardeinstellung für diese Seite:aktiviert (code LNG204)
Wenn die Anzeige zu langsam ist, können Sie den Benutzermodus deaktivieren, um die zwischengespeicherte Version anzuzeigen.
javax.swing.text

Class GlyphView.GlyphPainter

  • Enclosing class:
    GlyphView

    public abstract static class GlyphView.GlyphPainter
    extends Object
    A class to perform rendering of the glyphs. This can be implemented to be stateless, or to hold some information as a cache to facilitate faster rendering and model/view translation. At a minimum, the GlyphPainter allows a View implementation to perform its duties independant of a particular version of JVM and selection of capabilities (i.e. shaping for i18n, etc).
    Since:
    1.3
    • Constructor Detail

      • GlyphView.GlyphPainter

        public GlyphView.GlyphPainter()
    • Method Detail

      • getSpan

        public abstract float getSpan(GlyphView v,
                    int p0,
                    int p1,
                    TabExpander e,
                    float x)
        Determine the span the glyphs given a start location (for tab expansion).
      • getHeight

        public abstract float getHeight(GlyphView v)
      • getAscent

        public abstract float getAscent(GlyphView v)
      • getDescent

        public abstract float getDescent(GlyphView v)
      • paint

        public abstract void paint(GlyphView v,
                 Graphics g,
                 Shape a,
                 int p0,
                 int p1)
        Paint the glyphs representing the given range.
      • viewToModel

        public abstract int viewToModel(GlyphView v,
                      float x,
                      float y,
                      Shape a,
                      Position.Bias[] biasReturn)
        Provides a mapping from the view coordinate space to the logical coordinate space of the model.
        Parameters:
        v - the GlyphView to provide a mapping for
        x - the X coordinate
        y - the Y coordinate
        a - the allocated region to render into
        biasReturn - either Position.Bias.Forward or Position.Bias.Backward is returned as the zero-th element of this array
        Returns:
        the location within the model that best represents the given point of view
        See Also:
        View.viewToModel(float, float, java.awt.Shape, javax.swing.text.Position.Bias[])
      • getBoundedPosition

        public abstract int getBoundedPosition(GlyphView v,
                             int p0,
                             float x,
                             float len)
        Determines the model location that represents the maximum advance that fits within the given span. This could be used to break the given view. The result should be a location just shy of the given advance. This differs from viewToModel which returns the closest position which might be proud of the maximum advance.
        Parameters:
        v - the view to find the model location to break at.
        p0 - the location in the model where the fragment should start it's representation >= 0.
        x - the graphic location along the axis that the broken view would occupy >= 0. This may be useful for things like tab calculations.
        len - specifies the distance into the view where a potential break is desired >= 0.
        Returns:
        the maximum model location possible for a break.
        See Also:
        View.breakView(int, int, float, float)
      • getPainter

        public GlyphView.GlyphPainter getPainter(GlyphView v,
                                        int p0,
                                        int p1)
        Create a painter to use for the given GlyphView. If the painter carries state it can create another painter to represent a new GlyphView that is being created. If the painter doesn't hold any significant state, it can return itself. The default behavior is to return itself.
        Parameters:
        v - the GlyphView to provide a painter for
        p0 - the starting document offset >= 0
        p1 - the ending document offset >= p0
      • getNextVisualPositionFrom

        public int getNextVisualPositionFrom(GlyphView v,
                                    int pos,
                                    Position.Bias b,
                                    Shape a,
                                    int direction,
                                    Position.Bias[] biasRet)
                                      throws BadLocationException
        Provides a way to determine the next visually represented model location that one might place a caret. Some views may not be visible, they might not be in the same order found in the model, or they just might not allow access to some of the locations in the model.
        Parameters:
        v - the view to use
        pos - the position to convert >= 0
        b - either Position.Bias.Forward or Position.Bias.Backward
        a - the allocated region to render into
        direction - the direction from the current position that can be thought of as the arrow keys typically found on a keyboard. This may be SwingConstants.WEST, SwingConstants.EAST, SwingConstants.NORTH, or SwingConstants.SOUTH.
        biasRet - either Position.Bias.Forward or Position.Bias.Backward is returned as the zero-th element of this array
        Returns:
        the location within the model that best represents the next location visual position.
        Throws:
        BadLocationException
        IllegalArgumentException - for an invalid direction

Deutsche Übersetzung

Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.

Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.

Vielen Dank im Voraus.

Dokument erstellt 11/06/2005, zuletzt geändert 04/03/2020
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/java-api-rf-javax/swing/text/glyphview.glyphpainter.html

Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.

Referenzen

  1. Zeigen Sie - html-Dokument Sprache des Dokuments:fr Manuel PHP : https://docs.oracle.com

Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor Diese Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.

Inhaltsverzeichnis Haut