changeset 2245:13c19f3c9ef4

missed this putback for an earlier bug fix.
author Paru Somashekar <paru.somashekar@oracle.com>
date Tue, 15 Jan 2013 10:43:31 -0800
parents c47b77160532
children 9881c2e1bbc3 3d52d7e73c1b
files javafx-ui-controls/src/javafx/scene/chart/CategoryAxis.java
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-controls/src/javafx/scene/chart/CategoryAxis.java	Tue Jan 15 16:32:26 2013 +1300
+++ b/javafx-ui-controls/src/javafx/scene/chart/CategoryAxis.java	Tue Jan 15 10:43:31 2013 -0800
@@ -387,7 +387,7 @@
     @Override public void invalidateRange(List<String> data) {
         super.invalidateRange(data);
         // Create unique set of category names        
-        LinkedHashSet<String> categoryNames = new LinkedHashSet<String>();
+        List<String> categoryNames = new ArrayList<String>();
         categoryNames.addAll(allDataCategories);
         //RT-21141 allDataCategories needs to be updated based on data -
         // and should maintain the order it originally had for the categories already present.
@@ -396,8 +396,10 @@
             if (!data.contains(cat)) categoryNames.remove(cat); 
         }
         // add any new category found in data
-        for(String cat : data) {
-            if (!categoryNames.contains(cat)) categoryNames.add(cat);
+//        for(String cat : data) {
+        for (int i = 0; i < data.size(); i++) {    
+           int len = categoryNames.size();
+           if (!categoryNames.contains(data.get(i))) categoryNames.add((i > len) ? len : i, data.get(i));
         }
         allDataCategories.clear();
         allDataCategories.addAll(categoryNames);