< prev index next >

modules/javafx.controls/src/main/java/javafx/scene/chart/XYChart.java

Print this page
rev 10598 : 8185767: Fix broken links in Javadocs


 253 
 254         @Override
 255         public Object getBean() {
 256             return XYChart.this;
 257         }
 258 
 259         @Override
 260         public String getName() {
 261             return "verticalGridLinesVisible";
 262         }
 263 
 264         @Override
 265         public CssMetaData<XYChart<?,?>,Boolean> getCssMetaData() {
 266             return StyleableProperties.VERTICAL_GRID_LINE_VISIBLE;
 267         }
 268     };
 269     /**
 270      * Indicates whether vertical grid lines are visible or not.
 271      *
 272      * @return true if verticalGridLines are visible else false.
 273      * @see #verticalGridLinesVisible
 274      */
 275     public final boolean getVerticalGridLinesVisible() { return verticalGridLinesVisible.get(); }
 276     public final void setVerticalGridLinesVisible(boolean value) { verticalGridLinesVisible.set(value); }
 277     public final BooleanProperty verticalGridLinesVisibleProperty() { return verticalGridLinesVisible; }
 278 
 279     /** True if horizontal grid lines should be drawn */
 280     private BooleanProperty horizontalGridLinesVisible = new StyleableBooleanProperty(true) {
 281         @Override protected void invalidated() {
 282             requestChartLayout();
 283         }
 284 
 285         @Override
 286         public Object getBean() {
 287             return XYChart.this;
 288         }
 289 
 290         @Override
 291         public String getName() {
 292             return "horizontalGridLinesVisible";
 293         }


 964                 getPlotChildren().removeAll(nodes);
 965                 removeSeriesFromDisplay(series);
 966             }, endValues)
 967         };
 968     }
 969 
 970     /**
 971      * The current displayed data value plotted on the X axis. This may be the same as xValue or different. It is
 972      * used by XYChart to animate the xValue from the old value to the new value. This is what you should plot
 973      * in any custom XYChart implementations. Some XYChart chart implementations such as LineChart also use this
 974      * to animate when data is added or removed.
 975      * @param item The XYChart.Data item from which the current X axis data value is obtained
 976      * @return The current displayed X data value
 977      */
 978     protected final X getCurrentDisplayedXValue(Data<X,Y> item) { return item.getCurrentX(); }
 979 
 980     /** Set the current displayed data value plotted on X axis.
 981      *
 982      * @param item The XYChart.Data item from which the current X axis data value is obtained.
 983      * @param value The X axis data value
 984      * @see #getCurrentDisplayedXValue
 985      */
 986     protected final void setCurrentDisplayedXValue(Data<X,Y> item, X value) { item.setCurrentX(value); }
 987 
 988     /** The current displayed data value property that is plotted on X axis.
 989      *
 990      * @param item The XYChart.Data item from which the current X axis data value property object is obtained.
 991      * @return The current displayed X data value ObjectProperty.
 992      * @see #getCurrentDisplayedXValue
 993      */
 994     protected final ObjectProperty<X> currentDisplayedXValueProperty(Data<X,Y> item) { return item.currentXProperty(); }
 995 
 996     /**
 997      * The current displayed data value plotted on the Y axis. This may be the same as yValue or different. It is
 998      * used by XYChart to animate the yValue from the old value to the new value. This is what you should plot
 999      * in any custom XYChart implementations. Some XYChart chart implementations such as LineChart also use this
1000      * to animate when data is added or removed.
1001      * @param item The XYChart.Data item from which the current Y axis data value is obtained
1002      * @return The current displayed Y data value
1003      */
1004     protected final Y getCurrentDisplayedYValue(Data<X,Y> item) { return item.getCurrentY(); }
1005 
1006     /**
1007      * Set the current displayed data value plotted on Y axis.
1008      *
1009      * @param item The XYChart.Data item from which the current Y axis data value is obtained.
1010      * @param value The Y axis data value
1011      * @see #getCurrentDisplayedYValue
1012      */
1013     protected final void setCurrentDisplayedYValue(Data<X,Y> item, Y value) { item.setCurrentY(value); }
1014 
1015     /** The current displayed data value property that is plotted on Y axis.
1016      *
1017      * @param item The XYChart.Data item from which the current Y axis data value property object is obtained.
1018      * @return The current displayed Y data value ObjectProperty.
1019      * @see #getCurrentDisplayedYValue
1020      */
1021     protected final ObjectProperty<Y> currentDisplayedYValueProperty(Data<X,Y> item) { return item.currentYProperty(); }
1022 
1023     /**
1024      * The current displayed data extra value. This may be the same as extraValue or different. It is
1025      * used by XYChart to animate the extraValue from the old value to the new value. This is what you should plot
1026      * in any custom XYChart implementations.
1027      * @param item The XYChart.Data item from which the current extra value is obtained
1028      * @return The current extra value
1029      */
1030     protected final Object getCurrentDisplayedExtraValue(Data<X,Y> item) { return item.getCurrentExtraValue(); }
1031 
1032     /**
1033      * Set the current displayed data extra value.
1034      *
1035      * @param item The XYChart.Data item from which the current extra value is obtained.
1036      * @param value The extra value
1037      * @see #getCurrentDisplayedExtraValue
1038      */
1039     protected final void setCurrentDisplayedExtraValue(Data<X,Y> item, Object value) { item.setCurrentExtraValue(value); }
1040 
1041     /**
1042      * The current displayed extra value property.
1043      *
1044      * @param item The XYChart.Data item from which the current extra value property object is obtained.
1045      * @return {@literal ObjectProperty<Object> The current extra value ObjectProperty}
1046      * @see #getCurrentDisplayedExtraValue
1047      */
1048     protected final ObjectProperty<Object> currentDisplayedExtraValueProperty(Data<X,Y> item) { return item.currentExtraValueProperty(); }
1049 
1050     /**
1051      * XYChart maintains a list of all items currently displayed this includes all current data + any data items
1052      * recently deleted that are in the process of being faded out. This creates and returns a iterator over
1053      * that list. This is what implementations of XYChart should use when plotting data.
1054      *
1055      * @param series The series to get displayed data for
1056      * @return iterator over currently displayed items from this series
1057      */
1058     protected final Iterator<Data<X,Y>> getDisplayedDataIterator(final Series<X,Y> series) {
1059         return Collections.unmodifiableList(series.displayedData).iterator();
1060     }
1061 
1062     /**
1063      * This should be called from dataItemRemoved() when you are finished with any animation for deleting the item from the
1064      * chart. It will remove the data item from showing up in the Iterator returned by getDisplayedDataIterator().
1065      *
1066      * @param series The series to remove




 253 
 254         @Override
 255         public Object getBean() {
 256             return XYChart.this;
 257         }
 258 
 259         @Override
 260         public String getName() {
 261             return "verticalGridLinesVisible";
 262         }
 263 
 264         @Override
 265         public CssMetaData<XYChart<?,?>,Boolean> getCssMetaData() {
 266             return StyleableProperties.VERTICAL_GRID_LINE_VISIBLE;
 267         }
 268     };
 269     /**
 270      * Indicates whether vertical grid lines are visible or not.
 271      *
 272      * @return true if verticalGridLines are visible else false.
 273      * @see #verticalGridLinesVisibleProperty()
 274      */
 275     public final boolean getVerticalGridLinesVisible() { return verticalGridLinesVisible.get(); }
 276     public final void setVerticalGridLinesVisible(boolean value) { verticalGridLinesVisible.set(value); }
 277     public final BooleanProperty verticalGridLinesVisibleProperty() { return verticalGridLinesVisible; }
 278 
 279     /** True if horizontal grid lines should be drawn */
 280     private BooleanProperty horizontalGridLinesVisible = new StyleableBooleanProperty(true) {
 281         @Override protected void invalidated() {
 282             requestChartLayout();
 283         }
 284 
 285         @Override
 286         public Object getBean() {
 287             return XYChart.this;
 288         }
 289 
 290         @Override
 291         public String getName() {
 292             return "horizontalGridLinesVisible";
 293         }


 964                 getPlotChildren().removeAll(nodes);
 965                 removeSeriesFromDisplay(series);
 966             }, endValues)
 967         };
 968     }
 969 
 970     /**
 971      * The current displayed data value plotted on the X axis. This may be the same as xValue or different. It is
 972      * used by XYChart to animate the xValue from the old value to the new value. This is what you should plot
 973      * in any custom XYChart implementations. Some XYChart chart implementations such as LineChart also use this
 974      * to animate when data is added or removed.
 975      * @param item The XYChart.Data item from which the current X axis data value is obtained
 976      * @return The current displayed X data value
 977      */
 978     protected final X getCurrentDisplayedXValue(Data<X,Y> item) { return item.getCurrentX(); }
 979 
 980     /** Set the current displayed data value plotted on X axis.
 981      *
 982      * @param item The XYChart.Data item from which the current X axis data value is obtained.
 983      * @param value The X axis data value
 984      * @see #getCurrentDisplayedXValue(Data)
 985      */
 986     protected final void setCurrentDisplayedXValue(Data<X,Y> item, X value) { item.setCurrentX(value); }
 987 
 988     /** The current displayed data value property that is plotted on X axis.
 989      *
 990      * @param item The XYChart.Data item from which the current X axis data value property object is obtained.
 991      * @return The current displayed X data value ObjectProperty.
 992      * @see #getCurrentDisplayedXValue(Data)
 993      */
 994     protected final ObjectProperty<X> currentDisplayedXValueProperty(Data<X,Y> item) { return item.currentXProperty(); }
 995 
 996     /**
 997      * The current displayed data value plotted on the Y axis. This may be the same as yValue or different. It is
 998      * used by XYChart to animate the yValue from the old value to the new value. This is what you should plot
 999      * in any custom XYChart implementations. Some XYChart chart implementations such as LineChart also use this
1000      * to animate when data is added or removed.
1001      * @param item The XYChart.Data item from which the current Y axis data value is obtained
1002      * @return The current displayed Y data value
1003      */
1004     protected final Y getCurrentDisplayedYValue(Data<X,Y> item) { return item.getCurrentY(); }
1005 
1006     /**
1007      * Set the current displayed data value plotted on Y axis.
1008      *
1009      * @param item The XYChart.Data item from which the current Y axis data value is obtained.
1010      * @param value The Y axis data value
1011      * @see #getCurrentDisplayedYValue(Data)
1012      */
1013     protected final void setCurrentDisplayedYValue(Data<X,Y> item, Y value) { item.setCurrentY(value); }
1014 
1015     /** The current displayed data value property that is plotted on Y axis.
1016      *
1017      * @param item The XYChart.Data item from which the current Y axis data value property object is obtained.
1018      * @return The current displayed Y data value ObjectProperty.
1019      * @see #getCurrentDisplayedYValue(Data)
1020      */
1021     protected final ObjectProperty<Y> currentDisplayedYValueProperty(Data<X,Y> item) { return item.currentYProperty(); }
1022 
1023     /**
1024      * The current displayed data extra value. This may be the same as extraValue or different. It is
1025      * used by XYChart to animate the extraValue from the old value to the new value. This is what you should plot
1026      * in any custom XYChart implementations.
1027      * @param item The XYChart.Data item from which the current extra value is obtained
1028      * @return The current extra value
1029      */
1030     protected final Object getCurrentDisplayedExtraValue(Data<X,Y> item) { return item.getCurrentExtraValue(); }
1031 
1032     /**
1033      * Set the current displayed data extra value.
1034      *
1035      * @param item The XYChart.Data item from which the current extra value is obtained.
1036      * @param value The extra value
1037      * @see #getCurrentDisplayedExtraValue(Data)
1038      */
1039     protected final void setCurrentDisplayedExtraValue(Data<X,Y> item, Object value) { item.setCurrentExtraValue(value); }
1040 
1041     /**
1042      * The current displayed extra value property.
1043      *
1044      * @param item The XYChart.Data item from which the current extra value property object is obtained.
1045      * @return {@literal ObjectProperty<Object> The current extra value ObjectProperty}
1046      * @see #getCurrentDisplayedExtraValue(Data)
1047      */
1048     protected final ObjectProperty<Object> currentDisplayedExtraValueProperty(Data<X,Y> item) { return item.currentExtraValueProperty(); }
1049 
1050     /**
1051      * XYChart maintains a list of all items currently displayed this includes all current data + any data items
1052      * recently deleted that are in the process of being faded out. This creates and returns a iterator over
1053      * that list. This is what implementations of XYChart should use when plotting data.
1054      *
1055      * @param series The series to get displayed data for
1056      * @return iterator over currently displayed items from this series
1057      */
1058     protected final Iterator<Data<X,Y>> getDisplayedDataIterator(final Series<X,Y> series) {
1059         return Collections.unmodifiableList(series.displayedData).iterator();
1060     }
1061 
1062     /**
1063      * This should be called from dataItemRemoved() when you are finished with any animation for deleting the item from the
1064      * chart. It will remove the data item from showing up in the Iterator returned by getDisplayedDataIterator().
1065      *
1066      * @param series The series to remove


< prev index next >