changeset 2295:0fd6e3514e4d

[DOCS-ONLY] add package.html and make edits to javadoc in javafx.css classes
author David Grieve<david.grieve@oracle.com>
date Thu, 17 Jan 2013 10:56:07 -0500
parents 9999d0a6fd84
children a0aaf6fb8302
files javafx-ui-common/src/javafx/css/CssMetaData.java javafx-ui-common/src/javafx/css/FontCssMetaData.java javafx-ui-common/src/javafx/css/PseudoClass.java javafx-ui-common/src/javafx/css/package.html
diffstat 4 files changed, 72 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-common/src/javafx/css/CssMetaData.java	Wed Jan 16 18:16:48 2013 -0800
+++ b/javafx-ui-common/src/javafx/css/CssMetaData.java	Thu Jan 17 10:56:07 2013 -0500
@@ -104,6 +104,7 @@
  * @param <N> The type of Node
  * @param <V> The type into which the parsed value is converted. 
  */
+@com.sun.javafx.beans.annotations.NoBuilder
 public abstract class CssMetaData<N extends Node, V> {
     
     /**
--- a/javafx-ui-common/src/javafx/css/FontCssMetaData.java	Wed Jan 16 18:16:48 2013 -0800
+++ b/javafx-ui-common/src/javafx/css/FontCssMetaData.java	Thu Jan 17 10:56:07 2013 -0500
@@ -42,6 +42,7 @@
  * includes the font sub-properties: weight, style, family and size.
  * @param <T> The type of Node
  */
+@com.sun.javafx.beans.annotations.NoBuilder
 public abstract class FontCssMetaData<T extends Node> extends CssMetaData<T, Font> {
 
     /**
--- a/javafx-ui-common/src/javafx/css/PseudoClass.java	Wed Jan 16 18:16:48 2013 -0800
+++ b/javafx-ui-common/src/javafx/css/PseudoClass.java	Thu Jan 17 10:56:07 2013 -0500
@@ -28,18 +28,22 @@
 import java.util.List;
 
 /**
- * PseudoClass represents one unique pseudo-class state. There can be at most 1020
- * unique pseudo-classes with the current implementation. Introducing a pseudo-class into
- * a JavaFX class requires implementing {@link javafx.scene.Node#getPseudoClassStates()}
- * and calling the {@link javafx.scene.Node#pseudoClassStateChanged(PseudoClass)}
- * method when the corresponding property changes value. Typically, the
+ * PseudoClass represents one unique pseudo-class state. Introducing a 
+ * pseudo-class into a JavaFX class only requires that the method
+ * {@link javafx.scene.Node#pseudoClassStateChanged(javafx.css.PseudoClass, boolean)}
+ * be called when the pseudo-class state changes. Typically, the
  * {@code pseudoClassStateChanged} method is called from the
- * {@code protected void invalidated()} method of a {@code javafx.beans.property}
- * class.
+ * {@code protected void invalidated()} method of one of the property base 
+ * classes in the {@code javafx.beans.property} package.
+ * <p>
+ * Note that if a node has a default pseudo-class state, a horizontal orientation
+ * for example, {@code pseudoClassStateChanged} should be called from the 
+ * constructor to set the initial state. 
+ * <p>
+ * The following example would allow &quot;xyzzy&quot; to be used as a
+ *  pseudo-class in a CSS selector.
+ * <code>
  * <pre>
- * <b>Example:</b>
- *
- * <code>
  *  public boolean isMagic() {
  *       return magic.get();
  *   }
@@ -52,7 +56,7 @@
  *       new BooleanPropertyBase(false) {
  *
  *       {@literal @}Override protected void invalidated() {
- *           pseudoClassStateChanged(MAGIC_PSEUDO_CLASS);
+ *           pseudoClassStateChanged(MAGIC_PSEUDO_CLASS. get());
  *       }
  *
  *       {@literal @}Override public Object getBean() {
@@ -66,23 +70,15 @@
  *
  *   private static final PseudoClass
  *       MAGIC_PSEUDO_CLASS = PseudoClass.getPseudoClassName("xyzzy");
- *
- *   {@literal @}Override public Set<PseudoClass> getPseudoClassStates() {
- *         Set<PseudoClass> states = super.getPseudoClassStates();
- *         if (isMagic()) states.add(MAGIC_PSEUDO_CLASS);
- *         return states;
- *    }
- * </code></pre>
+ * </pre>
+ * </code>
  */
 public abstract class PseudoClass {
 
     /**
      * There is only one PseudoClass instance for a given pseudoClass.
-     * There can be at most 1020 unique pseudo-classes.
      * @return The PseudoClass for the given pseudoClass. Will not return null.
      * @throws IllegalArgumentException if pseudoClass parameter is null or an empty String
-     * @throws IndexOutOfBoundsException if adding the pseudoClass would exceed the
-     *         maximum number of allowable pseudo-classes.
      */
     public static PseudoClass getPseudoClass(String pseudoClass) {
         
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-common/src/javafx/css/package.html	Thu Jan 17 10:56:07 2013 -0500
@@ -0,0 +1,53 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+  <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
+  <title>javafx.css</title>
+</head>
+<body>
+
+<p>Provides API for making properties styleable via CSS and for supporting
+pseudo-class state.</p>
+
+<p>The JavaFX Scene Graph provides the facility to style nodes using
+CSS (Cascading Style Sheets).
+The {@link javafx.scene.Node Node} class contains {@code id}, {@code styleClass}, and
+{@code style} variables which are used by CSS selectors to find nodes
+to which styles should be applied. The {@link javafx.scene.Scene Scene} class and
+{@link javafx.scene.Parent Parent} class contain a
+the {@code stylesheets} variable which is a list of URLs that
+reference CSS style sheets that are to be applied to the nodes within
+that scene or parent.
+<p>The primary classes in this package are:</p>
+
+<dl>
+
+<dt>{@link javafx.css.CssMetaData CssMetaData}</dt>
+<dd>Defines the CSS property and provides a link back to the 
+    {@link javafx.css.StyleableProperty StyleableProperty}.
+    By convention, classes that have CssMetaData implement a 
+    {@code public static List<CssMetaData> getClassCssMetaData()} method that 
+    allows other classes to include CssMetaData from an inherited class. The
+    method {@link javafx.scene.Node#getCssMetaData() getCssMetaData()} should 
+    be overridden to return {@code getClassCssMetaData()}. The CSS implementation
+    frequently calls {@code getCssMetaData()}. It is strongly recommended that
+    the returned list be a {@code final static}.</dd>
+
+<dt>{@link javafx.css.StyleableProperty StyleableProperty}</dt>
+<dd>Defines the interface that the CSS implementation uses to set values on a
+    property and provides a link back to the {@code CssMetaData} that 
+    corresponds to the property.</dd>
+
+<dt>{@link javafx.css.PseudoClass PseudoClass}</dt>
+<dd>Defines a pseudo-class which can be set or cleared via the method 
+    {@link javafx.scene.Node#pseudoClassStateChanged(javafx.css.PseudoClass, boolean)
+    pseudoClassStateChanged}. </dd>
+
+</dl>
+    
+<p>For further information about CSS, how to apply CSS styles
+to nodes, and what properties are available for styling, see the
+<a href="../scene/doc-files/cssref.html">CSS Reference Guide</a>.</p>
+
+</body>
+</html>