modules/graphics/src/main/java/javafx/css/Rule.java
Print this page
rev 9240 : 8076423: JEP 253: Prepare JavaFX UI Controls & CSS APIs for Modularization
*** 21,39 ****
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
! package com.sun.javafx.css;
- import com.sun.javafx.collections.TrackableObservableList;
import javafx.collections.ListChangeListener.Change;
import javafx.collections.ObservableList;
- import javafx.css.PseudoClass;
- import javafx.css.StyleOrigin;
import javafx.scene.Node;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
--- 21,38 ----
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
! package javafx.css;
import javafx.collections.ListChangeListener.Change;
import javafx.collections.ObservableList;
import javafx.scene.Node;
+ import com.sun.javafx.collections.TrackableObservableList;
+
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
*** 41,60 ****
import java.util.List;
import java.util.Set;
/*
* A selector is a collection of selectors and declarations.
*/
final public class Rule {
private List<Selector> selectors = null;
/**
* The list returned from this method should be treated as unmodifiable.
* Tools should use {@link #getSelectors()} which tracks adds and removes.
*/
! public List<Selector> getUnobservedSelectorList() {
if (selectors == null) {
selectors = new ArrayList<Selector>();
}
return selectors;
}
--- 40,61 ----
import java.util.List;
import java.util.Set;
/*
* A selector is a collection of selectors and declarations.
+ *
+ * @since 9
*/
final public class Rule {
private List<Selector> selectors = null;
/**
* The list returned from this method should be treated as unmodifiable.
* Tools should use {@link #getSelectors()} which tracks adds and removes.
*/
! List<Selector> getUnobservedSelectorList() {
if (selectors == null) {
selectors = new ArrayList<Selector>();
}
return selectors;
}
*** 62,72 ****
private List<Declaration> declarations = null;
/**
* The list returned from this method should be treated as unmodifiable.
* Tools should use {@link #getDeclarations()} which tracks adds and removes.
*/
! public List<Declaration> getUnobservedDeclarationList() {
if (declarations == null && serializedDecls != null) {
try {
ByteArrayInputStream bis = new ByteArrayInputStream(serializedDecls);
--- 63,73 ----
private List<Declaration> declarations = null;
/**
* The list returned from this method should be treated as unmodifiable.
* Tools should use {@link #getDeclarations()} which tracks adds and removes.
*/
! List<Declaration> getUnobservedDeclarationList() {
if (declarations == null && serializedDecls != null) {
try {
ByteArrayInputStream bis = new ByteArrayInputStream(serializedDecls);
*** 164,174 ****
public StyleOrigin getOrigin() {
return stylesheet != null ? stylesheet.getOrigin() : null;
}
! public Rule(List<Selector> selectors, List<Declaration> declarations) {
this.selectors = selectors;
this.declarations = declarations;
serializedDecls = null;
this.bssVersion = Stylesheet.BINARY_CSS_VERSION;
--- 165,175 ----
public StyleOrigin getOrigin() {
return stylesheet != null ? stylesheet.getOrigin() : null;
}
! Rule(List<Selector> selectors, List<Declaration> declarations) {
this.selectors = selectors;
this.declarations = declarations;
serializedDecls = null;
this.bssVersion = Stylesheet.BINARY_CSS_VERSION;
*** 215,226 ****
}
return mask;
}
/** Converts this object to a string. */
! @Override
! public String toString() {
StringBuilder sb = new StringBuilder();
if (selectors.size()>0) {
sb.append(selectors.get(0));
}
for (int n=1; n<selectors.size(); n++) {
--- 216,226 ----
}
return mask;
}
/** Converts this object to a string. */
! @Override public String toString() {
StringBuilder sb = new StringBuilder();
if (selectors.size()>0) {
sb.append(selectors.get(0));
}
for (int n=1; n<selectors.size(); n++) {
*** 317,327 ****
private final ObservableList<Selector> selectorObservableList;
private final ObservableList<Declaration> declarationObservableList;
}
! final void writeBinary(DataOutputStream os, StringStore stringStore)
throws IOException {
final int nSelectors = this.selectors != null ? this.selectors.size() : 0;
os.writeShort(nSelectors);
for (int i = 0; i < nSelectors; i++) {
--- 317,327 ----
private final ObservableList<Selector> selectorObservableList;
private final ObservableList<Declaration> declarationObservableList;
}
! final void writeBinary(DataOutputStream os, StyleConverter.StringStore stringStore)
throws IOException {
final int nSelectors = this.selectors != null ? this.selectors.size() : 0;
os.writeShort(nSelectors);
for (int i = 0; i < nSelectors; i++) {