- java.lang.Object
-
- 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 moreRules
, 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.
-
-
-
Method Detail
-
getUrl
public String 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 getOrigin()
-
setOrigin
public void setOrigin(StyleOrigin origin)
-
toString
public String toString()
Returns a string representation of this object.
-
loadBinary
public static Stylesheet loadBinary(URL url) throws IOException
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
- 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.- Parameters:
source
- is the JavaFX .css file to convertdestination
- is the file to which the binary conversion is written- Throws:
IOException
- the exceptionIllegalArgumentException
- if either parameter is null, if source and destination are the same, if source cannot be read, or if destination cannot be written.
-
-