< prev index next >

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

Print this page




 182                 old = newItems;
 183             }
 184         }
 185 
 186         @Override
 187         public Object getBean() {
 188             return CategoryAxis.this;
 189         }
 190 
 191         @Override
 192         public String getName() {
 193             return "categories";
 194         }
 195     };
 196 
 197     /**
 198      * The ordered list of categories plotted on this axis. This is set automatically
 199      * based on the charts data if autoRanging is true. If the application sets the categories
 200      * then auto ranging is turned off. If there is an attempt to add duplicate entry into this list,
 201      * an {@link IllegalArgumentException} is thrown.

 202      */
 203     public final void setCategories(ObservableList<String> value) {
 204         categories.set(value);
 205         if (!changeIsLocal) {
 206             setAutoRanging(false);
 207             allDataCategories.clear();
 208             allDataCategories.addAll(getCategories());
 209         }
 210         requestAxisLayout();
 211     }
 212 
 213     private void checkAndRemoveDuplicates(String category) {
 214         if (getDuplicate() != null) {
 215             getCategories().remove(category);
 216             throw new IllegalArgumentException("Duplicate category ; "+category+" already present");
 217         }
 218     }
 219 
 220     private String getDuplicate() {
 221         if (getCategories() != null) {




 182                 old = newItems;
 183             }
 184         }
 185 
 186         @Override
 187         public Object getBean() {
 188             return CategoryAxis.this;
 189         }
 190 
 191         @Override
 192         public String getName() {
 193             return "categories";
 194         }
 195     };
 196 
 197     /**
 198      * The ordered list of categories plotted on this axis. This is set automatically
 199      * based on the charts data if autoRanging is true. If the application sets the categories
 200      * then auto ranging is turned off. If there is an attempt to add duplicate entry into this list,
 201      * an {@link IllegalArgumentException} is thrown.
 202      * @param value the ordered list of categories plotted on this axis
 203      */
 204     public final void setCategories(ObservableList<String> value) {
 205         categories.set(value);
 206         if (!changeIsLocal) {
 207             setAutoRanging(false);
 208             allDataCategories.clear();
 209             allDataCategories.addAll(getCategories());
 210         }
 211         requestAxisLayout();
 212     }
 213 
 214     private void checkAndRemoveDuplicates(String category) {
 215         if (getDuplicate() != null) {
 216             getCategories().remove(category);
 217             throw new IllegalArgumentException("Duplicate category ; "+category+" already present");
 218         }
 219     }
 220 
 221     private String getDuplicate() {
 222         if (getCategories() != null) {


< prev index next >