javax.swing.plaf.nimbus

Class NimbusLookAndFeel

    • Constructor Detail

      • NimbusLookAndFeel

        public NimbusLookAndFeel()
        Create a new NimbusLookAndFeel.
    • Method Detail

      • getStyle

        public static NimbusStyle getStyle(JComponent c,
                           Region r)
        Gets the style associated with the given component and region. This will never return null. If an appropriate component and region cannot be determined, then a default style is returned.
        Parameters:
        c - a non-null reference to a JComponent
        r - a non-null reference to the region of the component c
        Returns:
        a non-null reference to a NimbusStyle.
      • getName

        public String getName()
        Return a short string that identifies this look and feel. This String will be the unquoted String "Nimbus".
        Overrides:
        getName in class SynthLookAndFeel
        Returns:
        a short string identifying this look and feel.
      • getID

        public String getID()
        Return a string that identifies this look and feel. This String will be the unquoted String "Nimbus".
        Overrides:
        getID in class SynthLookAndFeel
        Returns:
        a short string identifying this look and feel.
      • getDescription

        public String getDescription()
        Returns a textual description of this look and feel.
        Overrides:
        getDescription in class SynthLookAndFeel
        Returns:
        textual description of this look and feel.
      • shouldUpdateStyleOnAncestorChanged

        public boolean shouldUpdateStyleOnAncestorChanged()
        Description copied from class: SynthLookAndFeel
        Returns whether or not the UIs should update their SynthStyles from the SynthStyleFactory when the ancestor of the JComponent changes. A subclass that provided a SynthStyleFactory that based the return value from getStyle off the containment hierarchy would override this method to return true.
        Overrides:
        shouldUpdateStyleOnAncestorChanged in class SynthLookAndFeel
        Returns:
        true
      • shouldUpdateStyleOnEvent

        protected boolean shouldUpdateStyleOnEvent(PropertyChangeEvent ev)
        Description copied from class: SynthLookAndFeel
        Returns whether or not the UIs should update their styles when a particular event occurs.
        Overrides:
        shouldUpdateStyleOnEvent in class SynthLookAndFeel
        Parameters:
        ev - a PropertyChangeEvent
        Returns:
        whether or not the UIs should update their styles
        Since:
        1.7
      • register

        public void register(Region region,
                    String prefix)

        Registers a third party component with the NimbusLookAndFeel.

        Regions represent Components and areas within Components that act as independent painting areas. Once registered with the NimbusLookAndFeel, NimbusStyles for these Regions can be retrieved via the getStyle method.

        The NimbusLookAndFeel uses a standard naming scheme for entries in the UIDefaults table. The key for each property, state, painter, and other default registered in UIDefaults for a specific Region will begin with the specified prefix

        For example, suppose I had a component named JFoo. Suppose I then registered this component with the NimbusLookAndFeel in this manner:

        
             laf.register(NimbusFooUI.FOO_REGION, "Foo");
         

        In this case, I could then register properties for this component with UIDefaults in the following manner:

        
             UIManager.put("Foo.background", new ColorUIResource(Color.BLACK));
             UIManager.put("Foo.Enabled.backgroundPainter", new FooBackgroundPainter());
         

        It is also possible to register a named component with Nimbus. For example, suppose you wanted to style the background of a JPanel named "MyPanel" differently from other JPanels. You could accomplish this by doing the following:

        
             laf.register(Region.PANEL, "\"MyPanel\"");
             UIManager.put("\"MyPanel\".background", new ColorUIResource(Color.RED));
         
        Parameters:
        region - The Synth Region that is being registered. Such as Button, or ScrollBarThumb, or NimbusFooUI.FOO_REGION.
        prefix - The UIDefault prefix. For example, could be ComboBox, or if a named components, "MyComboBox", or even something like ToolBar."MyComboBox"."ComboBox.arrowButton"
      • getDisabledIcon

        public Icon getDisabledIcon(JComponent component,
                           Icon icon)
        Description copied from class: LookAndFeel
        Returns an Icon with a disabled appearance. This method is used to generate a disabled Icon when one has not been specified. For example, if you create a JButton and only specify an Icon via setIcon this method will be called to generate the disabled Icon. If null is passed as icon this method returns null.

        Some look and feels might not render the disabled Icon, in which case they will ignore this.

        Overrides:
        getDisabledIcon in class LookAndFeel
        Parameters:
        component - JComponent that will display the Icon, may be null
        icon - Icon to generate the disabled icon from
        Returns:
        disabled Icon, or null if a suitable Icon can not be generated
      • getDerivedColor

        public Color getDerivedColor(String uiDefaultParentName,
                            float hOffset,
                            float sOffset,
                            float bOffset,
                            int aOffset,
                            boolean uiResource)
        Get a derived color, derived colors are shared instances and is color value will change when its parent UIDefault color changes.
        Parameters:
        uiDefaultParentName - The parent UIDefault key
        hOffset - The hue offset
        sOffset - The saturation offset
        bOffset - The brightness offset
        aOffset - The alpha offset
        uiResource - True if the derived color should be a UIResource, false if it should not be
        Returns:
        The stored derived color
      • getDerivedColor

        protected final Color getDerivedColor(Color color1,
                            Color color2,
                            float midPoint,
                            boolean uiResource)
        Decodes and returns a color, which is derived from an offset between two other colors.
        Parameters:
        color1 - The first color
        color2 - The second color
        midPoint - The offset between color 1 and color 2, a value of 0.0 is color 1 and 1.0 is color 2;
        uiResource - True if the derived color should be a UIResource
        Returns:
        The derived color
      • getDerivedColor

        protected final Color getDerivedColor(Color color1,
                            Color color2,
                            float midPoint)
        Decodes and returns a color, which is derived from a offset between two other colors.
        Parameters:
        color1 - The first color
        color2 - The second color
        midPoint - The offset between color 1 and color 2, a value of 0.0 is color 1 and 1.0 is color 2;
        Returns:
        The derived color, which will be a UIResource

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/plaf/nimbus/NimbusLookAndFeel.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