Interface FlatStyleableComponent

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      java.lang.Object getClientProperty​(java.lang.Object key)
      Overrides JComponent.getClientProperty(Object).
      default java.lang.String getStyle()
      Returns the style of a component as String in CSS syntax ("key1: value1; key2: value2; ...") or null if no style has been assigned.
      default java.lang.String getStyleClass()
      Returns the style class(es) of a component (separated by space characters) or null if no style class has been assigned.
      default java.util.Map<java.lang.String,​java.lang.Object> getStyleMap()
      Returns the style of a component as Map<String, Object> or null if no style has been assigned.
      void putClientProperty​(java.lang.Object key, java.lang.Object value)
      Overrides JComponent.putClientProperty(Object, Object).
      default void setStyle​(java.lang.String style)
      Specifies the style of a component as String in CSS syntax ("key1: value1; key2: value2; ...").
      default void setStyleClass​(java.lang.String styleClass)
      Specifies the style class(es) of a component (separated by space characters).
      default void setStyleMap​(java.util.Map<java.lang.String,​java.lang.Object> styleMap)
      Specifies the style of a component as Map<String, Object> with binary values.
    • Method Detail

      • getStyle

        default java.lang.String getStyle()
        Returns the style of a component as String in CSS syntax ("key1: value1; key2: value2; ...") or null if no style has been assigned.
        See Also:
        FlatClientProperties.STYLE
      • setStyle

        default void setStyle​(java.lang.String style)
        Specifies the style of a component as String in CSS syntax ("key1: value1; key2: value2; ...").

        The keys are the same as used in UI defaults, but without component type prefix. E.g. for UI default Slider.thumbSize use key thumbSize.

        The syntax of the CSS values is the same as used in FlatLaf properties files (https://www.formdev.com/flatlaf/properties-files/), but some features are not supported (e.g. variables).

        See Also:
        FlatClientProperties.STYLE
      • getStyleMap

        default java.util.Map<java.lang.String,​java.lang.Object> getStyleMap()
        Returns the style of a component as Map<String, Object> or null if no style has been assigned.
        See Also:
        FlatClientProperties.STYLE
      • setStyleMap

        default void setStyleMap​(java.util.Map<java.lang.String,​java.lang.Object> styleMap)
        Specifies the style of a component as Map<String, Object> with binary values.

        The keys are the same as used in UI defaults, but without component type prefix. E.g. for UI default Slider.thumbSize use key thumbSize.

        The values are not parsed from a string. They must be binary.

        See Also:
        FlatClientProperties.STYLE
      • getStyleClass

        default java.lang.String getStyleClass()
        Returns the style class(es) of a component (separated by space characters) or null if no style class has been assigned.
        See Also:
        FlatClientProperties.STYLE_CLASS
      • setStyleClass

        default void setStyleClass​(java.lang.String styleClass)
        Specifies the style class(es) of a component (separated by space characters).
        See Also:
        FlatClientProperties.STYLE_CLASS
      • getClientProperty

        java.lang.Object getClientProperty​(java.lang.Object key)
        Overrides JComponent.getClientProperty(Object).
      • putClientProperty

        void putClientProperty​(java.lang.Object key,
                               java.lang.Object value)
        Overrides JComponent.putClientProperty(Object, Object).