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
Specifies the origin of this
Stylesheet . |
private <any> |
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)
Converts the css file referenced by
source to binary format and writes it to destination . |
boolean |
equals(java.lang.Object obj) |
java.util.List<FontFace> |
getFontFaces()
Returns the font faces used by this
Stylesheet . |
StyleOrigin |
getOrigin()
Returns the origin of this
Stylesheet . |
java.util.List<Rule> |
getRules()
Returns the rules that are defined in this
Stylesheet . |
(package private) java.lang.String[] |
getStringStore() |
java.lang.String |
getUrl()
The URL from which this
Stylesheet was loaded. |
int |
hashCode() |
(package private) void |
importStylesheet(Stylesheet importedStylesheet) |
static Stylesheet |
loadBinary(java.net.URL url)
Loads a binary stylesheet from a
URL . |
(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,
StyleConverter.StringStore stringStore) |
static final int BINARY_CSS_VERSION
private final java.lang.String url
private StyleOrigin origin
Stylesheet
. We need to know this so
that we can make user important styles have higher priority than
author styles.private final <any> rules
private final java.util.List<FontFace> fontFaces
private java.lang.String[] stringStore
Stylesheet()
Stylesheet(java.lang.String url)
url
- the base URI for this stylesheetpublic java.lang.String getUrl()
Stylesheet
was loaded.String
representation of the URL from which the stylesheet was loaded, or null
if
the stylesheet was created from an inline style.public StyleOrigin getOrigin()
Stylesheet
.Stylesheet
public void setOrigin(StyleOrigin origin)
public java.util.List<Rule> getRules()
Stylesheet
.Stylesheet
public java.util.List<FontFace> getFontFaces()
Stylesheet
.Stylesheet
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, StyleConverter.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
URL
.url
- the URL
from which the Stylesheet
will be loadedStylesheet
java.io.IOException
- if the binary stream corresponds to a more recent binary
css version or if an I/O error occurs while reading from the streampublic static void convertToBinary(java.io.File source, java.io.File destination) throws java.io.IOException
source
to binary format and writes it to destination
.source
- the JavaFX compliant css file to convertdestination
- the file to which the binary formatted data is writtenjava.io.IOException
- if the destination file can not be created or if an I/O error occursjava.lang.IllegalArgumentException
- if either parameter is null
, if source
and
destination
are the same, if source
cannot be read, or if destination
cannot be writtenvoid importStylesheet(Stylesheet importedStylesheet)