changeset 291:b3a9c6786253

fix RT-18270: creating a NumberAxis causes NPE.
author psomashe
date Fri, 20 Jan 2012 10:17:53 -0800
parents c1cc0e7893d3
children e54287f1dcdc
files javafx-ui-controls/src/javafx/scene/chart/Axis.java
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-controls/src/javafx/scene/chart/Axis.java	Fri Jan 20 17:16:49 2012 +1300
+++ b/javafx-ui-controls/src/javafx/scene/chart/Axis.java	Fri Jan 20 10:17:53 2012 -0800
@@ -1176,6 +1176,13 @@
      */
     @Deprecated @Override public long impl_getPseudoClassState() {
         long mask = super.impl_getPseudoClassState();
+        if (getSide() == null) {
+            // RT-18270 XYChart has not initialized Side values and it could be null
+            // note: We do not have initial default property on creation, as the default
+            // depends on whether it is x, or y axis. hence if we get here - we are 
+            // probably installed directly inside a scene. 
+            setSide(Side.BOTTOM);
+        } 
         switch(getSide()) {
             case TOP:
                 mask |= TOP_PSEUDOCLASS_STATE;