Stylesheet (Java SE 10 & JDK 10 ) (original) (raw)
- javafx.css.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.
Since:
9
Method Summary
All Methods Static Methods Instance Methods Concrete Methods
Modifier and Type Method Description static void convertToBinary(File source,File destination) Convert the .css file referenced by urlIn to binary format and write to urlOut. List<FontFace> getFontFaces() StyleOrigin getOrigin() List<Rule> getRules() String getUrl() The URL from which the stylesheet was loaded. static Stylesheet loadBinary(URL url) Load a binary stylesheet file from a input stream. void setOrigin(StyleOrigin origin) String toString() Returns a string representation of this object. * ### Methods declared in class java.lang.[Object](../../java/lang/Object.html "class in java.lang") `[clone](../../java/lang/Object.html#clone%28%29), [equals](../../java/lang/Object.html#equals%28java.lang.Object%29), [finalize](../../java/lang/Object.html#finalize%28%29), [getClass](../../java/lang/Object.html#getClass%28%29), [hashCode](../../java/lang/Object.html#hashCode%28%29), [notify](../../java/lang/Object.html#notify%28%29), [notifyAll](../../java/lang/Object.html#notifyAll%28%29), [wait](../../java/lang/Object.html#wait%28%29), [wait](../../java/lang/Object.html#wait%28long%29), [wait](../../java/lang/Object.html#wait%28long,int%29)`
Method Detail
* #### getUrl public [String](../../java/lang/String.html "class in java.lang") getUrl() The URL from which the stylesheet was loaded. Returns: The URL from which the stylesheet was loaded, or null if the stylesheet was created from an inline style. * #### getOrigin public [StyleOrigin](../../javafx/css/StyleOrigin.html "enum in javafx.css") getOrigin() * #### setOrigin public void setOrigin([StyleOrigin](../../javafx/css/StyleOrigin.html "enum in javafx.css") origin) * #### getRules public [List](../../java/util/List.html "interface in java.util")<[Rule](../../javafx/css/Rule.html "class in javafx.css")> getRules() * #### getFontFaces public [List](../../java/util/List.html "interface in java.util")<[FontFace](../../javafx/css/FontFace.html "class in javafx.css")> getFontFaces() * #### toString public [String](../../java/lang/String.html "class in java.lang") toString() Returns a string representation of this object. Overrides: `[toString](../../java/lang/Object.html#toString%28%29)` in class `[Object](../../java/lang/Object.html "class in java.lang")` Returns: a string representation of the object. * #### loadBinary public static [Stylesheet](../../javafx/css/Stylesheet.html "class in javafx.css") loadBinary([URL](../../java/net/URL.html "class in java.net") url) throws [IOException](../../java/io/IOException.html "class in java.io") Load a binary stylesheet file from a input stream. Parameters: `url` \- the URL from which the stylesheet will be loaded Returns: the constructed stylesheet Throws: `[IOException](../../java/io/IOException.html "class in java.io")` \- the exception * #### convertToBinary public static void convertToBinary([File](../../java/io/File.html "class in java.io") source, [File](../../java/io/File.html "class in java.io") destination) throws [IOException](../../java/io/IOException.html "class in java.io") Convert the .css file referenced by urlIn to binary format and write to urlOut. Parameters: `source` \- is the JavaFX .css file to convert `destination` \- is the file to which the binary conversion is written Throws: `[IOException](../../java/io/IOException.html "class in java.io")` \- the exception `[IllegalArgumentException](../../java/lang/IllegalArgumentException.html "class in java.lang")` \- if either parameter is null, if source and destination are the same, if source cannot be read, or if destination cannot be written.
Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2018, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.