javax.swing.text.html

Class ParagraphView

    • Constructor Detail

      • ParagraphView

        public ParagraphView(Element elem)
        Constructs a ParagraphView for the given element.
        Parameters:
        elem - the element that this view is responsible for
    • Method Detail

      • setParent

        public void setParent(View parent)
        Establishes the parent view for this view. This is guaranteed to be called before any other methods if the parent view is functioning properly.

        This is implemented to forward to the superclass as well as call the setPropertiesFromAttributes method to set the paragraph properties from the css attributes. The call is made at this time to ensure the ability to resolve upward through the parents view attributes.

        Overrides:
        setParent in class FlowView
        Parameters:
        parent - the new parent, or null if the view is being removed from a parent it was previously added to
      • getAttributes

        public AttributeSet getAttributes()
        Fetches the attributes to use when rendering. This is implemented to multiplex the attributes specified in the model with a StyleSheet.
        Overrides:
        getAttributes in class View
      • setPropertiesFromAttributes

        protected void setPropertiesFromAttributes()
        Sets up the paragraph from css attributes instead of the values found in StyleConstants (i.e. which are used by the superclass). Since
        Overrides:
        setPropertiesFromAttributes in class ParagraphView
      • getStyleSheet

        protected StyleSheet getStyleSheet()
      • calculateMinorAxisRequirements

        protected SizeRequirements calculateMinorAxisRequirements(int axis,
                                                      SizeRequirements r)
        Calculate the needs for the paragraph along the minor axis.

        If size requirements are explicitly specified for the paragraph, use that requirements. Otherwise, use the requirements of the superclass ParagraphView.

        If the axis parameter is neither View.X_AXIS nor View.Y_AXIS, IllegalArgumentException is thrown. If the r parameter is null, a new SizeRequirements object is created, otherwise the supplied SizeRequirements object is returned.

        Overrides:
        calculateMinorAxisRequirements in class ParagraphView
        Parameters:
        axis - the minor axis
        r - the input SizeRequirements object
        Returns:
        the new or adjusted SizeRequirements object
        Throws:
        IllegalArgumentException - if the axis parameter is invalid
        See Also:
        SizeRequirements
      • isVisible

        public boolean isVisible()
        Indicates whether or not this view should be displayed. If none of the children wish to be displayed and the only visible child is the break that ends the paragraph, the paragraph will not be considered visible. Otherwise, it will be considered visible and return true.
        Overrides:
        isVisible in class View
        Returns:
        true if the paragraph should be displayed
      • paint

        public void paint(Graphics g,
                 Shape a)
        Renders using the given rendering surface and area on that surface. This is implemented to delgate to the superclass after stashing the base coordinate for tab calculations.
        Overrides:
        paint in class ParagraphView
        Parameters:
        g - the rendering surface to use
        a - the allocated region to render into
        See Also:
        View.paint(java.awt.Graphics, java.awt.Shape)
      • getPreferredSpan

        public float getPreferredSpan(int axis)
        Determines the preferred span for this view. Returns 0 if the view is not visible, otherwise it calls the superclass method to get the preferred span. axis.
        Overrides:
        getPreferredSpan in class BoxView
        Parameters:
        axis - may be either View.X_AXIS or View.Y_AXIS
        Returns:
        the span the view would like to be rendered into; typically the view is told to render into the span that is returned, although there is no guarantee; the parent may choose to resize or break the view
        See Also:
        BoxView.getPreferredSpan(int)
      • getMinimumSpan

        public float getMinimumSpan(int axis)
        Determines the minimum span for this view along an axis. Returns 0 if the view is not visible, otherwise it calls the superclass method to get the minimum span.
        Overrides:
        getMinimumSpan in class BoxView
        Parameters:
        axis - may be either View.X_AXIS or View.Y_AXIS
        Returns:
        the minimum span the view can be rendered into
        See Also:
        BoxView.getMinimumSpan(int)
      • getMaximumSpan

        public float getMaximumSpan(int axis)
        Determines the maximum span for this view along an axis. Returns 0 if the view is not visible, otherwise it calls the superclass method ot get the maximum span.
        Overrides:
        getMaximumSpan in class BoxView
        Parameters:
        axis - may be either View.X_AXIS or View.Y_AXIS
        Returns:
        the maximum span the view can be rendered into
        See Also:
        BoxView.getMaximumSpan(int)

Traduction non disponible

Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.

Version en cache

19/12/2024 12:27:36 Cette version de la page est en cache (à la date du 19/12/2024 12:27:36) afin d'accélérer le traitement. Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la dernère version de la page.

Document créé le 01/09/2006, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-javax/swing/text/html/paragraphview.html

L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.

Références

  1. Consulter le document html Langue du document :fr Manuel PHP : https://docs.oracle.com, ParagraphView

Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.

Table des matières Haut