From 3006b1fcd0eae804e2219bb9d5523f2521e519b1 Mon Sep 17 00:00:00 2001 From: Peter Zhelezniakov Date: Mon, 22 Jun 2009 18:08:50 +0400 Subject: [PATCH 01/14] 6849277: Nimbus L&F: lots of painter classes were added to JDK7 as public Reviewed-by: malenkov --- jdk/src/share/classes/javax/swing/plaf/nimbus/Defaults.template | 2 +- .../share/classes/javax/swing/plaf/nimbus/PainterImpl.template | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/Defaults.template b/jdk/src/share/classes/javax/swing/plaf/nimbus/Defaults.template index a0f5afc22c8..492b53583ed 100644 --- a/jdk/src/share/classes/javax/swing/plaf/nimbus/Defaults.template +++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/Defaults.template @@ -278,7 +278,7 @@ ${UI_DEFAULT_INIT} * offset (if any), and whether it is to be bold, italic, or left in its * default form.

*/ - public static final class DerivedFont implements UIDefaults.ActiveValue { + static final class DerivedFont implements UIDefaults.ActiveValue { private float sizeOffset; private Boolean bold; private Boolean italic; diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/PainterImpl.template b/jdk/src/share/classes/javax/swing/plaf/nimbus/PainterImpl.template index 2afa0005b08..cad178ef7e6 100644 --- a/jdk/src/share/classes/javax/swing/plaf/nimbus/PainterImpl.template +++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/PainterImpl.template @@ -31,7 +31,7 @@ import javax.swing.*; import javax.swing.Painter; -public final class ${PAINTER_NAME} extends AbstractRegionPainter { +final class ${PAINTER_NAME} extends AbstractRegionPainter { //package private integers representing the available states that //this painter will paint. These are used when creating a new instance //of ${PAINTER_NAME} to determine which region/state is being painted From beedf39dcee36c5852e1647cd5b717531b0f380f Mon Sep 17 00:00:00 2001 From: Peter Zhelezniakov Date: Tue, 23 Jun 2009 12:24:11 +0400 Subject: [PATCH 02/14] 6844273: jdk/make/docs/CORE_PKGS.gmk does not list Nimbus Reviewed-by: prr --- jdk/make/docs/CORE_PKGS.gmk | 1 + jdk/src/share/classes/javax/swing/plaf/nimbus/package.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/jdk/make/docs/CORE_PKGS.gmk b/jdk/make/docs/CORE_PKGS.gmk index 43a380ef836..3694985b1ed 100644 --- a/jdk/make/docs/CORE_PKGS.gmk +++ b/jdk/make/docs/CORE_PKGS.gmk @@ -217,6 +217,7 @@ CORE_PKGS = \ javax.swing.plaf.basic \ javax.swing.plaf.metal \ javax.swing.plaf.multi \ + javax.swing.plaf.nimbus \ javax.swing.plaf.synth \ javax.tools \ javax.transaction \ diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/package.html b/jdk/src/share/classes/javax/swing/plaf/nimbus/package.html index bd3a0f4f4f1..4453cc163fe 100644 --- a/jdk/src/share/classes/javax/swing/plaf/nimbus/package.html +++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/package.html @@ -38,7 +38,7 @@ background {@code Painter}, and there may be several painters for different component states.

Nimbus allows customizing many of its properties, including painters, by -altering the {@link UIDefaults} table. Here's an example: +altering the {@link javax.swing.UIDefaults} table. Here's an example:

     UIManager.put("ProgressBar.tileWidth", myTileWidth);
     UIManager.put("ProgressBar[Enabled].backgroundPainter", myBgPainter);

From c48e8ec7a631bf56f3292868a40f558229ebfab1 Mon Sep 17 00:00:00 2001
From: Sergey Malenkov 
Date: Wed, 24 Jun 2009 13:59:54 +0400
Subject: [PATCH 03/14] 6852574: EnumPersistenceDelegate fails to persist
 instances with blocks

Reviewed-by: peterz
---
 .../share/classes/java/beans/MetaData.java    |  2 +-
 .../java/beans/XMLEncoder/Test6852574.java    | 58 +++++++++++++++++++
 2 files changed, 59 insertions(+), 1 deletion(-)
 create mode 100644 jdk/test/java/beans/XMLEncoder/Test6852574.java

diff --git a/jdk/src/share/classes/java/beans/MetaData.java b/jdk/src/share/classes/java/beans/MetaData.java
index defd196457e..f4d307090a5 100644
--- a/jdk/src/share/classes/java/beans/MetaData.java
+++ b/jdk/src/share/classes/java/beans/MetaData.java
@@ -93,7 +93,7 @@ class EnumPersistenceDelegate extends PersistenceDelegate {
 
     protected Expression instantiate(Object oldInstance, Encoder out) {
         Enum e = (Enum) oldInstance;
-        return new Expression(e, Enum.class, "valueOf", new Object[]{e.getClass(), e.name()});
+        return new Expression(e, Enum.class, "valueOf", new Object[]{e.getDeclaringClass(), e.name()});
     }
 }
 
diff --git a/jdk/test/java/beans/XMLEncoder/Test6852574.java b/jdk/test/java/beans/XMLEncoder/Test6852574.java
new file mode 100644
index 00000000000..4b474ecb76c
--- /dev/null
+++ b/jdk/test/java/beans/XMLEncoder/Test6852574.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * @test
+ * @bug 6852574
+ * @summary Tests Enum subclass encoding
+ * @author Sergey Malenkov
+ */
+
+public final class Test6852574 extends AbstractTest {
+    public static void main(String[] args) {
+        new Test6852574().test(true);
+    }
+
+    protected Object getObject() {
+        return Data.FIRST;
+    }
+
+    protected Object getAnotherObject() {
+        return Data.SECOND;
+    }
+
+    public enum Data {
+        FIRST {
+            @Override
+            public String toString() {
+                return "1";
+            }
+        },
+        SECOND {
+            @Override
+            public String toString() {
+                return "2";
+            }
+        }
+    }
+}

From eaf8bfc5f378dd0838646562ce4fb07407424201 Mon Sep 17 00:00:00 2001
From: Sergey Malenkov 
Date: Wed, 24 Jun 2009 17:45:19 +0400
Subject: [PATCH 04/14] 6737700:
 api/javax_swing/table/DefaultTableCellRenderer/index.html#getset:DefaultTableCellRenderer

Reviewed-by: alexp
---
 .../classes/javax/swing/table/DefaultTableCellRenderer.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/jdk/src/share/classes/javax/swing/table/DefaultTableCellRenderer.java b/jdk/src/share/classes/javax/swing/table/DefaultTableCellRenderer.java
index c203178ce3a..07e7265c9bf 100644
--- a/jdk/src/share/classes/javax/swing/table/DefaultTableCellRenderer.java
+++ b/jdk/src/share/classes/javax/swing/table/DefaultTableCellRenderer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 1998-2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1998-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -118,12 +118,12 @@ public class DefaultTableCellRenderer extends JLabel
         if (System.getSecurityManager() != null) {
             if (border != null) return border;
             return SAFE_NO_FOCUS_BORDER;
-        } else {
+        } else if (border != null) {
             if (noFocusBorder == null || noFocusBorder == DEFAULT_NO_FOCUS_BORDER) {
                 return border;
             }
-            return noFocusBorder;
         }
+        return noFocusBorder;
     }
 
     /**

From f73952ec124850a93745f2996945ecb980a220a9 Mon Sep 17 00:00:00 2001
From: Yuka Kamiya 
Date: Thu, 25 Jun 2009 07:38:09 +0900
Subject: [PATCH 05/14] 6853792: test/java/text/Bidi/Bug6850113.java
 compilation error

Reviewed-by: okutsu
---
 jdk/test/java/text/Bidi/Bug6850113.java | 1 +
 1 file changed, 1 insertion(+)

diff --git a/jdk/test/java/text/Bidi/Bug6850113.java b/jdk/test/java/text/Bidi/Bug6850113.java
index 2023df89a58..d77f3c7798d 100644
--- a/jdk/test/java/text/Bidi/Bug6850113.java
+++ b/jdk/test/java/text/Bidi/Bug6850113.java
@@ -24,6 +24,7 @@
  * @test
  * @bug 6850113
  * @summary Verify the return value of digit() for some digits.
+ * @compile -XDignore.symbol.file=true Bug6850113.java
  */
 
 import sun.text.normalizer.UCharacter;

From 3876899a84546f504c2d635b456a8da9793b99ce Mon Sep 17 00:00:00 2001
From: Yuka Kamiya 
Date: Thu, 25 Jun 2009 17:37:28 +0900
Subject: [PATCH 06/14] 6609750: [Fmt-De] SimpleDateFormat.format() doesn't
 handle pattern "y" correctly

Reviewed-by: okutsu
---
 .../classes/java/text/SimpleDateFormat.java   |  4 +-
 .../text/Format/DateFormat/Bug6609750.java    | 81 +++++++++++++++++++
 2 files changed, 83 insertions(+), 2 deletions(-)
 create mode 100644 jdk/test/java/text/Format/DateFormat/Bug6609750.java

diff --git a/jdk/src/share/classes/java/text/SimpleDateFormat.java b/jdk/src/share/classes/java/text/SimpleDateFormat.java
index d7e99a943fe..1dfa42ea5f2 100644
--- a/jdk/src/share/classes/java/text/SimpleDateFormat.java
+++ b/jdk/src/share/classes/java/text/SimpleDateFormat.java
@@ -1030,9 +1030,9 @@ public class SimpleDateFormat extends DateFormat {
 
         case 1: // 'y' - YEAR
             if (calendar instanceof GregorianCalendar) {
-                if (count >= 4)
+                if (count != 2)
                     zeroPaddingNumber(value, count, maxIntCount, buffer);
-                else // count < 4
+                else // count == 2
                     zeroPaddingNumber(value, 2, 2, buffer); // clip 1996 to 96
             } else {
                 if (current == null) {
diff --git a/jdk/test/java/text/Format/DateFormat/Bug6609750.java b/jdk/test/java/text/Format/DateFormat/Bug6609750.java
new file mode 100644
index 00000000000..d1be2e843b1
--- /dev/null
+++ b/jdk/test/java/text/Format/DateFormat/Bug6609750.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * @test
+ * @bug 6609750
+ * @summary Make sure that SimpleDateFormat.format() formats years correctly.
+ */
+import java.text.*;
+import java.util.*;
+
+public class Bug6609750 {
+
+    public static void main(String[] args) {
+        boolean error = false;
+
+        Locale defaultLocale = Locale.getDefault();
+        Locale.setDefault(Locale.US);
+
+        Date[] dates = {
+            new Date(9-1900,     Calendar.JUNE, 12),
+            new Date(99-1900,    Calendar.JUNE, 12),
+            new Date(999-1900,   Calendar.JUNE, 12),
+            new Date(2009-1900,  Calendar.JUNE, 12),
+            new Date(30009-1900, Calendar.JUNE, 12),
+        };
+
+        String[] patterns = {
+           "y", "yy", "yyy", "yyyy", "yyyyy", "yyyyyy"
+        };
+        String[][] expectedResults = {
+           {"9",     "09", "009",   "0009",  "00009", "000009"},
+           {"99",    "99", "099",   "0099",  "00099", "000099"},
+           {"999",   "99", "999",   "0999",  "00999", "000999"},
+           {"2009",  "09", "2009",  "2009",  "02009", "002009"},
+           {"30009", "09", "30009", "30009", "30009", "030009"},
+        };
+
+        SimpleDateFormat sdf = new SimpleDateFormat();
+        for (int dateNo = 0; dateNo < dates.length; dateNo++) {
+            Date date = dates[dateNo];
+            for (int patternNo = 0; patternNo < patterns.length; patternNo++) {
+                sdf.applyPattern(patterns[patternNo]);
+                String got = sdf.format(date);
+                if (!expectedResults[dateNo][patternNo].equals(got)) {
+                    error = true;
+                    System.err.println("Failed: Unexpected format result: " +
+                        "Expected: \"" + expectedResults[dateNo][patternNo] +
+                        "\", Got: \"" + got + "\" for date " + date +
+                        " with pattern \"" + patterns[patternNo] + "\"");
+                }
+            }
+        }
+
+        Locale.setDefault(defaultLocale);
+        if (error) {
+            throw new RuntimeException("SimpleDateFormat.format() error.");
+        };
+    }
+
+}

From bbd33e6ddc179efbe5db3ffe4f18e88a7934ff07 Mon Sep 17 00:00:00 2001
From: Yuka Kamiya 
Date: Thu, 25 Jun 2009 21:55:39 +0900
Subject: [PATCH 07/14] 6792400: Avoid loading of Normalizer resources for
 simple uses

Reviewed-by: okutsu
---
 .../sun/text/normalizer/NormalizerBase.java   | 27 ++++++++++++++++---
 1 file changed, 23 insertions(+), 4 deletions(-)

diff --git a/jdk/src/share/classes/sun/text/normalizer/NormalizerBase.java b/jdk/src/share/classes/sun/text/normalizer/NormalizerBase.java
index a82475c6009..b4df3e2a659 100644
--- a/jdk/src/share/classes/sun/text/normalizer/NormalizerBase.java
+++ b/jdk/src/share/classes/sun/text/normalizer/NormalizerBase.java
@@ -1598,15 +1598,34 @@ public final class NormalizerBase implements Cloneable {
      * @param options   the optional features to be enabled.
      */
     public static String normalize(String str, Normalizer.Form form, int options) {
+        int len = str.length();
+        boolean asciiOnly = true;
+        if (len < 80) {
+            for (int i = 0; i < len; i++) {
+                if (str.charAt(i) > 127) {
+                    asciiOnly = false;
+                    break;
+                }
+            }
+        } else {
+            char[] a = str.toCharArray();
+            for (int i = 0; i < len; i++) {
+                if (a[i] > 127) {
+                    asciiOnly = false;
+                    break;
+                }
+            }
+        }
+
         switch (form) {
         case NFC :
-            return NFC.normalize(str, options);
+            return asciiOnly ? str : NFC.normalize(str, options);
         case NFD :
-            return NFD.normalize(str, options);
+            return asciiOnly ? str : NFD.normalize(str, options);
         case NFKC :
-            return NFKC.normalize(str, options);
+            return asciiOnly ? str : NFKC.normalize(str, options);
         case NFKD :
-            return NFKD.normalize(str, options);
+            return asciiOnly ? str : NFKD.normalize(str, options);
         }
 
         throw new IllegalArgumentException("Unexpected normalization form: " +

From 3fcee8351e88455ba6bd796b59898239d1613a2d Mon Sep 17 00:00:00 2001
From: Sergey Malenkov 
Date: Thu, 25 Jun 2009 18:50:51 +0400
Subject: [PATCH 08/14] 6848364: javax/swing/border/Test4856008.java regression
 test fails due to BorderedComponent package not found

Reviewed-by: alexp
---
 jdk/test/javax/swing/border/Test4856008.java | 22 +++++++-------------
 1 file changed, 7 insertions(+), 15 deletions(-)

diff --git a/jdk/test/javax/swing/border/Test4856008.java b/jdk/test/javax/swing/border/Test4856008.java
index 1b045eb46ed..e2c1733c89d 100644
--- a/jdk/test/javax/swing/border/Test4856008.java
+++ b/jdk/test/javax/swing/border/Test4856008.java
@@ -35,6 +35,7 @@ import java.awt.Color;
 import java.awt.Font;
 import java.awt.Insets;
 
+import javax.swing.ActionMap;
 import javax.swing.JComponent;
 import javax.swing.JFileChooser;
 import javax.swing.JLabel;
@@ -51,6 +52,7 @@ import javax.swing.border.LineBorder;
 import javax.swing.border.MatteBorder;
 import javax.swing.border.SoftBevelBorder;
 import javax.swing.border.TitledBorder;
+import javax.swing.plaf.ActionMapUIResource;
 import javax.swing.plaf.BorderUIResource;
 import javax.swing.plaf.synth.SynthLookAndFeel;
 import javax.swing.plaf.basic.BasicBorders;
@@ -59,7 +61,6 @@ import javax.swing.plaf.metal.MetalBorders;
 import javax.swing.plaf.metal.MetalComboBoxEditor;
 
 import sun.swing.plaf.synth.SynthFileChooserUI;
-import sun.tools.jconsole.BorderedComponent;
 
 public class Test4856008 {
     private static final JLabel LABEL = new JLabel();
@@ -133,11 +134,6 @@ public class Test4856008 {
 
             //+ SynthFileChooserUI.UIBorder:
             new SynthFileChooser().getUIBorder(),
-
-            //+ BorderedComponent.FocusBorder:
-            getBorder(false),
-            //+ BorderedComponent.LabeledBorder:
-            getBorder(true),
     };
 
     public static void main(String[] args) {
@@ -182,15 +178,6 @@ public class Test4856008 {
         return LABEL;
     }
 
-    // This method is used to get the border from BorderedComponent
-    private static Border getBorder(boolean labeled) {
-        JComponent component = new BorderedComponent("4856008", null, true);
-        CompoundBorder border = (CompoundBorder) component.getBorder();
-        return labeled
-                ? border.getInsideBorder()
-                : border.getOutsideBorder();
-    }
-
     // This class is used to get the instance of BasicBorders.RolloverMarginBorder
     private static class ToolBar extends BasicToolBarUI {
         private Border getRolloverMarginBorder() {
@@ -223,6 +210,11 @@ public class Test4856008 {
             return CHOOSER.getBorder();
         }
 
+        @Override
+        protected ActionMap createActionMap() {
+            return new ActionMapUIResource();
+        }
+
         @Override
         public String getFileName() {
             return this.name;

From 433856b24dde70b09c526d1f4923189df1c2c747 Mon Sep 17 00:00:00 2001
From: Peter Zhelezniakov 
Date: Fri, 26 Jun 2009 08:09:19 +0400
Subject: [PATCH 09/14] 6827032: NIMBUS: Drag and drop throws a NPE in
 SwingSet2 ColorChooser

Reviewed-by: malenkov
---
 .../classes/javax/swing/plaf/synth/SynthColorChooserUI.java      | 1 +
 1 file changed, 1 insertion(+)

diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthColorChooserUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthColorChooserUI.java
index 1a4e20fe57d..8a8dbf63220 100644
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthColorChooserUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthColorChooserUI.java
@@ -69,6 +69,7 @@ class SynthColorChooserUI extends BasicColorChooserUI implements
     }
 
     protected void installDefaults() {
+        super.installDefaults();
         updateStyle(chooser);
     }
 

From 0ed9b1c52f71ccf02568bc6f9a8cd23be9347733 Mon Sep 17 00:00:00 2001
From: Sergey Malenkov 
Date: Fri, 26 Jun 2009 16:30:02 +0400
Subject: [PATCH 10/14] 6557223: Resize cursor stays after fast outline-resize
 of JInternalFrame with JScrollPane

Reviewed-by: peterz
---
 .../classes/javax/swing/plaf/basic/BasicInternalFrameUI.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicInternalFrameUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicInternalFrameUI.java
index 46eefa26c14..383930533a2 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicInternalFrameUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicInternalFrameUI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -683,6 +683,7 @@ public class BasicInternalFrameUI extends InternalFrameUI
                 }
                 getDesktopManager().endResizingFrame(frame);
                 resizing = false;
+                updateFrameCursor();
             }
             _x = 0;
             _y = 0;

From d41845e0abd3f8b916e391c392538d6268cde6bd Mon Sep 17 00:00:00 2001
From: Sergey Malenkov 
Date: Fri, 26 Jun 2009 16:58:46 +0400
Subject: [PATCH 11/14] 6679840: provide a way to choose v-synced
 BufferStrategy

Reviewed-by: peterz
---
 .../com/sun/java/swing/SwingUtilities3.java   | 43 ++++++++++++-
 .../swing/BufferStrategyPaintManager.java     | 60 +++++++------------
 2 files changed, 65 insertions(+), 38 deletions(-)

diff --git a/jdk/src/share/classes/com/sun/java/swing/SwingUtilities3.java b/jdk/src/share/classes/com/sun/java/swing/SwingUtilities3.java
index 324d2172a43..50ce0b760b9 100644
--- a/jdk/src/share/classes/com/sun/java/swing/SwingUtilities3.java
+++ b/jdk/src/share/classes/com/sun/java/swing/SwingUtilities3.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2002-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,13 +27,17 @@ package com.sun.java.swing;
 
 import sun.awt.EventQueueDelegate;
 import sun.awt.AppContext;
+import java.util.Collections;
 import java.util.Map;
+import java.util.WeakHashMap;
 import java.util.concurrent.Callable;
 import java.awt.AWTEvent;
 import java.awt.EventQueue;
 import java.awt.Component;
+import java.awt.Container;
 import javax.swing.JComponent;
 import javax.swing.RepaintManager;
+import javax.swing.SwingUtilities;
 
 /**
  * A collection of utility methods for Swing.
@@ -69,6 +73,43 @@ public class SwingUtilities3 {
                                     repaintManager);
     }
 
+    private static final Map vsyncedMap =
+        Collections.synchronizedMap(new WeakHashMap());
+
+    /**
+     * Sets vsyncRequested state for the {@code rootContainer}.  If
+     * {@code isRequested} is {@code true} then vsynced
+     * {@code BufferStrategy} is enabled for this {@code rootContainer}.
+     *
+     * Note: requesting vsynced painting does not guarantee one. The outcome
+     * depends on current RepaintManager's RepaintManager.PaintManager
+     * and on the capabilities of the graphics hardware/software and what not.
+     *
+     * @param rootContainer topmost container. Should be either {@code Window}
+     *  or {@code Applet}
+     * @param isRequested the value to set vsyncRequested state to
+     */
+    public static void setVsyncRequested(Container rootContainer,
+                                         boolean isRequested) {
+        assert SwingUtilities.getRoot(rootContainer) == rootContainer;
+        if (isRequested) {
+            vsyncedMap.put(rootContainer, Boolean.TRUE);
+        } else {
+            vsyncedMap.remove(rootContainer);
+        }
+    }
+
+    /**
+     * Checks if vsync painting is requested for {@code rootContainer}
+     *
+     * @param rootContainer topmost container. Should be either Window or Applet
+     * @return {@code true} if vsync painting is requested for {@code rootContainer}
+     */
+    public static boolean isVsyncRequested(Container rootContainer) {
+        assert SwingUtilities.getRoot(rootContainer) == rootContainer;
+        return Boolean.TRUE == vsyncedMap.get(rootContainer);
+    }
+
     /**
      * Returns delegate {@code RepaintManager} for {@code component} hierarchy.
      */
diff --git a/jdk/src/share/classes/javax/swing/BufferStrategyPaintManager.java b/jdk/src/share/classes/javax/swing/BufferStrategyPaintManager.java
index 3c084afd17f..6fb1732090a 100644
--- a/jdk/src/share/classes/javax/swing/BufferStrategyPaintManager.java
+++ b/jdk/src/share/classes/javax/swing/BufferStrategyPaintManager.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,9 +33,13 @@ import java.lang.ref.WeakReference;
 import java.security.AccessController;
 import java.util.*;
 import java.util.logging.*;
+
+import com.sun.java.swing.SwingUtilities3;
+
 import sun.awt.SubRegionShowable;
 import sun.java2d.SunGraphics2D;
 import sun.security.action.GetPropertyAction;
+import sun.java2d.pipe.hw.ExtendedBufferCapabilities;
 
 /**
  * A PaintManager implementation that uses a BufferStrategy for
@@ -73,12 +77,6 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
     private static Method COMPONENT_CREATE_BUFFER_STRATEGY_METHOD;
     private static Method COMPONENT_GET_BUFFER_STRATEGY_METHOD;
 
-    /**
-     * Indicates whether or not we should try and get a flip buffer strategy
-     * first, default is false.
-     */
-    private static boolean TRY_FLIP;
-
     private static final Logger LOGGER = Logger.getLogger(
                            "javax.swing.BufferStrategyPaintManager");
 
@@ -151,12 +149,6 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
      */
     private boolean disposeBufferOnEnd;
 
-
-    static {
-        TRY_FLIP = "true".equals(AccessController.doPrivileged(
-              new GetPropertyAction("swing.useFlipBufferStrategy", "false")));
-    }
-
     private static Method getGetBufferStrategyMethod() {
         if (COMPONENT_GET_BUFFER_STRATEGY_METHOD == null) {
             getMethods();
@@ -257,7 +249,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
         try {
             BufferInfo info = getBufferInfo(c);
             BufferStrategy bufferStrategy;
-            if (info != null && !info.usingFlip && info.isInSync() &&
+            if (info != null && info.isInSync() &&
                 (bufferStrategy = info.getBufferStrategy(false)) != null) {
                 SubRegionShowable bsSubRegion =
                         (SubRegionShowable)bufferStrategy;
@@ -685,8 +677,6 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
         // same reason.
         private WeakReference weakBS;
         private WeakReference root;
-        // Whether or not we're using flip bs or blit.
-        private boolean usingFlip;
         // Indicates whether or not the backbuffer and display are in sync.
         // This is set to true when a full repaint on the rootpane is done.
         private boolean inSync;
@@ -763,13 +753,6 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
             return bs;
         }
 
-        /**
-         * Returns true if using a flip buffer strategy.
-         */
-        public boolean usingFlip() {
-            return usingFlip;
-        }
-
         /**
          * Returns true if the buffer strategy of the component differs
          * from current buffer strategy.
@@ -814,23 +797,19 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
          * blit.
          */
         private BufferStrategy createBufferStrategy() {
-            BufferCapabilities caps;
             Container root = getRoot();
             if (root == null) {
                 return null;
             }
             BufferStrategy bs = null;
-            if (TRY_FLIP) {
-                bs = createBufferStrategy(root,BufferCapabilities.FlipContents.
-                                          COPIED);
-                usingFlip = true;
+            if (SwingUtilities3.isVsyncRequested(root)) {
+                bs = createBufferStrategy(root, true);
                 if (LOGGER.isLoggable(Level.FINER)) {
-                    LOGGER.finer("createBufferStrategy: using flip strategy");
+                    LOGGER.finer("createBufferStrategy: using vsynced strategy");
                 }
             }
             if (bs == null) {
-                bs = createBufferStrategy(root, null);
-                usingFlip = false;
+                bs = createBufferStrategy(root, false);
             }
             if (!(bs instanceof SubRegionShowable)) {
                 // We do this for two reasons:
@@ -843,15 +822,22 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
             return bs;
         }
 
-        // Creates and returns a buffer strategy of the requested type.  If
+        // Creates and returns a buffer strategy.  If
         // there is a problem creating the buffer strategy this will
         // eat the exception and return null.
         private BufferStrategy createBufferStrategy(Container root,
-                                     BufferCapabilities.FlipContents type) {
-            BufferCapabilities caps = new BufferCapabilities(
-                    new ImageCapabilities(true),
-                    new ImageCapabilities(true),
-                    type);
+                boolean isVsynced) {
+            BufferCapabilities caps;
+            if (isVsynced) {
+                caps = new ExtendedBufferCapabilities(
+                    new ImageCapabilities(true), new ImageCapabilities(true),
+                    BufferCapabilities.FlipContents.COPIED,
+                    ExtendedBufferCapabilities.VSyncType.VSYNC_ON);
+            } else {
+                caps = new BufferCapabilities(
+                    new ImageCapabilities(true), new ImageCapabilities(true),
+                    null);
+            }
             BufferStrategy bs = null;
             if (root instanceof Applet) {
                 try {

From 99370fd8712951eb84aae618ae0a74bba75a0da0 Mon Sep 17 00:00:00 2001
From: Sergey Malenkov 
Date: Fri, 26 Jun 2009 17:15:19 +0400
Subject: [PATCH 12/14] 6742850: Antialiasing for GTK L&F should be turned on
 by default if there is no embedded bitmap

Reviewed-by: peterz
---
 .../classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java
index 23e4ee2eee5..aeefca782c2 100644
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2002-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -139,7 +139,7 @@ public class GTKLookAndFeel extends SynthLookAndFeel {
                                     });
                     isSunDesktop = val.booleanValue();
             }
-            if (isSunDesktop) {
+            if (isSunDesktop && !sun.java2d.SunGraphicsEnvironment.isOpenSolaris) {
                 isSunCJK = true;
             }
         }

From f17d1e509eddad446bdf8e1f70cd55feede5279e Mon Sep 17 00:00:00 2001
From: Peter Zhelezniakov 
Date: Fri, 26 Jun 2009 21:43:21 +0400
Subject: [PATCH 13/14] 6849805: Nimbus L&F:
 NimbusLookAndFeel.getDerivedColor() not always returns color2 for 1.0
 midPoint

Different rounding mode used for float->int conversion

Reviewed-by: malenkov
---
 .../plaf/nimbus/AbstractRegionPainter.java    |  3 +-
 .../swing/plaf/nimbus/NimbusLookAndFeel.java  | 10 +--
 .../javax/swing/plaf/nimbus/Test6849805.java  | 73 +++++++++++++++++++
 3 files changed, 78 insertions(+), 8 deletions(-)
 create mode 100644 jdk/test/javax/swing/plaf/nimbus/Test6849805.java

diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java b/jdk/src/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java
index 55fb19599c7..bf29e15221d 100644
--- a/jdk/src/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java
@@ -31,7 +31,6 @@ import javax.swing.*;
 import javax.swing.plaf.UIResource;
 import javax.swing.Painter;
 import java.awt.print.PrinterGraphics;
-import static javax.swing.plaf.nimbus.NimbusLookAndFeel.deriveARGB;
 
 /**
  * Convenient base class for defining Painter instances for rendering a
@@ -347,7 +346,7 @@ public abstract class AbstractRegionPainter implements Painter {
      */
     protected final Color decodeColor(Color color1, Color color2,
                                       float midPoint) {
-        return new Color(deriveARGB(color1, color2, midPoint));
+        return new Color(NimbusLookAndFeel.deriveARGB(color1, color2, midPoint));
     }
 
     /**
diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/NimbusLookAndFeel.java b/jdk/src/share/classes/javax/swing/plaf/nimbus/NimbusLookAndFeel.java
index eae031b6ba3..8c5d121b7e1 100644
--- a/jdk/src/share/classes/javax/swing/plaf/nimbus/NimbusLookAndFeel.java
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/NimbusLookAndFeel.java
@@ -436,15 +436,13 @@ public class NimbusLookAndFeel extends SynthLookAndFeel {
      */
     static int deriveARGB(Color color1, Color color2, float midPoint) {
         int r = color1.getRed() +
-                (int) ((color2.getRed() - color1.getRed()) * midPoint + 0.5f);
+                Math.round((color2.getRed() - color1.getRed()) * midPoint);
         int g = color1.getGreen() +
-                (int) ((color2.getGreen() - color1.getGreen()) * midPoint +
-                        0.5f);
+                Math.round((color2.getGreen() - color1.getGreen()) * midPoint);
         int b = color1.getBlue() +
-                (int) ((color2.getBlue() - color1.getBlue()) * midPoint + 0.5f);
+                Math.round((color2.getBlue() - color1.getBlue()) * midPoint);
         int a = color1.getAlpha() +
-                (int) ((color2.getAlpha() - color1.getAlpha()) * midPoint +
-                        0.5f);
+                Math.round((color2.getAlpha() - color1.getAlpha()) * midPoint);
         return ((a & 0xFF) << 24) |
                 ((r & 0xFF) << 16) |
                 ((g & 0xFF) << 8) |
diff --git a/jdk/test/javax/swing/plaf/nimbus/Test6849805.java b/jdk/test/javax/swing/plaf/nimbus/Test6849805.java
new file mode 100644
index 00000000000..10f6fb85aef
--- /dev/null
+++ b/jdk/test/javax/swing/plaf/nimbus/Test6849805.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/* @test
+   @bug 6849805
+   @summary Tests NimbusLookAndFeel.deriveColor()
+   @author Peter Zhelezniakov
+   @run main Test6849805
+*/
+
+import java.awt.Color;
+
+
+public class Test6849805 {
+
+    static boolean pass = true;
+
+    static class Minimbus extends javax.swing.plaf.nimbus.NimbusLookAndFeel {
+
+        public void test(Color c1, Color c2, float f) {
+            Color r = getDerivedColor(c1, c2, f);
+            Color test = (f > 0 ? c2 : c1);
+            System.out.printf("Got %s, need %s ", r, test);
+
+            if (r.getRGB() == test.getRGB() &&
+                r.getAlpha() == test.getAlpha()) {
+
+                System.out.println("Ok");
+            } else {
+                System.out.println("FAIL");
+                pass = false;
+            }
+        }
+    }
+
+    public static void main(String[] args) {
+        Minimbus laf = new Minimbus();
+        laf.test(Color.WHITE, Color.BLACK, 0f);
+        laf.test(Color.WHITE, Color.BLACK, 1f);
+        laf.test(Color.BLACK, Color.WHITE, 0f);
+        laf.test(Color.BLACK, Color.WHITE, 1f);
+        laf.test(Color.RED, Color.GREEN, 0f);
+        laf.test(Color.RED, Color.GREEN, 1f);
+        laf.test(new Color(127, 127, 127), new Color(51, 151, 212), 0f);
+        laf.test(new Color(127, 127, 127), new Color(51, 151, 212), 1f);
+        laf.test(new Color(221, 63, 189), new Color(112, 200, 89), 0f);
+        laf.test(new Color(221, 63, 189), new Color(112, 200, 89), 1f);
+
+        if (! pass) {
+            throw new RuntimeException("Some testcases failed, see above");
+        }
+    }
+}

From f2d770bf7340e17ece32e8042da47ebf4e533432 Mon Sep 17 00:00:00 2001
From: Yuka Kamiya 
Date: Tue, 30 Jun 2009 09:38:16 +0900
Subject: [PATCH 14/14] 6855715: Font2Dtest demo needs to be updated to support
 Unicode 5.1.0

Reviewed-by: okutsu
---
 .../share/demo/jfc/Font2DTest/RangeMenu.java  | 108 +++++++++++++++++-
 1 file changed, 102 insertions(+), 6 deletions(-)

diff --git a/jdk/src/share/demo/jfc/Font2DTest/RangeMenu.java b/jdk/src/share/demo/jfc/Font2DTest/RangeMenu.java
index 3dabe1e88f8..52c5783f7c1 100644
--- a/jdk/src/share/demo/jfc/Font2DTest/RangeMenu.java
+++ b/jdk/src/share/demo/jfc/Font2DTest/RangeMenu.java
@@ -53,7 +53,7 @@ import javax.swing.*;
 public final class RangeMenu extends JComboBox implements ActionListener {
 
     /// Painfully extracted from java.lang.Character.UnicodeBlock.  Arrrgh!
-    /// Unicode 3.0 data.
+    /// Unicode 5.1.0 data.
 
     private final int[][] UNICODE_RANGES = {
         { 0x000000, 0x00007f }, /// BASIC_LATIN
@@ -63,14 +63,16 @@ public final class RangeMenu extends JComboBox implements ActionListener {
         { 0x000250, 0x0002af }, /// IPA_EXTENSIONS
         { 0x0002b0, 0x0002ff }, /// SPACING_MODIFIER_LETTERS
         { 0x000300, 0x00036f }, /// COMBINING_DIACRITICAL_MARKS
-        { 0x000370, 0x0003ff }, /// GREEK
+        { 0x000370, 0x0003ff }, /// GREEK_AND_COPTIC
         { 0x000400, 0x0004ff }, /// CYRILLIC
         { 0x000500, 0x00052f }, /// CYRILLIC_SUPPLEMENTARY
         { 0x000530, 0x00058f }, /// ARMENIAN
         { 0x000590, 0x0005ff }, /// HEBREW
         { 0x000600, 0x0006ff }, /// ARABIC
         { 0x000700, 0x00074f }, /// SYRIAC
+        { 0x000750, 0x00077f }, /// ARABIC_SUPPLEMENT
         { 0x000780, 0x0007bf }, /// THAANA
+        { 0x0007c0, 0x0007ff }, /// NKO
         { 0x000900, 0x00097f }, /// DEVANAGARI
         { 0x000980, 0x0009ff }, /// BENGALI
         { 0x000a00, 0x000a7f }, /// GURMUKHI
@@ -88,6 +90,7 @@ public final class RangeMenu extends JComboBox implements ActionListener {
         { 0x0010a0, 0x0010ff }, /// GEORGIAN
         { 0x001100, 0x0011ff }, /// HANGUL_JAMO
         { 0x001200, 0x00137f }, /// ETHIOPIC
+        { 0x001380, 0x00139f }, /// ETHIOPIC_SUPPLEMENT
         { 0x0013a0, 0x0013ff }, /// CHEROKEE
         { 0x001400, 0x00167f }, /// UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS
         { 0x001680, 0x00169f }, /// OGHAM
@@ -100,8 +103,16 @@ public final class RangeMenu extends JComboBox implements ActionListener {
         { 0x001800, 0x0018af }, /// MONGOLIAN
         { 0x001900, 0x00194f }, /// LIMBU
         { 0x001950, 0x00197f }, /// TAI_LE
+        { 0x001980, 0x0019df }, /// NEW_TAI_LE
         { 0x0019e0, 0x0019ff }, /// KHMER_SYMBOLS
+        { 0x001a00, 0x001a1f }, /// BUGINESE
+        { 0x001b00, 0x001b7f }, /// BALINESE
+        { 0x001b80, 0x001bbf }, /// SUNDANESE
+        { 0x001c00, 0x001c4f }, /// LEPCHA
+        { 0x001c50, 0x001c7f }, /// OL_CHIKI
         { 0x001d00, 0x001d7f }, /// PHONETIC_EXTENSIONS
+        { 0x001d80, 0x001dbf }, /// PHONEITC EXTENSIONS SUPPLEMENT
+        { 0x001dc0, 0x001dff }, /// COMBINING_DIACRITICAL_MAKRS_SUPPLEMENT
         { 0x001e00, 0x001eff }, /// LATIN_EXTENDED_ADDITIONAL
         { 0x001f00, 0x001fff }, /// GREEK_EXTENDED
         { 0x002000, 0x00206f }, /// GENERAL_PUNCTUATION
@@ -128,6 +139,14 @@ public final class RangeMenu extends JComboBox implements ActionListener {
         { 0x002980, 0x0029ff }, /// MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B
         { 0x002a00, 0x002aff }, /// SUPPLEMENTAL_MATHEMATICAL_OPERATORS
         { 0x002b00, 0x002bff }, /// MISCELLANEOUS_SYMBOLS_AND_ARROWS
+        { 0x002c00, 0x002c5f }, /// GLAGOLITIC
+        { 0x002c60, 0x002c7f }, /// LATIN_EXTENDED-C
+        { 0x002c80, 0x002cff }, /// COPTIC
+        { 0x002d00, 0x002d2f }, /// GEORGIAN_SUPPLEMENT
+        { 0x002d30, 0x002d7f }, /// TIFINAGH
+        { 0x002d80, 0x002ddf }, /// ETHIOPIC_EXTENDED
+        { 0x002de0, 0x002dff }, /// CYRILLIC_EXTENDED-A
+        { 0x002e00, 0x002e7f }, /// SUPPLEMENTAL_PUNCTUATION
         { 0x002e80, 0x002eff }, /// CJK_RADICALS_SUPPLEMENT
         { 0x002f00, 0x002fdf }, /// KANGXI_RADICALS
         { 0x002ff0, 0x002fff }, /// IDEOGRAPHIC_DESCRIPTION_CHARACTERS
@@ -138,6 +157,7 @@ public final class RangeMenu extends JComboBox implements ActionListener {
         { 0x003130, 0x00318f }, /// HANGUL_COMPATIBILITY_JAMO
         { 0x003190, 0x00319f }, /// KANBUN
         { 0x0031a0, 0x0031bf }, /// BOPOMOFO_EXTENDED
+        { 0x0031c0, 0x0031ef }, /// CJK_STROKES
         { 0x0031f0, 0x0031ff }, /// KATAKANA_PHONETIC_EXTENSIONS
         { 0x003200, 0x0032ff }, /// ENCLOSED_CJK_LETTERS_AND_MONTHS
         { 0x003300, 0x0033ff }, /// CJK_COMPATIBILITY
@@ -146,13 +166,26 @@ public final class RangeMenu extends JComboBox implements ActionListener {
         { 0x004e00, 0x009fff }, /// CJK_UNIFIED_IDEOGRAPHS
         { 0x00a000, 0x00a48f }, /// YI_SYLLABLES
         { 0x00a490, 0x00a4cf }, /// YI_RADICALS
+        { 0x00a500, 0x00a63f }, /// YAI
+        { 0x00a640, 0x00a69f }, /// CYRILLIC_EXTENDED-B
+        { 0x00a700, 0x00a71f }, /// MODIFIER_TONE_LETTERS
+        { 0x00a720, 0x00a7ff }, /// LATIN_EXTENDED-D
+        { 0x00a800, 0x00a82f }, /// SYLOTI_NAGRI
+        { 0x00a840, 0x00a87f }, /// PHAGS-PA
+        { 0x00a880, 0x00a8df }, /// SAURASHTRA
+        { 0x00a900, 0x00a92f }, /// KAYAH_LI
+        { 0x00a930, 0x00a95f }, /// REJANG
+        { 0x00aa00, 0x00aa5f }, /// CHAM
         { 0x00ac00, 0x00d7af }, /// HANGUL_SYLLABLES
-        { 0x00d800, 0x00dfff }, /// SURROGATES_AREA
+        { 0x00d800, 0x00db7f }, /// HIGH_SURROGATES_AREA
+        { 0x00db80, 0x00dbff }, /// HIGH_PRIVATE_USE_SURROGATES_AREA
+        { 0x00dc00, 0x00dfff }, /// LOW_SURROGATES_AREA
         { 0x00e000, 0x00f8ff }, /// PRIVATE_USE_AREA
         { 0x00f900, 0x00faff }, /// CJK_COMPATIBILITY_IDEOGRAPHS
         { 0x00fb00, 0x00fb4f }, /// ALPHABETIC_PRESENTATION_FORMS
         { 0x00fb50, 0x00fdff }, /// ARABIC_PRESENTATION_FORMS_A
         { 0x00fe00, 0x00fe0f }, /// VARIATION_SELECTORS
+        { 0x00fe10, 0x00fe1f }, /// VERTICAL_FORMS
         { 0x00fe20, 0x00fe2f }, /// COMBINING_HALF_MARKS
         { 0x00fe30, 0x00fe4f }, /// CJK_COMPATIBILITY_FORMS
         { 0x00fe50, 0x00fe6f }, /// SMALL_FORM_VARIANTS
@@ -162,17 +195,32 @@ public final class RangeMenu extends JComboBox implements ActionListener {
         { 0x010000, 0x01007f }, /// LINEAR_B_SYLLABARY
         { 0x010080, 0x0100ff }, /// LINEAR_B_IDEOGRAMS
         { 0x010100, 0x01013f }, /// AEGEAN_NUMBERS
+        { 0x010140, 0x01018f }, /// ANCIENT_GREEK_NUMBERS
+        { 0x010190, 0x0101cf }, /// ANCIENT_SYMBOLS
+        { 0x0101d0, 0x0101ff }, /// PHAISTOS_DISC
+        { 0x010280, 0x01029f }, /// LYCIAN
+        { 0x0102a0, 0x0102df }, /// CARIAN
         { 0x010300, 0x01032f }, /// OLD_ITALIC
         { 0x010330, 0x01034f }, /// GOTHIC
         { 0x010380, 0x01039f }, /// UGARITIC
+        { 0x0103a0, 0x0103df }, /// OLD_PERSIAN
         { 0x010400, 0x01044f }, /// DESERET
         { 0x010450, 0x01047f }, /// SHAVIAN
         { 0x010480, 0x0104af }, /// OSMANYA
         { 0x010800, 0x01083f }, /// CYPRIOT_SYLLABARY
+        { 0x010900, 0x01091f }, /// PHOENICIAN
+        { 0x010920, 0x01093f }, /// LYDIAN
+        { 0x010a00, 0x010a5f }, /// KHAROSHTHI
+        { 0x012000, 0x0123ff }, /// CUNEIFORM
+        { 0x012400, 0x01247f }, /// CUNEIFORM_NUMBERS_AND_PUNCTUATION
         { 0x01d000, 0x01d0ff }, /// BYZANTINE_MUSICAL_SYMBOLS
         { 0x01d100, 0x01d1ff }, /// MUSICAL_SYMBOLS
+        { 0x01d200, 0x01d24f }, /// ANCIENT_GREEK_MUSICAL_NOTATION
         { 0x01d300, 0x01d35f }, /// TAI_XUAN_JING_SYMBOLS
+        { 0x01d360, 0x01d37f }, /// COUNTING_ROD_NUMERALS
         { 0x01d400, 0x01d7ff }, /// MATHEMATICAL_ALPHANUMERIC_SYMBOLS
+        { 0x01f000, 0x01f02f }, /// MAHJONG_TILES
+        { 0x01f030, 0x01f09f }, /// DOMINO_TILES
         { 0x020000, 0x02a6df }, /// CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B
         { 0x02f800, 0x02fa1f }, /// CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT
         { 0x0e0000, 0x0e007f }, /// TAGS
@@ -190,14 +238,16 @@ public final class RangeMenu extends JComboBox implements ActionListener {
         "IPA Extensions",
         "Spacing Modifier Letters",
         "Combining Diacritical Marks",
-        "Greek",
+        "Greek and Coptic",
         "Cyrillic",
         "Cyrillic Supplement",
         "Armenian",
         "Hebrew",
         "Arabic",
         "Syriac",
+        "Arabic Supplement",
         "Thaana",
+        "NKo",
         "Devanagari",
         "Bengali",
         "Gurmukhi",
@@ -215,6 +265,7 @@ public final class RangeMenu extends JComboBox implements ActionListener {
         "Georgian",
         "Hangul Jamo",
         "Ethiopic",
+        "Ethiopic Supplement",
         "Cherokee",
         "Unified Canadian Aboriginal Syllabics",
         "Ogham",
@@ -227,14 +278,22 @@ public final class RangeMenu extends JComboBox implements ActionListener {
         "Mongolian",
         "Limbu",
         "Tai Le",
+        "New Tai Lue",
         "Khmer Symbols",
+        "Buginese",
+        "Balinese",
+        "Sundanese",
+        "Lepcha",
+        "Ol Chiki",
         "Phonetic Extensions",
+        "Phonetic Extensions Supplement",
+        "Combining Diacritical Marks Supplement",
         "Latin Extended Additional",
         "Greek Extended",
         "General Punctuation",
         "Superscripts and Subscripts",
         "Currency Symbols",
-        "Combining Marks for Symbols",
+        "Combining Diacritical Marks for Symbols",
         "Letterlike Symbols",
         "Number Forms",
         "Arrows",
@@ -255,6 +314,14 @@ public final class RangeMenu extends JComboBox implements ActionListener {
         "Miscellaneous Mathematical Symbols-B",
         "Supplemental Mathematical Operators",
         "Miscellaneous Symbols and Arrows",
+        "Glagolitic",
+        "Latin Extended-C",
+        "Coptic",
+        "Georgian Supplement",
+        "Tifinagh",
+        "Ethiopic Extended",
+        "Cyrillic Extended-A",
+        "Supplemental Punctuation",
         "CJK Radicals Supplement",
         "Kangxi Radicals",
         "Ideographic Description Characters",
@@ -265,6 +332,7 @@ public final class RangeMenu extends JComboBox implements ActionListener {
         "Hangul Compatibility Jamo",
         "Kanbun",
         "Bopomofo Extended",
+        "CJK Strokes",
         "Katakana Phonetic Extensions",
         "Enclosed CJK Letters and Months",
         "CJK Compatibility",
@@ -273,13 +341,26 @@ public final class RangeMenu extends JComboBox implements ActionListener {
         "CJK Unified Ideographs",
         "Yi Syllables",
         "Yi Radicals",
+        "Vai",
+        "Cyrillic Extended-B",
+        "Modifier Tone Letters",
+        "Latin Extended-D",
+        "Syloti Nagri",
+        "Phags-pa",
+        "Saurashtra",
+        "Kayah Li",
+        "Rejang",
+        "Cham",
         "Hangul Syllables",
-        "Surrogates Area", // High Surrogates, High Private Use Surrogates, Low Surrogates
+        "High Surrogates",
+        "High Private Use Surrogates",
+        "Low Surrogates",
         "Private Use Area",
         "CJK Compatibility Ideographs",
         "Alphabetic Presentation Forms",
         "Arabic Presentation Forms-A",
         "Variation Selectors",
+        "Vertical Forms",
         "Combining Half Marks",
         "CJK Compatibility Forms",
         "Small Form Variants",
@@ -289,17 +370,32 @@ public final class RangeMenu extends JComboBox implements ActionListener {
         "Linear B Syllabary",
         "Linear B Ideograms",
         "Aegean Numbers",
+        "Ancient Greek Numbers",
+        "Ancient Symbols",
+        "Phaistos Disc",
+        "Lycian",
+        "Carian",
         "Old Italic",
         "Gothic",
         "Ugaritic",
+        "Old Persian",
         "Deseret",
         "Shavian",
         "Osmanya",
         "Cypriot Syllabary",
+        "Phoenician",
+        "Lydian",
+        "Kharoshthi",
+        "Cuneiform",
+        "Cuneiform Numbers and Punctuation",
         "Byzantine Musical Symbols",
         "Musical Symbols",
+        "Ancient Greek Musical Notation",
         "Tai Xuan Jing Symbols",
+        "Counting Rod Numerals",
         "Mathematical Alphanumeric Symbols",
+        "Mahjong Tiles",
+        "Domino Tiles",
         "CJK Unified Ideographs Extension B",
         "CJK Compatibility Ideographs Supplement",
         "Tags",