Class BasicElementStyle

    • Constructor Detail

      • BasicElementStyle

        public BasicElementStyle​(ElementStylePropertyMap propertyMap)
        Creates an instance connected to the given map.
        Parameters:
        propertyMap - the feature where the data is stored
    • Method Detail

      • set

        public Style set​(String name,
                         String value)
        Description copied from interface: Style
        Sets the given style property to the given value.

        Both camelCased (e.g. fontFamily) and dash-separated (e.g. font-family versions are supported.

        Specified by:
        set in interface Style
        Parameters:
        name - the style property name as camelCase, not null
        value - the style property value (if null, the property will be removed)
        Returns:
        this style instance
      • remove

        public Style remove​(String name)
        Description copied from interface: Style
        Removes the given style property if it has been set.

        Both camelCased (e.g. fontFamily) and dash-separated (e.g. font-family versions are supported.

        Specified by:
        remove in interface Style
        Parameters:
        name - the style property name as camelCase, not null
        Returns:
        this style instance
      • clear

        public Style clear()
        Description copied from interface: Style
        Removes all set style properties.
        Specified by:
        clear in interface Style
        Returns:
        this style instance
      • get

        public String get​(String name)
        Description copied from interface: Style
        Gets the value of the given style property.

        Note that the name should be in camelCase and not dash-separated, i.e. use "fontFamily" and not "font-family"

        Specified by:
        get in interface Style
        Parameters:
        name - the style property name as camelCase, not null
        Returns:
        the style property value, or null if the style property has not been set
      • getNames

        public Stream<String> getNames()
        Description copied from interface: Style
        Gets the defined style property names.

        Note that this always returns the name as camelCased, e.g. fontFamily even if it has been set as dash-separated (font-family).

        Specified by:
        getNames in interface Style
        Returns:
        a stream of defined style property names
      • has

        public boolean has​(String name)
        Description copied from interface: Style
        Checks if the given style property has been set.

        Both camelCased (e.g. fontFamily) and dash-separated (e.g. font-family versions are supported.

        Specified by:
        has in interface Style
        Parameters:
        name - the style property name as camelCase, not null
        Returns:
        true if the style property has been set, false otherwise