changeset 1287:8192bc3aa019

RT-20937 missing javadoc for some MenuItem properties RT-19747 piechart is not affected by -fx-pie-label-visible RT-13081 ChartSampler demo / set new data leads to NPE.
author Paru Somashekar <paru.somashekar@oracle.com>
date Tue, 12 Jun 2012 10:39:55 -0700
parents a636b9ba88ac
children 6e34b405d07e
files javafx-ui-charts/src/javafx/scene/chart/PieChart.java javafx-ui-charts/src/javafx/scene/chart/ScatterChart.java javafx-ui-controls/src/javafx/scene/control/MenuItem.java
diffstat 3 files changed, 47 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-charts/src/javafx/scene/chart/PieChart.java	Tue Jun 12 16:55:59 2012 +1200
+++ b/javafx-ui-charts/src/javafx/scene/chart/PieChart.java	Tue Jun 12 10:39:55 2012 -0700
@@ -810,7 +810,7 @@
         };
          
          private static final StyleableProperty<PieChart,Boolean> LABELS_VISIBLE = 
-             new StyleableProperty<PieChart,Boolean>("-fx-labels-visible",
+             new StyleableProperty<PieChart,Boolean>("-fx-pie-label-visible",
                  BooleanConverter.getInstance(), Boolean.TRUE) {
 
             @Override
--- a/javafx-ui-charts/src/javafx/scene/chart/ScatterChart.java	Tue Jun 12 16:55:59 2012 +1200
+++ b/javafx-ui-charts/src/javafx/scene/chart/ScatterChart.java	Tue Jun 12 10:39:55 2012 -0700
@@ -185,7 +185,9 @@
             for (int seriesIndex=0; seriesIndex< getData().size(); seriesIndex++) {
                 Series<X,Y> series = getData().get(seriesIndex);
                 LegendItem legenditem = new LegendItem(series.getName());
-                legenditem.getSymbol().getStyleClass().addAll(series.getData().get(0).getNode().getStyleClass());
+                if (series.getData().get(0).getNode() != null) {
+                    legenditem.getSymbol().getStyleClass().addAll(series.getData().get(0).getNode().getStyleClass());
+                }
                 legend.getItems().add(legenditem);
             }
         }
--- a/javafx-ui-controls/src/javafx/scene/control/MenuItem.java	Tue Jun 12 16:55:59 2012 +1200
+++ b/javafx-ui-controls/src/javafx/scene/control/MenuItem.java	Tue Jun 12 10:39:55 2012 -0700
@@ -101,6 +101,9 @@
      *                                                                         *
      **************************************************************************/
 
+    /**
+     * Constructs a MenuItem with no display text.
+     */
     public MenuItem() {
         this(null,null);
     }
@@ -147,6 +150,10 @@
      *                                                                         *
      **************************************************************************/
     
+    /**
+     * The id of this MenuItem. This simple string identifier is useful for finding
+     * a specific MenuItem within the scene graph. 
+     */
     private StringProperty id;
     public final void setId(String value) { idProperty().set(value); }
     public final String getId() { return id == null ? null : id.get(); }
@@ -157,6 +164,12 @@
         return id;
     }
     
+    /**
+     * A string representation of the CSS style associated with this specific MenuItem. 
+     * This is analogous to the "style" attribute of an HTML element. Note that, 
+     * like the HTML style attribute, this variable contains style properties and 
+     * values and not the selector portion of a style rule.
+     */
     private StringProperty style;
     public final void setStyle(String value) { styleProperty().set(value); }
     public final String getStyle() { return style == null ? null : style.get(); }
@@ -168,8 +181,6 @@
     }
     
     // --- Parent Menu (useful for submenus)
-    private ReadOnlyObjectWrapper<Menu> parentMenu;
-
     /**
      * This is the {@link Menu} in which this {@code MenuItem} exists. It is
      * possible for an instance of this class to not have a {@code parentMenu} -
@@ -181,6 +192,8 @@
      * {@link Menu} internally.
      * </ul>
      */
+    private ReadOnlyObjectWrapper<Menu> parentMenu;
+
     protected final void setParentMenu(Menu value) {
         parentMenuPropertyImpl().set(value);
     }
