changeset 8030:c9450b73265d

[SCENEBUILDER] Merge (no conflict).
author Eric Le Ponner <eric.le.ponner@oracle.com>
date Wed, 10 Sep 2014 17:11:16 +0200
parents d8c7120ab268 99b538fc6dd3
children 114951fd1301
files
diffstat 4 files changed, 10 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/panel/css/CssPanelController.java	Wed Sep 10 12:02:47 2014 +0200
+++ b/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/panel/css/CssPanelController.java	Wed Sep 10 17:11:16 2014 +0200
@@ -1882,7 +1882,7 @@
             } catch (MalformedURLException ex) {
                 System.out.println("Invalid URL: " + ex);
             }
-            origin = CssInternal.getOrigin(rule);
+            origin = rule.getOrigin();
         }
         return getSource(url, origin);
     }
--- a/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/panel/css/NodeCssState.java	Wed Sep 10 12:02:47 2014 +0200
+++ b/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/panel/css/NodeCssState.java	Wed Sep 10 17:11:16 2014 +0200
@@ -429,7 +429,7 @@
         @Override
         public int compare(MatchingRule t, MatchingRule t1) {
             int originComparaison = compareOrigin(
-                    CssInternal.getOrigin(t.getRule()), CssInternal.getOrigin(t1.rule));
+                    t.getRule().getOrigin(), t1.rule.getOrigin());
             int tnotApplied = countNotApplied(t.declarations);
             int t1notApplied = countNotApplied(t1.declarations);
             int notAppliedComparaisons = tnotApplied - t1notApplied;
@@ -597,7 +597,7 @@
             for (Map.Entry<MatchingRule, List<MatchingDeclaration>> entry : matchingRules.entrySet()) {
                 MatchingRule rule = entry.getKey();
                 // Filterout the Inline
-                if (CssInternal.getOrigin(rule.getRule()) != StyleOrigin.INLINE) {
+                if (rule.getRule().getOrigin() != StyleOrigin.INLINE) {
                     rule.addDeclarations(entry.getValue());
                     sortedMatchingRules.add(rule);
                 }
--- a/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/util/CssInternal.java	Wed Sep 10 12:02:47 2014 +0200
+++ b/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/util/CssInternal.java	Wed Sep 10 17:11:16 2014 +0200
@@ -131,15 +131,11 @@
     }
 
     public static boolean isThemeRule(Rule rule) {
-        // With SB 2, we apply explicitly theme css (Modena, Caspian, ...)
-        // So although their rules appear with an AUTHOR origin, we have to consider them as USER_AGENT.
-        if (rule.getOrigin() == StyleOrigin.AUTHOR) {
-            String stylePath = rule.getStylesheet().getUrl();
-            assert stylePath != null;
-            for (String themeUrl : themeUrls) {
-                if (stylePath.endsWith(themeUrl)) {
-                    return true;
-                }
+        String stylePath = rule.getStylesheet().getUrl();
+        assert stylePath != null;
+        for (String themeUrl : themeUrls) {
+            if (stylePath.endsWith(themeUrl)) {
+                return true;
             }
         }
         return false;
@@ -496,24 +492,9 @@
         if (style == null || style.getDeclaration() == null) {
             return null;
         }
-        return getOrigin(style.getDeclaration().getRule());
+        return style.getDeclaration().getRule().getOrigin();
     }
 
-    // Wrapper method that force the origin to be USER_AGENT if this is an Fx theme style.
-    public static StyleOrigin getOrigin(Rule rule) {
-        if (rule == null) {
-            return null;
-        }
-        if (isThemeRule(rule)) {
-            // Force the origin to be USER_AGENT if this is an Fx theme style.
-            return StyleOrigin.USER_AGENT;
-        } else {
-            // Are the 2 lines below equivalent ?
-            // styleOrigin = style.getDeclaration().getRule().getStylesheet().getOrigin();
-            return rule.getOrigin();
-        }
-    }
-    
     // From an css url, returns the theme display name
     public static String getThemeDisplayName(String url) {
         String themeName = ""; //NOI18N
--- a/modules/graphics/src/main/native-glass/win/GlassAccessible.cpp	Wed Sep 10 12:02:47 2014 +0200
+++ b/modules/graphics/src/main/native-glass/win/GlassAccessible.cpp	Wed Sep 10 17:11:16 2014 +0200
@@ -1336,5 +1336,5 @@
 JNIEXPORT jboolean JNICALL Java_com_sun_glass_ui_win_WinAccessible_UiaClientsAreListening
   (JNIEnv *env, jclass jClass)
 {
-    return UiaClientsAreListening();
+    return UiaClientsAreListening() ? JNI_TRUE : JNI_FALSE;
 }