Package javafx.css

Class Stylesheet

  • public class Stylesheet
    extends Object
    A stylesheet which can apply properties to a tree of objects. A stylesheet is a collection of zero or more Rules, each of which is applied to each object in the tree. Typically the selector will examine the object to determine whether or not it is applicable, and if so it will apply certain property values to the object.
    • Method Detail

      • getUrl

        public String getUrl()
        The URL from which the stylesheet was loaded.
        The URL from which the stylesheet was loaded, or null if the stylesheet was created from an inline style.
      • setOrigin

        public void setOrigin​(StyleOrigin origin)
      • getRules

        public List<Rule> getRules()
      • toString

        public String toString()
        Returns a string representation of this object.
        toString in class Object
        a string representation of the object.
      • loadBinary

        public static Stylesheet loadBinary​(URL url)
                                     throws IOException
        Load a binary stylesheet file from a input stream.
        url - the URL from which the stylesheet will be loaded
        the constructed stylesheet
        IOException - the exception
      • convertToBinary

        public static void convertToBinary​(File source,
                                           File destination)
                                    throws IOException
        Convert the .css file referenced by urlIn to binary format and write to urlOut.
        source - is the JavaFX .css file to convert
        destination - is the file to which the binary conversion is written
        IOException - the exception
        IllegalArgumentException - if either parameter is null, if source and destination are the same, if source cannot be read, or if destination cannot be written.