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

Class SpringLayout.Constraints

  • Enclosing class:
    SpringLayout

    public static class SpringLayout.Constraints
    extends Object
    A Constraints object holds the constraints that govern the way a component's size and position change in a container controlled by a SpringLayout. A Constraints object is like a Rectangle, in that it has x, y, width, and height properties. In the Constraints object, however, these properties have Spring values instead of integers. In addition, a Constraints object can be manipulated as four edges -- north, south, east, and west -- using the constraint property.

    The following formulas are always true for a Constraints object (here WEST and x are synonyms, as are and NORTH and y):

                   EAST = WEST + WIDTH
                  SOUTH = NORTH + HEIGHT
      HORIZONTAL_CENTER = WEST + WIDTH/2
        VERTICAL_CENTER = NORTH + HEIGHT/2
      ABSOLUTE_BASELINE = NORTH + RELATIVE_BASELINE*
     

    For example, if you have specified the WIDTH and WEST (X) location the EAST is calculated as WEST + WIDTH. If you instead specified the WIDTH and EAST locations the WEST (X) location is then calculated as EAST - WIDTH.

    [RELATIVE_BASELINE is a private constraint that is set automatically when the SpringLayout.Constraints(Component) constuctor is called or when a constraints object is registered with a SpringLayout object.]

    Note: In this document, operators represent methods in the Spring class. For example, "a + b" is equal to Spring.sum(a, b), and "a - b" is equal to Spring.sum(a, Spring.minus(b)). See the Spring API documentation for further details of spring arithmetic.

    Because a Constraints object's properties -- representing its edges, size, and location -- can all be set independently and yet are interrelated, a Constraints object can become over-constrained. For example, if the WEST, WIDTH and EAST edges are all set, steps must be taken to ensure that the first of the formulas above holds. To do this, the Constraints object throws away the least recently set constraint so as to make the formulas hold.

    Since:
    1.4
    • Constructor Detail

      • SpringLayout.Constraints

        public SpringLayout.Constraints()
        Creates an empty Constraints object.
      • SpringLayout.Constraints

        public SpringLayout.Constraints(Spring x,
                                Spring y)
        Creates a Constraints object with the specified values for its x and y properties. The height and width springs have null values.
        Parameters:
        x - the spring controlling the component's x value
        y - the spring controlling the component's y value
      • SpringLayout.Constraints

        public SpringLayout.Constraints(Spring x,
                                Spring y,
                                Spring width,
                                Spring height)
        Creates a Constraints object with the specified values for its x, y, width, and height properties. Note: If the SpringLayout class encounters null values in the Constraints object of a given component, it replaces them with suitable defaults.
        Parameters:
        x - the spring value for the x property
        y - the spring value for the y property
        width - the spring value for the width property
        height - the spring value for the height property
      • SpringLayout.Constraints

        public SpringLayout.Constraints(Component c)
        Creates a Constraints object with suitable x, y, width and height springs for component, c. The x and y springs are constant springs initialised with the component's location at the time this method is called. The width and height springs are special springs, created by the Spring.width() and Spring.height() methods, which track the size characteristics of the component when they change.
        Parameters:
        c - the component whose characteristics will be reflected by this Constraints object
        Throws:
        NullPointerException - if c is null.
        Since:
        1.5

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/springlayout.constraints.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