@@ -202,11 +215,11 @@
 
 
     // --- Parent Popup
+     /**
+     * This is the {@link ContextMenu} in which this {@code MenuItem} exists.
+     */
     private ReadOnlyObjectWrapper<ContextMenu> parentPopup;
 
-    /**
-     * This is the {@link ContextMenu} in which this {@code MenuItem} exists.
-     */
     protected final void setParentPopup(ContextMenu value) {
         parentPopupPropertyImpl().set(value);
     }
@@ -228,11 +241,11 @@
 
 
     // --- Text
-    private StringProperty text;
-
     /**
      * The text to display in the {@code MenuItem}.
      */
+    private StringProperty text;
+
     public final void setText(String value) {
         textProperty().set(value);
     }
@@ -250,13 +263,13 @@
 
 
     // --- Graphic
-    private ObjectProperty<Node> graphic;
-
     /**
      * An optional graphic for the {@code MenuItem}. This will normally be
      * an {@link javafx.scene.image.ImageView} node, but there is no requirement for this to be
      * the case.
      */
+    private ObjectProperty<Node> graphic;
+    
     public final void setGraphic(Node value) {
         graphicProperty().set(value);
     }
@@ -274,14 +287,14 @@
     
 
     // --- OnAction
-    private ObjectProperty<EventHandler<ActionEvent>> onAction;
-
     /**
      * The action, which is invoked whenever the MenuItem is fired. This
      * may be due to the user clicking on the button with the mouse, or by
      * a touch event, or by a key press, or if the developer programatically
      * invokes the {@link #fire()} method.
      */
+    private ObjectProperty<EventHandler<ActionEvent>> onAction;
+
     public final void setOnAction(EventHandler<ActionEvent> value) {
         onActionProperty().set( value);
     }
@@ -315,12 +328,14 @@
      * <p>Called when a accelerator for the Menuitem is invoked</p>
      */
     public final EventType<Event> MENU_VALIDATION_EVENT = new EventType<Event>();
-    private ObjectProperty<EventHandler<Event>> onMenuValidation;
+    
     /**
      * The event handler that is associated with invocation of an accelerator for a MenuItem. This 
      * can happen when a key sequence for an accelerator is pressed. The event handler is also  
      * invoked when onShowing event handler is called. 
      */
+    private ObjectProperty<EventHandler<Event>> onMenuValidation;
+    
     public final void setOnMenuValidation(EventHandler<Event> value) {
         onMenuValidationProperty().set( value);
     }
@@ -347,6 +362,10 @@
     }
     
     // --- Disable
+    /** 
+     * Sets the individual disabled state of this MenuItem.
+     * Setting disable to true will cause this MenuItem to become disabled.
+     */
     private BooleanProperty disable;
     public final void setDisable(boolean value) { disableProperty().set(value); }
     public final boolean isDisable() { return disable == null ? false : disable.get(); }
@@ -359,6 +378,9 @@
 
 
     // --- Visible
+    /**
+     * Specifies whether this MenuItem should be rendered as part of the scene graph. 
+     */
     private BooleanProperty visible;
     public final void setVisible(boolean value) { visibleProperty().set(value); }
     public final boolean isVisible() { return visible == null ? true : visible.get(); }
@@ -369,7 +391,10 @@
         return visible;
     }
 
- 
+    /**
+     * The accelerator property enables accessing the associated action in one keystroke.
+     * It is a convenience offered to perform quickly a given action. 
+     */
     private ObjectProperty<KeyCombination> accelerator;
     public final void setAccelerator(KeyCombination value) {
         acceleratorProperty().set(value);
@@ -516,12 +541,14 @@
 
     private static final String DEFAULT_STYLE_CLASS = "menu-item";
 
-    protected Styleable styleable; 
     /**
      * RT-19263
      * @treatAsPrivate implementation detail
-     * @deprecated This is an experimental API that is not intended for general use and is subject to change in future versions
-     */    
+     * @deprecated This is an experimental API that is not intended for general 
+     * use and is subject to change in future versions
+     */
+    protected Styleable styleable; 
+        
     @Deprecated // SB-dependency: RT-21094 has been filed to track this
     public Styleable impl_getStyleable() {