public class Stylesheet
extends java.lang.Object
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.
Modifier and Type | Field and Description |
---|---|
(package private) static int |
BINARY_CSS_VERSION
Version number of binary CSS format.
|
private java.util.List<FontFace> |
fontFaces
List of all font faces
|
private StyleOrigin |
origin
True if this style came from user stylesheet, we need to know this so
that we can make user important styles have higher priority than
author styles
|
private ObservableList<Rule> |
rules
All the rules contained in the stylesheet in the order they are in the file
|
private java.lang.String[] |
stringStore |
private java.lang.String |
url |
Constructor and Description |
---|
Stylesheet()
Constructs a stylesheet with the base URI defaulting to the root
path of the application.
|
Stylesheet(java.lang.String url)
Constructs a Stylesheet using the given URL as the base URI.
|
Modifier and Type | Method and Description |
---|---|
static void |
convertToBinary(java.io.File source,
java.io.File destination)
Convert the .css file referenced by urlIn to binary format and write to urlOut.
|
boolean |
equals(java.lang.Object obj) |
java.util.List<FontFace> |
getFontFaces() |
StyleOrigin |
getOrigin() |
java.util.List<Rule> |
getRules() |
(package private) java.lang.String[] |
getStringStore() |
java.lang.String |
getUrl()
The URL from which the stylesheet was loaded.
|
int |
hashCode() |
void |
importStylesheet(Stylesheet importedStylesheet) |
static Stylesheet |
loadBinary(java.net.URL url)
Load a binary stylesheet file from a input stream
|
(package private) void |
readBinary(int bssVersion,
java.io.DataInputStream is,
java.lang.String[] strings) |
void |
setOrigin(StyleOrigin origin) |
java.lang.String |
toString()
Returns a string representation of this object.
|
(package private) void |
writeBinary(java.io.DataOutputStream os,
StringStore stringStore) |
static final int BINARY_CSS_VERSION
private final java.lang.String url
private StyleOrigin origin
private final ObservableList<Rule> rules
private final java.util.List<FontFace> fontFaces
private java.lang.String[] stringStore
public Stylesheet()
public Stylesheet(java.lang.String url)
url
- public java.lang.String getUrl()
public StyleOrigin getOrigin()
public void setOrigin(StyleOrigin origin)
public java.util.List<Rule> getRules()
public java.util.List<FontFace> getFontFaces()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
final void writeBinary(java.io.DataOutputStream os, StringStore stringStore) throws java.io.IOException
java.io.IOException
final void readBinary(int bssVersion, java.io.DataInputStream is, java.lang.String[] strings) throws java.io.IOException
java.io.IOException
final java.lang.String[] getStringStore()
public static Stylesheet loadBinary(java.net.URL url) throws java.io.IOException
java.io.IOException
public static void convertToBinary(java.io.File source, java.io.File destination) throws java.io.IOException
source
- is the JavaFX .css file to convertdestination
- is the file to which the binary conversion is writtenjava.io.IOException
java.lang.IllegalArgumentException
- if either parameter is null, if source and destination are the same,
if source cannot be read, or if destination cannot be written.public void importStylesheet(Stylesheet importedStylesheet)