changeset 351:efe9f501fce6

RT-19307: Add style class "text" to Text nodes inside control skins.
author jgiles
date Wed, 01 Feb 2012 12:52:32 +1300
parents dac294f2923d
children b9274656245c
files javafx-ui-controls/src/com/sun/javafx/scene/control/skin/LabeledSkinBase.java javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ProgressIndicatorSkin.java javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TextAreaSkin.java javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TextFieldSkin.java javafx-ui-controls/src/javafx/scene/chart/Axis.java
diffstat 5 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/LabeledSkinBase.java	Tue Jan 31 16:45:04 2012 +1300
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/LabeledSkinBase.java	Wed Feb 01 12:52:32 2012 +1300
@@ -124,6 +124,7 @@
         // Configure the Text node with all of the attributes from the
         // Labeled which apply to it.
         text = new Text();
+        text.getStyleClass().add("text");
         //
         // RT-16589: by binding text.fontProperty() to labeled.fontProperty(), 
         // we achieve two things. First, the text's font stays in sync with
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ProgressIndicatorSkin.java	Tue Jan 31 16:45:04 2012 +1300
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ProgressIndicatorSkin.java	Wed Feb 01 12:52:32 2012 +1300
@@ -74,6 +74,9 @@
 
     /** doneText is just used to know the size of done as that is the biggest text we need to allow for */
     private static final Text doneText = new Text(DONE);
+    static {
+        doneText.getStyleClass().add("text");
+    }
 
 
     private static final ObservableList<String> paths;
@@ -245,7 +248,7 @@
             text = new Text((control.getProgress() >= 1) ? (DONE) : ("" + intProgress + "%"));
             text.setFill(textFill);
             text.setTextOrigin(VPos.TOP);
-            text.getStyleClass().setAll("percentage");
+            text.getStyleClass().setAll("text", "percentage");
 
             // The circular background for the progress pie piece
             indicator = new StackPane();
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TextAreaSkin.java	Tue Jan 31 16:45:04 2012 +1300
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TextAreaSkin.java	Wed Feb 01 12:52:32 2012 +1300
@@ -496,6 +496,7 @@
         Text paragraphNode = new Text(string);
         paragraphNode.setTextOrigin(VPos.TOP);
         paragraphNode.setManaged(false);
+        paragraphNode.getStyleClass().add("text");
         paragraphNodes.getChildren().add(i, paragraphNode);
 
         paragraphNode.fontProperty().bind(font);
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TextFieldSkin.java	Tue Jan 31 16:45:04 2012 +1300
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TextFieldSkin.java	Wed Feb 01 12:52:32 2012 +1300
@@ -243,6 +243,7 @@
 
         // Add text
         textNode.setManaged(false);
+        textNode.getStyleClass().add("text");
         textNode.fontProperty().bind(font);
         textNode.xProperty().bind(textLeft);
         textNode.layoutXProperty().bind(textTranslateX);
@@ -349,6 +350,7 @@
         promptNode = new Text();
         textGroup.getChildren().add(0, promptNode);
         promptNode.setManaged(false);
+        promptNode.getStyleClass().add("text");
         promptNode.visibleProperty().bind(usePromptText);
         promptNode.fontProperty().bind(font);
         promptNode.xProperty().bind(textLeft);
--- a/javafx-ui-controls/src/javafx/scene/chart/Axis.java	Tue Jan 31 16:45:04 2012 +1300
+++ b/javafx-ui-controls/src/javafx/scene/chart/Axis.java	Wed Feb 01 12:52:32 2012 +1300
@@ -378,7 +378,7 @@
         axisLabel.setAlignment(Pos.CENTER);
         tickMarkPath.getStyleClass().add("axis-tick-mark");
         getChildren().addAll(axisLabel, tickMarkPath);
-        measure.getStyleClass().add("tick-mark");
+        measure.getStyleClass().addAll("text", "tick-mark");
     }
 
     // -------------- METHODS ------------------------------------------------------------------------------------------
@@ -1008,7 +1008,7 @@
          * Creates and initializes an instance of TickMark. 
          */
         public TickMark() {
-            textNode.getStyleClass().add("tick-mark");
+            textNode.getStyleClass().addAll("text", "tick-mark");
         }
 
         /**