You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by rw...@apache.org on 2017/10/05 22:54:28 UTC

svn commit: r1811275 - /pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme.java

Author: rwhitcomb
Date: Thu Oct  5 22:54:28 2017
New Revision: 1811275

URL: http://svn.apache.org/viewvc?rev=1811275&view=rev
Log:
PIVOT-999: Update TerraTheme to use the new default methods in Dictionary
to simplify getting the theme properties.  Also use Utils methods for
parameter validation.

Modified:
    pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme.java

Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme.java?rev=1811275&r1=1811274&r2=1811275&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme.java (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme.java Thu Oct  5 22:54:28 2017
@@ -239,9 +239,7 @@ public final class TerraTheme extends Th
     }
 
     private void load(URL location) {
-        if (location == null) {
-            throw new IllegalArgumentException("Location URL is null");
-        }
+        Utils.checkNull(location, "location");
 
         try (InputStream inputStream = location.openStream()) {
             JSONSerializer serializer = new JSONSerializer();
@@ -261,20 +259,9 @@ public final class TerraTheme extends Th
                 colorMultiplier = mult.floatValue();
             }
 
-            Boolean dark = (Boolean) properties.get("themeIsDark");
-            if (dark != null) {
-                themeIsDark = dark.booleanValue();
-            }
-
-            Boolean flat = (Boolean) properties.get("themeIsFlat");
-            if (flat != null) {
-                themeIsFlat = flat.booleanValue();
-            }
-
-            Boolean transition = (Boolean) properties.get("transitionEnabled");
-            if (transition != null) {
-                transitionEnabled = transition.booleanValue();
-            }
+            themeIsDark = properties.getBoolean("themeIsDark", false);
+            themeIsFlat = properties.getBoolean("themeIsFlat", false);
+            transitionEnabled = properties.getBoolean("transitionEnabled", true);
 
             for (String colorCode : colorCodes) {
                 Color baseColor = Color.decode(colorCode);