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/05/29 22:19:29 UTC

svn commit: r1796710 - in /pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra: TerraExpanderSkin.java TerraMenuButtonSkin.java TerraTabPaneSkin.java TerraTableViewSkin.java TerraTreeViewSkin.java TerraVFSBrowserSkin.java

Author: rwhitcomb
Date: Mon May 29 22:19:29 2017
New Revision: 1796710

URL: http://svn.apache.org/viewvc?rev=1796710&view=rev
Log:
PIVOT-999 and others:  More use of Utils.checkNull to validate input parameters;
Using Dictionary.getIntValues for int valued styles in many places.

Modified:
    pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraExpanderSkin.java
    pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraMenuButtonSkin.java
    pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTabPaneSkin.java
    pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTableViewSkin.java
    pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTreeViewSkin.java
    pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraVFSBrowserSkin.java

Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraExpanderSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraExpanderSkin.java?rev=1796710&r1=1796709&r2=1796710&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraExpanderSkin.java (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraExpanderSkin.java Mon May 29 22:19:29 2017
@@ -24,6 +24,7 @@ import java.awt.Graphics2D;
 import java.awt.RenderingHints;
 
 import org.apache.pivot.collections.Dictionary;
+import org.apache.pivot.util.Utils;
 import org.apache.pivot.util.Vote;
 import org.apache.pivot.wtk.BoxPane;
 import org.apache.pivot.wtk.Button;
@@ -234,7 +235,7 @@ public class TerraExpanderSkin extends E
     private static final int DEFAULT_EXPAND_DURATION = 250;
     private static final int DEFAULT_EXPAND_RATE = 30;
 
-    @SuppressWarnings("unused")
+    //@SuppressWarnings("unused")
     public TerraExpanderSkin() {
         TerraTheme theme = (TerraTheme) Theme.getTheme();
         setBackgroundColor(theme.getColor(4));
@@ -481,18 +482,10 @@ public class TerraExpanderSkin extends E
     }
 
     public final void setTitleBarFont(String titleBarFont) {
-        if (titleBarFont == null) {
-            throw new IllegalArgumentException("titleBarFont is null.");
-        }
-
         setTitleBarFont(decodeFont(titleBarFont));
     }
 
     public final void setTitleBarFont(Dictionary<String, ?> titleBarFont) {
-        if (titleBarFont == null) {
-            throw new IllegalArgumentException("titleBarFont is null.");
-        }
-
         setTitleBarFont(Theme.deriveFont(titleBarFont));
     }
 
@@ -506,11 +499,7 @@ public class TerraExpanderSkin extends E
     }
 
     public final void setTitleBarColor(String titleBarColor) {
-        if (titleBarColor == null) {
-            throw new IllegalArgumentException("titleBarColor is null.");
-        }
-
-        setTitleBarColor(GraphicsUtilities.decodeColor(titleBarColor));
+        setTitleBarColor(GraphicsUtilities.decodeColor(titleBarColor, "titleBarColor"));
     }
 
     public Color getTitleBarBackgroundColor() {
@@ -524,11 +513,7 @@ public class TerraExpanderSkin extends E
     }
 
     public final void setTitleBarBackgroundColor(String titleBarBackgroundColor) {
-        if (titleBarBackgroundColor == null) {
-            throw new IllegalArgumentException("titleBarBackgroundColor is null.");
-        }
-
-        setTitleBarBackgroundColor(GraphicsUtilities.decodeColor(titleBarBackgroundColor));
+        setTitleBarBackgroundColor(GraphicsUtilities.decodeColor(titleBarBackgroundColor, "titleBarBackgroundColor"));
     }
 
     public Color getTitleBarBorderColor() {
@@ -541,11 +526,7 @@ public class TerraExpanderSkin extends E
     }
 
     public final void setTitleBarBorderColor(String titleBarBorderColor) {
-        if (titleBarBorderColor == null) {
-            throw new IllegalArgumentException("titleBarBorderColor is null.");
-        }
-
-        setTitleBarBorderColor(GraphicsUtilities.decodeColor(titleBarBorderColor));
+        setTitleBarBorderColor(GraphicsUtilities.decodeColor(titleBarBorderColor, "titleBarBorderColor"));
     }
 
     public Color getShadeButtonColor() {
@@ -558,11 +539,7 @@ public class TerraExpanderSkin extends E
     }
 
     public final void setShadeButtonColor(String shadeButtonColor) {
-        if (shadeButtonColor == null) {
-            throw new IllegalArgumentException("shadeButtonColor is null.");
-        }
-
-        setShadeButtonColor(GraphicsUtilities.decodeColor(shadeButtonColor));
+        setShadeButtonColor(GraphicsUtilities.decodeColor(shadeButtonColor, "shadeButtonColor"));
     }
 
     public Color getDisabledShadeButtonColor() {
@@ -579,11 +556,7 @@ public class TerraExpanderSkin extends E
     }
 
     public final void setBorderColor(String borderColor) {
-        if (borderColor == null) {
-            throw new IllegalArgumentException("borderColor is null.");
-        }
-
-        setBorderColor(GraphicsUtilities.decodeColor(borderColor));
+        setBorderColor(GraphicsUtilities.decodeColor(borderColor, "borderColor"));
     }
 
     public Insets getPadding() {
@@ -596,10 +569,6 @@ public class TerraExpanderSkin extends E
     }
 
     public final void setPadding(Dictionary<String, ?> padding) {
-        if (padding == null) {
-            throw new IllegalArgumentException("padding is null.");
-        }
-
         setPadding(new Insets(padding));
     }
 
@@ -608,18 +577,12 @@ public class TerraExpanderSkin extends E
     }
 
     public final void setPadding(Number padding) {
-        if (padding == null) {
-            throw new IllegalArgumentException("padding is null.");
-        }
+        Utils.checkNull(padding, "padding");
 
         setPadding(padding.intValue());
     }
 
     public final void setPadding(String padding) {
-        if (padding == null) {
-            throw new IllegalArgumentException("padding is null.");
-        }
-
         setPadding(Insets.decode(padding));
     }
 
@@ -726,7 +689,7 @@ public class TerraExpanderSkin extends E
     public void expandedChangeVetoed(Expander expander, Vote reason) {
         if (reason == Vote.DENY && expandTransition != null) {
             // NOTE We stop, rather than end, the transition so the completion
-            // event isn't fired; if the event fires, the listener will set
+            // event isn't fired; because if the event fires, the listener will set
             // the expanded state
             expandTransition.stop();
             expandTransition = null;
@@ -757,4 +720,5 @@ public class TerraExpanderSkin extends E
 
         invalidateComponent();
     }
+
 }

Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraMenuButtonSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraMenuButtonSkin.java?rev=1796710&r1=1796709&r2=1796710&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraMenuButtonSkin.java (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraMenuButtonSkin.java Mon May 29 22:19:29 2017
@@ -27,6 +27,7 @@ import java.awt.geom.Path2D;
 import java.awt.geom.RoundRectangle2D;
 
 import org.apache.pivot.collections.Dictionary;
+import org.apache.pivot.util.Utils;
 import org.apache.pivot.wtk.Bounds;
 import org.apache.pivot.wtk.Button;
 import org.apache.pivot.wtk.Component;
@@ -353,26 +354,20 @@ public class TerraMenuButtonSkin extends
     }
 
     public void setFont(Font font) {
-        if (font == null) {
-            throw new IllegalArgumentException("font is null.");
-        }
+        Utils.checkNull(font, "font");
 
         this.font = font;
         invalidateComponent();
     }
 
     public final void setFont(String font) {
-        if (font == null) {
-            throw new IllegalArgumentException("font is null.");
-        }
+        Utils.checkNull(font, "font");
 
         setFont(decodeFont(font));
     }
 
     public final void setFont(Dictionary<String, ?> font) {
-        if (font == null) {
-            throw new IllegalArgumentException("font is null.");
-        }
+        Utils.checkNull(font, "font");
 
         setFont(Theme.deriveFont(font));
     }
@@ -382,18 +377,14 @@ public class TerraMenuButtonSkin extends
     }
 
     public void setColor(Color color) {
-        if (color == null) {
-            throw new IllegalArgumentException("color is null.");
-        }
+        Utils.checkNull(color, "color");
 
         this.color = color;
         repaintComponent();
     }
 
     public final void setColor(String color) {
-        if (color == null) {
-            throw new IllegalArgumentException("color is null.");
-        }
+        Utils.checkNull(color, "color");
 
         setColor(GraphicsUtilities.decodeColor(color));
     }
@@ -408,18 +399,14 @@ public class TerraMenuButtonSkin extends
     }
 
     public void setDisabledColor(Color disabledColor) {
-        if (disabledColor == null) {
-            throw new IllegalArgumentException("disabledColor is null.");
-        }
+        Utils.checkNull(disabledColor, "disabledColor");
 
         this.disabledColor = disabledColor;
         repaintComponent();
     }
 
     public final void setDisabledColor(String disabledColor) {
-        if (disabledColor == null) {
-            throw new IllegalArgumentException("disabledColor is null.");
-        }
+        Utils.checkNull(disabledColor, "disabledColor");
 
         setDisabledColor(GraphicsUtilities.decodeColor(disabledColor));
     }
@@ -434,9 +421,7 @@ public class TerraMenuButtonSkin extends
     }
 
     public void setBackgroundColor(Color backgroundColor) {
-        if (backgroundColor == null) {
-            throw new IllegalArgumentException("backgroundColor is null.");
-        }
+        Utils.checkNull(backgroundColor, "backgroundColor");
 
         this.backgroundColor = backgroundColor;
         bevelColor = TerraTheme.brighten(backgroundColor);
@@ -445,9 +430,7 @@ public class TerraMenuButtonSkin extends
     }
 
     public final void setBackgroundColor(String backgroundColor) {
-        if (backgroundColor == null) {
-            throw new IllegalArgumentException("backgroundColor is null.");
-        }
+        Utils.checkNull(backgroundColor, "backgroundColor");
 
         setBackgroundColor(GraphicsUtilities.decodeColor(backgroundColor));
     }
@@ -462,9 +445,7 @@ public class TerraMenuButtonSkin extends
     }
 
     public void setDisabledBackgroundColor(Color disabledBackgroundColor) {
-        if (disabledBackgroundColor == null) {
-            throw new IllegalArgumentException("disabledBackgroundColor is null.");
-        }
+        Utils.checkNull(disabledBackgroundColor, "disabledBackgroundColor");
 
         this.disabledBackgroundColor = disabledBackgroundColor;
         disabledBevelColor = disabledBackgroundColor;
@@ -472,9 +453,7 @@ public class TerraMenuButtonSkin extends
     }
 
     public final void setDisabledBackgroundColor(String disabledBackgroundColor) {
-        if (disabledBackgroundColor == null) {
-            throw new IllegalArgumentException("disabledBackgroundColor is null.");
-        }
+        Utils.checkNull(disabledBackgroundColor, "disabledBackgroundColor");
 
         setDisabledBackgroundColor(GraphicsUtilities.decodeColor(disabledBackgroundColor));
     }
@@ -489,9 +468,7 @@ public class TerraMenuButtonSkin extends
     }
 
     public void setBorderColor(Color borderColor) {
-        if (borderColor == null) {
-            throw new IllegalArgumentException("borderColor is null.");
-        }
+        Utils.checkNull(borderColor, "borderColor");
 
         this.borderColor = borderColor;
         menuPopup.getStyles().put("borderColor", borderColor);
@@ -499,9 +476,7 @@ public class TerraMenuButtonSkin extends
     }
 
     public final void setBorderColor(String borderColor) {
-        if (borderColor == null) {
-            throw new IllegalArgumentException("borderColor is null.");
-        }
+        Utils.checkNull(borderColor, "borderColor");
 
         setBorderColor(GraphicsUtilities.decodeColor(borderColor));
     }
@@ -516,18 +491,14 @@ public class TerraMenuButtonSkin extends
     }
 
     public void setDisabledBorderColor(Color disabledBorderColor) {
-        if (disabledBorderColor == null) {
-            throw new IllegalArgumentException("disabledBorderColor is null.");
-        }
+        Utils.checkNull(disabledBorderColor, "disabledBorderColor");
 
         this.disabledBorderColor = disabledBorderColor;
         repaintComponent();
     }
 
     public final void setDisabledBorderColor(String disabledBorderColor) {
-        if (disabledBorderColor == null) {
-            throw new IllegalArgumentException("disabledBorderColor is null.");
-        }
+        Utils.checkNull(disabledBorderColor, "disabledBorderColor");
 
         setDisabledBorderColor(GraphicsUtilities.decodeColor(disabledBorderColor));
     }
@@ -542,18 +513,14 @@ public class TerraMenuButtonSkin extends
     }
 
     public void setPadding(Insets padding) {
-        if (padding == null) {
-            throw new IllegalArgumentException("padding is null.");
-        }
+        Utils.checkNull(padding, "padding");
 
         this.padding = padding;
         invalidateComponent();
     }
 
     public final void setPadding(Dictionary<String, ?> padding) {
-        if (padding == null) {
-            throw new IllegalArgumentException("padding is null.");
-        }
+        Utils.checkNull(padding, "padding");
 
         setPadding(new Insets(padding));
     }
@@ -563,17 +530,13 @@ public class TerraMenuButtonSkin extends
     }
 
     public final void setPadding(Number padding) {
-        if (padding == null) {
-            throw new IllegalArgumentException("padding is null.");
-        }
+        Utils.checkNull(padding, "padding");
 
         setPadding(padding.intValue());
     }
 
     public final void setPadding(String padding) {
-        if (padding == null) {
-            throw new IllegalArgumentException("padding is null.");
-        }
+        Utils.checkNull(padding, "padding");
 
         setPadding(Insets.decode(padding));
     }
@@ -591,9 +554,7 @@ public class TerraMenuButtonSkin extends
     }
 
     public final void setSpacing(Number spacing) {
-        if (spacing == null) {
-            throw new IllegalArgumentException("spacing is null.");
-        }
+        Utils.checkNull(spacing, "spacing");
 
         setSpacing(spacing.intValue());
     }
@@ -613,9 +574,7 @@ public class TerraMenuButtonSkin extends
     }
 
     public final void setMinimumAspectRatio(Number minumumAspectRatio) {
-        if (minumumAspectRatio == null) {
-            throw new IllegalArgumentException("minumumAspectRatio is null.");
-        }
+        Utils.checkNull(minumumAspectRatio, "minumumAspectRatio");
 
         setMinimumAspectRatio(minumumAspectRatio.floatValue());
     }
@@ -635,9 +594,7 @@ public class TerraMenuButtonSkin extends
     }
 
     public final void setMaximumAspectRatio(Number maximumAspectRatio) {
-        if (maximumAspectRatio == null) {
-            throw new IllegalArgumentException("maximumAspectRatio is null.");
-        }
+        Utils.checkNull(maximumAspectRatio, "maximumAspectRatio");
 
         setMaximumAspectRatio(maximumAspectRatio.floatValue());
     }
@@ -657,19 +614,19 @@ public class TerraMenuButtonSkin extends
     }
 
     public int getCloseTransitionDuration() {
-        return ((Integer) menuPopup.getStyles().get("closeTransitionDuration")).intValue();
+        return menuPopup.getStyles().getIntValue("closeTransitionDuration");
     }
 
     public void setCloseTransitionDuration(int closeTransitionDuration) {
-        menuPopup.getStyles().put("closeTransitionDuration", Integer.valueOf(closeTransitionDuration));
+        menuPopup.getStyles().putIntValue("closeTransitionDuration", closeTransitionDuration);
     }
 
     public int getCloseTransitionRate() {
-        return ((Integer) menuPopup.getStyles().get("closeTransitionRate")).intValue();
+        return menuPopup.getStyles().getIntValue("closeTransitionRate");
     }
 
     public void setCloseTransitionRate(int closeTransitionRate) {
-        menuPopup.getStyles().put("closeTransitionRate", Integer.valueOf(closeTransitionRate));
+        menuPopup.getStyles().putIntValue("closeTransitionRate", closeTransitionRate);
     }
 
     @Override

Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTabPaneSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTabPaneSkin.java?rev=1796710&r1=1796709&r2=1796710&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTabPaneSkin.java (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTabPaneSkin.java Mon May 29 22:19:29 2017
@@ -27,6 +27,7 @@ import java.awt.geom.RoundRectangle2D;
 
 import org.apache.pivot.collections.Dictionary;
 import org.apache.pivot.collections.Sequence;
+import org.apache.pivot.util.Utils;
 import org.apache.pivot.util.Vote;
 import org.apache.pivot.wtk.ApplicationContext;
 import org.apache.pivot.wtk.Bounds;
@@ -604,7 +605,7 @@ public class TerraTabPaneSkin extends Ta
         tabButtonBoxPane.getStyles().put("fill", new Boolean(true));
 
         tabButtonPanorama.getStyles().put("buttonBackgroundColor", borderColor);
-        tabButtonPanorama.getStyles().put("buttonPadding", Integer.valueOf(6));
+        tabButtonPanorama.getStyles().putIntValue("buttonPadding", 6);
         tabButtonPanorama.setView(tabButtonBoxPane);
 
         tabButtonGroup.getButtonGroupListeners().add(new ButtonGroupListener.Adapter() {
@@ -1155,9 +1156,7 @@ public class TerraTabPaneSkin extends Ta
     }
 
     public void setActiveTabColor(Color activeTabColor) {
-        if (activeTabColor == null) {
-            throw new IllegalArgumentException("activeTabColor is null.");
-        }
+        Utils.checkNull(activeTabColor, "activeTabColor");
 
         this.activeTabColor = activeTabColor;
         activeButtonBevelColor = TerraTheme.brighten(activeTabColor);
@@ -1165,11 +1164,7 @@ public class TerraTabPaneSkin extends Ta
     }
 
     public final void setActiveTabColor(String activeTabColor) {
-        if (activeTabColor == null) {
-            throw new IllegalArgumentException("activeTabColor is null.");
-        }
-
-        setActiveTabColor(GraphicsUtilities.decodeColor(activeTabColor));
+        setActiveTabColor(GraphicsUtilities.decodeColor(activeTabColor, "activeTabColor"));
     }
 
     public final void setActiveTabColor(int activeTabColor) {
@@ -1182,9 +1177,7 @@ public class TerraTabPaneSkin extends Ta
     }
 
     public void setInactiveTabColor(Color inactiveTabColor) {
-        if (inactiveTabColor == null) {
-            throw new IllegalArgumentException("inactiveTabColor is null.");
-        }
+        Utils.checkNull(inactiveTabColor, "inactiveTabColor");
 
         this.inactiveTabColor = inactiveTabColor;
         inactiveButtonBevelColor = TerraTheme.brighten(inactiveTabColor);
@@ -1192,11 +1185,7 @@ public class TerraTabPaneSkin extends Ta
     }
 
     public final void setInactiveTabColor(String inactiveTabColor) {
-        if (inactiveTabColor == null) {
-            throw new IllegalArgumentException("inactiveTabColor is null.");
-        }
-
-        setInactiveTabColor(GraphicsUtilities.decodeColor(inactiveTabColor));
+        setInactiveTabColor(GraphicsUtilities.decodeColor(inactiveTabColor, "inactiveTabColor"));
     }
 
     public final void setInactiveTabColor(int inactiveTabColor) {
@@ -1209,9 +1198,7 @@ public class TerraTabPaneSkin extends Ta
     }
 
     public void setBorderColor(Color borderColor) {
-        if (borderColor == null) {
-            throw new IllegalArgumentException("borderColor is null.");
-        }
+        Utils.checkNull(borderColor, "borderColor");
 
         this.borderColor = borderColor;
         tabButtonPanorama.getStyles().put("buttonBackgroundColor", borderColor);
@@ -1219,11 +1206,7 @@ public class TerraTabPaneSkin extends Ta
     }
 
     public final void setBorderColor(String borderColor) {
-        if (borderColor == null) {
-            throw new IllegalArgumentException("borderColor is null.");
-        }
-
-        setBorderColor(GraphicsUtilities.decodeColor(borderColor));
+        setBorderColor(GraphicsUtilities.decodeColor(borderColor, "borderColor"));
     }
 
     public final void setBorderColor(int borderColor) {
@@ -1236,20 +1219,14 @@ public class TerraTabPaneSkin extends Ta
     }
 
     public void setInactiveBorderColor(Color inactiveBorderColor) {
-        if (inactiveBorderColor == null) {
-            throw new IllegalArgumentException("inactiveBorderColor is null.");
-        }
+        Utils.checkNull(inactiveBorderColor, "inactiveBorderColor");
 
         this.inactiveBorderColor = inactiveBorderColor;
         repaintComponent();
     }
 
     public final void setInactiveBorderColor(String inactiveBorderColor) {
-        if (inactiveBorderColor == null) {
-            throw new IllegalArgumentException("inactiveBorderColor is null.");
-        }
-
-        setInactiveBorderColor(GraphicsUtilities.decodeColor(inactiveBorderColor));
+        setInactiveBorderColor(GraphicsUtilities.decodeColor(inactiveBorderColor, "inactiveBorderColor"));
     }
 
     public final void setInactiveBorderColor(int inactiveBorderColor) {
@@ -1262,19 +1239,13 @@ public class TerraTabPaneSkin extends Ta
     }
 
     public void setPadding(Insets padding) {
-        if (padding == null) {
-            throw new IllegalArgumentException("padding is null.");
-        }
+        Utils.checkNull(padding, "padding");
 
         this.padding = padding;
         invalidateComponent();
     }
 
     public final void setPadding(Dictionary<String, ?> padding) {
-        if (padding == null) {
-            throw new IllegalArgumentException("padding is null.");
-        }
-
         setPadding(new Insets(padding));
     }
 
@@ -1283,18 +1254,12 @@ public class TerraTabPaneSkin extends Ta
     }
 
     public final void setPadding(Number padding) {
-        if (padding == null) {
-            throw new IllegalArgumentException("padding is null.");
-        }
+        Utils.checkNull(padding, "padding");
 
         setPadding(padding.intValue());
     }
 
     public final void setPadding(String padding) {
-        if (padding == null) {
-            throw new IllegalArgumentException("padding is null.");
-        }
-
         setPadding(Insets.decode(padding));
     }
 
@@ -1303,27 +1268,17 @@ public class TerraTabPaneSkin extends Ta
     }
 
     public void setButtonFont(Font buttonFont) {
-        if (buttonFont == null) {
-            throw new IllegalArgumentException("buttonFont is null.");
-        }
+        Utils.checkNull(buttonFont, "buttonFont");
 
         this.buttonFont = buttonFont;
         invalidateComponent();
     }
 
     public final void setButtonFont(String buttonFont) {
-        if (buttonFont == null) {
-            throw new IllegalArgumentException("font is null.");
-        }
-
         setButtonFont(decodeFont(buttonFont));
     }
 
     public final void setButtonFont(Dictionary<String, ?> buttonFont) {
-        if (buttonFont == null) {
-            throw new IllegalArgumentException("font is null.");
-        }
-
         setButtonFont(Theme.deriveFont(buttonFont));
     }
 
@@ -1332,20 +1287,14 @@ public class TerraTabPaneSkin extends Ta
     }
 
     public void setButtonColor(Color buttonColor) {
-        if (buttonColor == null) {
-            throw new IllegalArgumentException("buttonColor is null.");
-        }
+        Utils.checkNull(buttonColor, "buttonColor");
 
         this.buttonColor = buttonColor;
         repaintComponent();
     }
 
     public final void setButtonColor(String buttonColor) {
-        if (buttonColor == null) {
-            throw new IllegalArgumentException("buttonColor is null.");
-        }
-
-        setButtonColor(GraphicsUtilities.decodeColor(buttonColor));
+        setButtonColor(GraphicsUtilities.decodeColor(buttonColor, "buttonColor"));
     }
 
     public final void setButtonColor(int buttonColor) {
@@ -1358,9 +1307,7 @@ public class TerraTabPaneSkin extends Ta
     }
 
     public void setButtonPadding(Insets buttonPadding) {
-        if (buttonPadding == null) {
-            throw new IllegalArgumentException("buttonPadding is null.");
-        }
+        Utils.checkNull(buttonPadding, "buttonPadding");
 
         this.buttonPadding = buttonPadding;
         invalidateComponent();
@@ -1370,10 +1317,6 @@ public class TerraTabPaneSkin extends Ta
     }
 
     public final void setButtonPadding(Dictionary<String, ?> padding) {
-        if (padding == null) {
-            throw new IllegalArgumentException("buttonPadding is null.");
-        }
-
         setButtonPadding(new Insets(padding));
     }
 
@@ -1382,27 +1325,21 @@ public class TerraTabPaneSkin extends Ta
     }
 
     public final void setButtonPadding(Number padding) {
-        if (padding == null) {
-            throw new IllegalArgumentException("buttonPadding is null.");
-        }
+        Utils.checkNull(padding, "padding");
 
         setButtonPadding(padding.intValue());
     }
 
     public final void setButtonPadding(String padding) {
-        if (padding == null) {
-            throw new IllegalArgumentException("buttonPadding is null.");
-        }
-
         setButtonPadding(Insets.decode(padding));
     }
 
     public int getButtonSpacing() {
-        return ((Integer) tabButtonBoxPane.getStyles().get("spacing")).intValue();
+        return tabButtonBoxPane.getStyles().getIntValue("spacing");
     }
 
     public void setButtonSpacing(int buttonSpacing) {
-        tabButtonBoxPane.getStyles().put("spacing", Integer.valueOf(buttonSpacing));
+        tabButtonBoxPane.getStyles().putIntValue("spacing", buttonSpacing);
     }
 
     public final void setButtonCornerRadius(int buttonCornerRadius) {
@@ -1410,17 +1347,13 @@ public class TerraTabPaneSkin extends Ta
     }
 
     public final void setButtonCornerRadius(Number radius) {
-        if (radius == null) {
-            throw new IllegalArgumentException("buttonCornerRadius is null.");
-        }
+        Utils.checkNull(radius, "buttonCornerRadius");
 
         setButtonCornerRadius(radius.intValue());
     }
 
     public final void setButtonCornerRadius(String radius) {
-        if (radius == null) {
-            throw new IllegalArgumentException("buttonCornerRadius is null.");
-        }
+        Utils.checkNullOrEmpty(radius, "buttonCornerRadius");
 
         setButtonCornerRadius(Integer.valueOf(radius));
     }
@@ -1430,9 +1363,7 @@ public class TerraTabPaneSkin extends Ta
     }
 
     public void setTabOrientation(Orientation tabOrientation) {
-        if (tabOrientation == null) {
-            throw new IllegalArgumentException("tabOrientation is null.");
-        }
+        Utils.checkNull(tabOrientation, "tabOrientation");
 
         this.tabOrientation = tabOrientation;
 

Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTableViewSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTableViewSkin.java?rev=1796710&r1=1796709&r2=1796710&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTableViewSkin.java (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTableViewSkin.java Mon May 29 22:19:29 2017
@@ -27,6 +27,7 @@ import org.apache.pivot.collections.Dict
 import org.apache.pivot.collections.List;
 import org.apache.pivot.collections.Sequence;
 import org.apache.pivot.util.Filter;
+import org.apache.pivot.util.Utils;
 import org.apache.pivot.wtk.Bounds;
 import org.apache.pivot.wtk.Component;
 import org.apache.pivot.wtk.Dimensions;
@@ -163,8 +164,7 @@ public class TerraTableViewSkin extends
             }
         }
 
-        // Include space for vertical gridlines; even if we are not painting
-        // them,
+        // Include space for vertical gridlines; even if we are not painting them,
         // the header does
         preferredWidth += (n - 1);
 
@@ -571,9 +571,7 @@ public class TerraTableViewSkin extends
     // Table view skin methods
     @Override
     public int getRowAt(int y) {
-        if (y < 0) {
-            throw new IllegalArgumentException("y is negative");
-        }
+        Utils.checkNonNegative(y, "y");
 
         TableView tableView = (TableView) getComponent();
 
@@ -602,9 +600,7 @@ public class TerraTableViewSkin extends
 
     @Override
     public int getColumnAt(int x) {
-        if (x < 0) {
-            throw new IllegalArgumentException("x is negative");
-        }
+        Utils.checkNonNegative(x, "x");
 
         TableView tableView = (TableView) getComponent();
 
@@ -646,9 +642,7 @@ public class TerraTableViewSkin extends
         @SuppressWarnings("unchecked")
         List<Object> tableData = (List<Object>) tableView.getTableData();
 
-        if (rowIndex < 0 || rowIndex >= tableData.getLength()) {
-            throw new IndexOutOfBoundsException();
-        }
+        Utils.checkZeroBasedIndex(rowIndex, tableData.getLength());
 
         int cellX = 0;
         for (int i = 0; i < columnIndex; i++) {
@@ -735,27 +729,17 @@ public class TerraTableViewSkin extends
     }
 
     public void setFont(Font font) {
-        if (font == null) {
-            throw new IllegalArgumentException("font is null.");
-        }
+        Utils.checkNull(font, "font");
 
         this.font = font;
         invalidateComponent();
     }
 
     public final void setFont(String font) {
-        if (font == null) {
-            throw new IllegalArgumentException("font is null.");
-        }
-
         setFont(decodeFont(font));
     }
 
     public final void setFont(Dictionary<String, ?> font) {
-        if (font == null) {
-            throw new IllegalArgumentException("font is null.");
-        }
-
         setFont(Theme.deriveFont(font));
     }
 
@@ -764,19 +748,13 @@ public class TerraTableViewSkin extends
     }
 
     public void setColor(Color color) {
-        if (color == null) {
-            throw new IllegalArgumentException("color is null.");
-        }
+        Utils.checkNull(color, "color");
 
         this.color = color;
         repaintComponent();
     }
 
     public final void setColor(String color) {
-        if (color == null) {
-            throw new IllegalArgumentException("color is null.");
-        }
-
         setColor(GraphicsUtilities.decodeColor(color));
     }
 
@@ -790,20 +768,14 @@ public class TerraTableViewSkin extends
     }
 
     public void setDisabledColor(Color disabledColor) {
-        if (disabledColor == null) {
-            throw new IllegalArgumentException("disabledColor is null.");
-        }
+        Utils.checkNull(disabledColor, "disabledColor");
 
         this.disabledColor = disabledColor;
         repaintComponent();
     }
 
     public final void setDisabledColor(String disabledColor) {
-        if (disabledColor == null) {
-            throw new IllegalArgumentException("disabledColor is null.");
-        }
-
-        setDisabledColor(GraphicsUtilities.decodeColor(disabledColor));
+        setDisabledColor(GraphicsUtilities.decodeColor(disabledColor, "disabledColor"));
     }
 
     public final void setDisabledColor(int disabledColor) {
@@ -816,16 +788,14 @@ public class TerraTableViewSkin extends
     }
 
     public void setBackgroundColor(Color backgroundColor) {
+        Utils.checkNull(backgroundColor, "backgroundColor");
+
         this.backgroundColor = backgroundColor;
         repaintComponent();
     }
 
     public final void setBackgroundColor(String backgroundColor) {
-        if (backgroundColor == null) {
-            throw new IllegalArgumentException("backgroundColor is null.");
-        }
-
-        setBackgroundColor(GraphicsUtilities.decodeColor(backgroundColor));
+        setBackgroundColor(GraphicsUtilities.decodeColor(backgroundColor, "backgroundColor"));
     }
 
     public final void setBackgroundColor(int backgroundColor) {
@@ -838,20 +808,14 @@ public class TerraTableViewSkin extends
     }
 
     public void setSelectionColor(Color selectionColor) {
-        if (selectionColor == null) {
-            throw new IllegalArgumentException("selectionColor is null.");
-        }
+        Utils.checkNull(selectionColor, "selectionColor");
 
         this.selectionColor = selectionColor;
         repaintComponent();
     }
 
     public final void setSelectionColor(String selectionColor) {
-        if (selectionColor == null) {
-            throw new IllegalArgumentException("selectionColor is null.");
-        }
-
-        setSelectionColor(GraphicsUtilities.decodeColor(selectionColor));
+        setSelectionColor(GraphicsUtilities.decodeColor(selectionColor, "selectionColor"));
     }
 
     public final void setSelectionColor(int selectionColor) {
@@ -864,20 +828,15 @@ public class TerraTableViewSkin extends
     }
 
     public void setSelectionBackgroundColor(Color selectionBackgroundColor) {
-        if (selectionBackgroundColor == null) {
-            throw new IllegalArgumentException("selectionBackgroundColor is null.");
-        }
+        Utils.checkNull(selectionBackgroundColor, "selectionBackgroundColor");
 
         this.selectionBackgroundColor = selectionBackgroundColor;
         repaintComponent();
     }
 
     public final void setSelectionBackgroundColor(String selectionBackgroundColor) {
-        if (selectionBackgroundColor == null) {
-            throw new IllegalArgumentException("selectionBackgroundColor is null.");
-        }
-
-        setSelectionBackgroundColor(GraphicsUtilities.decodeColor(selectionBackgroundColor));
+        setSelectionBackgroundColor(
+            GraphicsUtilities.decodeColor(selectionBackgroundColor, "selectionBackgroundColor"));
     }
 
     public final void setSelectionBackgroundColor(int selectionBackgroundColor) {
@@ -890,20 +849,15 @@ public class TerraTableViewSkin extends
     }
 
     public void setInactiveSelectionColor(Color inactiveSelectionColor) {
-        if (inactiveSelectionColor == null) {
-            throw new IllegalArgumentException("inactiveSelectionColor is null.");
-        }
+        Utils.checkNull(inactiveSelectionColor, "inactiveSelectionColor");
 
         this.inactiveSelectionColor = inactiveSelectionColor;
         repaintComponent();
     }
 
     public final void setInactiveSelectionColor(String inactiveSelectionColor) {
-        if (inactiveSelectionColor == null) {
-            throw new IllegalArgumentException("inactiveSelectionColor is null.");
-        }
-
-        setInactiveSelectionColor(GraphicsUtilities.decodeColor(inactiveSelectionColor));
+        setInactiveSelectionColor(
+            GraphicsUtilities.decodeColor(inactiveSelectionColor, "inactiveSelectionColor"));
     }
 
     public final void setInactiveSelectionColor(int inactiveSelectionColor) {
@@ -925,11 +879,8 @@ public class TerraTableViewSkin extends
     }
 
     public final void setInactiveSelectionBackgroundColor(String inactiveSelectionBackgroundColor) {
-        if (inactiveSelectionBackgroundColor == null) {
-            throw new IllegalArgumentException("inactiveSelectionBackgroundColor is null.");
-        }
-
-        setInactiveSelectionBackgroundColor(GraphicsUtilities.decodeColor(inactiveSelectionBackgroundColor));
+        setInactiveSelectionBackgroundColor(
+            GraphicsUtilities.decodeColor(inactiveSelectionBackgroundColor, "inactiveSelectionBackgroundColor"));
     }
 
     public final void setInactiveSelectionBackgroundColor(int inactiveSelectionBackgroundColor) {
@@ -942,20 +893,15 @@ public class TerraTableViewSkin extends
     }
 
     public void setHighlightBackgroundColor(Color highlightBackgroundColor) {
-        if (highlightBackgroundColor == null) {
-            throw new IllegalArgumentException("highlightBackgroundColor is null.");
-        }
+        Utils.checkNull(highlightBackgroundColor, "highlightBackgroundColor");
 
         this.highlightBackgroundColor = highlightBackgroundColor;
         repaintComponent();
     }
 
     public final void setHighlightBackgroundColor(String highlightBackgroundColor) {
-        if (highlightBackgroundColor == null) {
-            throw new IllegalArgumentException("highlightBackgroundColor is null.");
-        }
-
-        setHighlightBackgroundColor(GraphicsUtilities.decodeColor(highlightBackgroundColor));
+        setHighlightBackgroundColor(
+            GraphicsUtilities.decodeColor(highlightBackgroundColor, "highlightBackgroundColor"));
     }
 
     public final void setHighlightBackgroundColor(int highlightBackgroundColor) {
@@ -973,11 +919,8 @@ public class TerraTableViewSkin extends
     }
 
     public final void setAlternateRowBackgroundColor(String alternateRowBackgroundColor) {
-        if (alternateRowBackgroundColor == null) {
-            throw new IllegalArgumentException("alternateRowBackgroundColor is null.");
-        }
-
-        setAlternateRowBackgroundColor(GraphicsUtilities.decodeColor(alternateRowBackgroundColor));
+        setAlternateRowBackgroundColor(
+            GraphicsUtilities.decodeColor(alternateRowBackgroundColor, "alternateRowBackgroundColor"));
     }
 
     public final void setAlternateRowBackgroundColor(int alternateRowBackgroundColor) {
@@ -995,11 +938,7 @@ public class TerraTableViewSkin extends
     }
 
     public final void setColumnSelectionColor(String columnSelectionColor) {
-        if (columnSelectionColor == null) {
-            throw new IllegalArgumentException("columnSelectionColor is null.");
-        }
-
-        setColumnSelectionColor(GraphicsUtilities.decodeColor(columnSelectionColor));
+        setColumnSelectionColor(GraphicsUtilities.decodeColor(columnSelectionColor, "columnSelectionColor"));
     }
 
     public final void setColumnSelectionColor(int columnSelectionColor) {
@@ -1022,11 +961,8 @@ public class TerraTableViewSkin extends
 
     public final void setColumnSelectionHorizontalGridColor(
         String columnSelectionHorizontalGridColor) {
-        if (columnSelectionHorizontalGridColor == null) {
-            throw new IllegalArgumentException("columnSelectionHorizontalGridColor is null.");
-        }
-
-        setColumnSelectionHorizontalGridColor(GraphicsUtilities.decodeColor(columnSelectionHorizontalGridColor));
+        setColumnSelectionHorizontalGridColor(
+            GraphicsUtilities.decodeColor(columnSelectionHorizontalGridColor, "columnSelectionHorizontalGridColor"));
     }
 
     public final void setColumnSelectionHorizontalGridColor(int columnSelectionHorizontalGridColor) {
@@ -1048,11 +984,7 @@ public class TerraTableViewSkin extends
     }
 
     public final void setHorizontalGridColor(String horizontalGridColor) {
-        if (horizontalGridColor == null) {
-            throw new IllegalArgumentException("horizontalGridColor is null.");
-        }
-
-        setHorizontalGridColor(GraphicsUtilities.decodeColor(horizontalGridColor));
+        setHorizontalGridColor(GraphicsUtilities.decodeColor(horizontalGridColor, "horizontalGridColor"));
     }
 
     public final void setHorizontalGridColor(int horizontalGridColor) {
@@ -1074,11 +1006,7 @@ public class TerraTableViewSkin extends
     }
 
     public final void setVerticalGridColor(String verticalGridColor) {
-        if (verticalGridColor == null) {
-            throw new IllegalArgumentException("verticalGridColor is null.");
-        }
-
-        setVerticalGridColor(GraphicsUtilities.decodeColor(verticalGridColor));
+        setVerticalGridColor(GraphicsUtilities.decodeColor(verticalGridColor, "verticalGridColor"));
     }
 
     public final void setVerticalGridColor(int verticalGridColor) {

Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTreeViewSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTreeViewSkin.java?rev=1796710&r1=1796709&r2=1796710&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTreeViewSkin.java (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTreeViewSkin.java Mon May 29 22:19:29 2017
@@ -33,6 +33,7 @@ import org.apache.pivot.collections.List
 import org.apache.pivot.collections.Sequence;
 import org.apache.pivot.collections.Sequence.Tree.Path;
 import org.apache.pivot.util.Filter;
+import org.apache.pivot.util.Utils;
 import org.apache.pivot.util.Vote;
 import org.apache.pivot.wtk.Bounds;
 import org.apache.pivot.wtk.Button;
@@ -772,27 +773,17 @@ public class TerraTreeViewSkin extends C
     }
 
     public void setFont(Font font) {
-        if (font == null) {
-            throw new IllegalArgumentException("font is null.");
-        }
+        Utils.checkNull(font, "font");
 
         this.font = font;
         invalidateComponent();
     }
 
     public final void setFont(String font) {
-        if (font == null) {
-            throw new IllegalArgumentException("font is null.");
-        }
-
         setFont(decodeFont(font));
     }
 
     public final void setFont(Dictionary<String, ?> font) {
-        if (font == null) {
-            throw new IllegalArgumentException("font is null.");
-        }
-
         setFont(Theme.deriveFont(font));
     }
 
@@ -801,19 +792,13 @@ public class TerraTreeViewSkin extends C
     }
 
     public void setColor(Color color) {
-        if (color == null) {
-            throw new IllegalArgumentException("color is null.");
-        }
+        Utils.checkNull(color, "color");
 
         this.color = color;
         repaintComponent();
     }
 
     public void setColor(String color) {
-        if (color == null) {
-            throw new IllegalArgumentException("color is null.");
-        }
-
         setColor(GraphicsUtilities.decodeColor(color));
     }
 
@@ -827,20 +812,14 @@ public class TerraTreeViewSkin extends C
     }
 
     public void setDisabledColor(Color disabledColor) {
-        if (disabledColor == null) {
-            throw new IllegalArgumentException("disabledColor is null.");
-        }
+        Utils.checkNull(disabledColor, "disabledColor");
 
         this.disabledColor = disabledColor;
         repaintComponent();
     }
 
     public void setDisabledColor(String disabledColor) {
-        if (disabledColor == null) {
-            throw new IllegalArgumentException("disabledColor is null.");
-        }
-
-        setDisabledColor(GraphicsUtilities.decodeColor(disabledColor));
+        setDisabledColor(GraphicsUtilities.decodeColor(disabledColor, "disabledColor"));
     }
 
     public final void setDisabledColor(int disabledColor) {
@@ -853,16 +832,14 @@ public class TerraTreeViewSkin extends C
     }
 
     public void setBackgroundColor(Color backgroundColor) {
+        Utils.checkNull(backgroundColor, "backgroundColor");
+
         this.backgroundColor = backgroundColor;
         repaintComponent();
     }
 
     public void setBackgroundColor(String backgroundColor) {
-        if (backgroundColor == null) {
-            throw new IllegalArgumentException("backgroundColor is null.");
-        }
-
-        setBackgroundColor(GraphicsUtilities.decodeColor(backgroundColor));
+        setBackgroundColor(GraphicsUtilities.decodeColor(backgroundColor, "backgroundColor"));
     }
 
     public final void setBackgroundColor(int backgroundColor) {
@@ -875,20 +852,14 @@ public class TerraTreeViewSkin extends C
     }
 
     public void setSelectionColor(Color selectionColor) {
-        if (selectionColor == null) {
-            throw new IllegalArgumentException("selectionColor is null.");
-        }
+        Utils.checkNull(selectionColor, "selectionColor");
 
         this.selectionColor = selectionColor;
         repaintComponent();
     }
 
     public void setSelectionColor(String selectionColor) {
-        if (selectionColor == null) {
-            throw new IllegalArgumentException("selectionColor is null.");
-        }
-
-        setSelectionColor(GraphicsUtilities.decodeColor(selectionColor));
+        setSelectionColor(GraphicsUtilities.decodeColor(selectionColor, "selectionColor"));
     }
 
     public final void setSelectionColor(int selectionColor) {
@@ -901,20 +872,14 @@ public class TerraTreeViewSkin extends C
     }
 
     public void setSelectionBackgroundColor(Color selectionBackgroundColor) {
-        if (selectionBackgroundColor == null) {
-            throw new IllegalArgumentException("selectionBackgroundColor is null.");
-        }
+        Utils.checkNull(selectionBackgroundColor, "selectionBackgroundColor");
 
         this.selectionBackgroundColor = selectionBackgroundColor;
         repaintComponent();
     }
 
     public void setSelectionBackgroundColor(String selectionBackgroundColor) {
-        if (selectionBackgroundColor == null) {
-            throw new IllegalArgumentException("selectionBackgroundColor is null.");
-        }
-
-        setSelectionBackgroundColor(GraphicsUtilities.decodeColor(selectionBackgroundColor));
+        setSelectionBackgroundColor(GraphicsUtilities.decodeColor(selectionBackgroundColor, "selectionBackgroundColor"));
     }
 
     public final void setSelectionBackgroundColor(int selectionBackgroundColor) {
@@ -927,20 +892,14 @@ public class TerraTreeViewSkin extends C
     }
 
     public void setInactiveSelectionColor(Color inactiveSelectionColor) {
-        if (inactiveSelectionColor == null) {
-            throw new IllegalArgumentException("inactiveSelectionColor is null.");
-        }
+        Utils.checkNull(inactiveSelectionColor, "inactiveSelectionColor");
 
         this.inactiveSelectionColor = inactiveSelectionColor;
         repaintComponent();
     }
 
     public void setInactiveSelectionColor(String inactiveSelectionColor) {
-        if (inactiveSelectionColor == null) {
-            throw new IllegalArgumentException("inactiveSelectionColor is null.");
-        }
-
-        setInactiveSelectionColor(GraphicsUtilities.decodeColor(inactiveSelectionColor));
+        setInactiveSelectionColor(GraphicsUtilities.decodeColor(inactiveSelectionColor, "inactiveSelectionColor"));
     }
 
     public final void setInactiveSelectionColor(int inactiveSelectionColor) {
@@ -953,20 +912,15 @@ public class TerraTreeViewSkin extends C
     }
 
     public void setInactiveSelectionBackgroundColor(Color inactiveSelectionBackgroundColor) {
-        if (inactiveSelectionBackgroundColor == null) {
-            throw new IllegalArgumentException("inactiveSelectionBackgroundColor is null.");
-        }
+        Utils.checkNull(inactiveSelectionBackgroundColor, "inactiveSelectionBackgroundColor");
 
         this.inactiveSelectionBackgroundColor = inactiveSelectionBackgroundColor;
         repaintComponent();
     }
 
     public void setInactiveSelectionBackgroundColor(String inactiveSelectionBackgroundColor) {
-        if (inactiveSelectionBackgroundColor == null) {
-            throw new IllegalArgumentException("inactiveSelectionBackgroundColor is null.");
-        }
-
-        setInactiveSelectionBackgroundColor(GraphicsUtilities.decodeColor(inactiveSelectionBackgroundColor));
+        setInactiveSelectionBackgroundColor(
+            GraphicsUtilities.decodeColor(inactiveSelectionBackgroundColor, "inactiveSelectionBackgroundColor"));
     }
 
     public final void setInactiveSelectionBackgroundColor(int inactiveSelectionBackgroundColor) {
@@ -979,20 +933,14 @@ public class TerraTreeViewSkin extends C
     }
 
     public void setHighlightColor(Color highlightColor) {
-        if (highlightColor == null) {
-            throw new IllegalArgumentException("highlightColor is null.");
-        }
+        Utils.checkNull(highlightColor, "highlightColor");
 
         this.highlightColor = highlightColor;
         repaintComponent();
     }
 
     public void setHighlightColor(String highlightColor) {
-        if (highlightColor == null) {
-            throw new IllegalArgumentException("highlightColor is null.");
-        }
-
-        setHighlightColor(GraphicsUtilities.decodeColor(highlightColor));
+        setHighlightColor(GraphicsUtilities.decodeColor(highlightColor, "highlightColor"));
     }
 
     public final void setHighlightColor(int highlightColor) {
@@ -1005,20 +953,14 @@ public class TerraTreeViewSkin extends C
     }
 
     public void setHighlightBackgroundColor(Color highlightBackgroundColor) {
-        if (highlightBackgroundColor == null) {
-            throw new IllegalArgumentException("highlightBackgroundColor is null.");
-        }
+        Utils.checkNull(highlightBackgroundColor, "highlightBackgroundColor");
 
         this.highlightBackgroundColor = highlightBackgroundColor;
         repaintComponent();
     }
 
     public void setHighlightBackgroundColor(String highlightBackgroundColor) {
-        if (highlightBackgroundColor == null) {
-            throw new IllegalArgumentException("highlightBackgroundColor is null.");
-        }
-
-        setHighlightBackgroundColor(GraphicsUtilities.decodeColor(highlightBackgroundColor));
+        setHighlightBackgroundColor(GraphicsUtilities.decodeColor(highlightBackgroundColor, "highlightBackgroundColor"));
     }
 
     public final void setHighlightBackgroundColor(int highlightBackgroundColor) {
@@ -1031,17 +973,14 @@ public class TerraTreeViewSkin extends C
     }
 
     public void setSpacing(int spacing) {
-        if (spacing < 0) {
-            throw new IllegalArgumentException("spacing is negative.");
-        }
+        Utils.checkNonNegative(spacing, "spacing");
+
         this.spacing = spacing;
         invalidateComponent();
     }
 
     public void setSpacing(Number spacing) {
-        if (spacing == null) {
-            throw new IllegalArgumentException("spacing is null.");
-        }
+        Utils.checkNull(spacing, "spacing");
 
         setSpacing(spacing.intValue());
     }
@@ -1051,17 +990,14 @@ public class TerraTreeViewSkin extends C
     }
 
     public void setIndent(int indent) {
-        if (indent < 0) {
-            throw new IllegalArgumentException("indent is negative.");
-        }
+        Utils.checkNonNegative(indent, "indent");
+
         this.indent = indent;
         invalidateComponent();
     }
 
     public void setIndent(Number indent) {
-        if (indent == null) {
-            throw new IllegalArgumentException("indent is null.");
-        }
+        Utils.checkNull(indent, "indent");
 
         setIndent(indent.intValue());
     }
@@ -1098,20 +1034,14 @@ public class TerraTreeViewSkin extends C
     }
 
     public void setBranchControlColor(Color branchControlColor) {
-        if (branchControlColor == null) {
-            throw new IllegalArgumentException("branchControlColor is null.");
-        }
+        Utils.checkNull(branchControlColor, "branchControlColor");
 
         this.branchControlColor = branchControlColor;
         repaintComponent();
     }
 
     public void setBranchControlColor(String branchControlColor) {
-        if (branchControlColor == null) {
-            throw new IllegalArgumentException("branchControlColor is null.");
-        }
-
-        setBranchControlColor(GraphicsUtilities.decodeColor(branchControlColor));
+        setBranchControlColor(GraphicsUtilities.decodeColor(branchControlColor, "branchControlColor"));
     }
 
     public final void setBranchControlColor(int branchControlColor) {
@@ -1124,20 +1054,15 @@ public class TerraTreeViewSkin extends C
     }
 
     public void setBranchControlSelectionColor(Color branchControlSelectionColor) {
-        if (branchControlSelectionColor == null) {
-            throw new IllegalArgumentException("branchControlSelectionColor is null.");
-        }
+        Utils.checkNull(branchControlSelectionColor, "branchControlSelectionColor");
 
         this.branchControlSelectionColor = branchControlSelectionColor;
         repaintComponent();
     }
 
     public void setBranchControlSelectionColor(String branchControlSelectionColor) {
-        if (branchControlSelectionColor == null) {
-            throw new IllegalArgumentException("branchControlSelectionColor is null.");
-        }
-
-        setBranchControlSelectionColor(GraphicsUtilities.decodeColor(branchControlSelectionColor));
+        setBranchControlSelectionColor(
+            GraphicsUtilities.decodeColor(branchControlSelectionColor, "branchControlSelectionColor"));
     }
 
     public final void setBranchControlSelectionColor(int branchControlSelectionColor) {
@@ -1150,20 +1075,15 @@ public class TerraTreeViewSkin extends C
     }
 
     public void setBranchControlInactiveSelectionColor(Color branchControlInactiveSelectionColor) {
-        if (branchControlInactiveSelectionColor == null) {
-            throw new IllegalArgumentException("branchControlInactiveSelectionColor is null.");
-        }
+        Utils.checkNull(branchControlInactiveSelectionColor, "branchControlInactiveSelectionColor");
 
         this.branchControlInactiveSelectionColor = branchControlInactiveSelectionColor;
         repaintComponent();
     }
 
     public void setBranchControlInactiveSelectionColor(String branchControlInactiveSelectionColor) {
-        if (branchControlInactiveSelectionColor == null) {
-            throw new IllegalArgumentException("branchControlInactiveSelectionColor is null.");
-        }
-
-        setBranchControlInactiveSelectionColor(GraphicsUtilities.decodeColor(branchControlInactiveSelectionColor));
+        setBranchControlInactiveSelectionColor(
+            GraphicsUtilities.decodeColor(branchControlInactiveSelectionColor, "branchControlInactiveSelectionColor"));
     }
 
     public final void setBranchControlInactiveSelectionColor(int branchControlInactiveSelectionColor) {
@@ -1176,20 +1096,14 @@ public class TerraTreeViewSkin extends C
     }
 
     public void setGridColor(Color gridColor) {
-        if (gridColor == null) {
-            throw new IllegalArgumentException("gridColor is null.");
-        }
+        Utils.checkNull(gridColor, "gridColor");
 
         this.gridColor = gridColor;
         repaintComponent();
     }
 
     public void setGridColor(String gridColor) {
-        if (gridColor == null) {
-            throw new IllegalArgumentException("gridColor is null.");
-        }
-
-        setGridColor(GraphicsUtilities.decodeColor(gridColor));
+        setGridColor(GraphicsUtilities.decodeColor(gridColor, "gridColor"));
     }
 
     public final void setGridColor(int gridColor) {

Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraVFSBrowserSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraVFSBrowserSkin.java?rev=1796710&r1=1796709&r2=1796710&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraVFSBrowserSkin.java (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraVFSBrowserSkin.java Mon May 29 22:19:29 2017
@@ -676,7 +676,7 @@ public class TerraVFSBrowserSkin extends
             return sortDirection == SortDirection.ASCENDING ? new FileDateAscendingComparator()
                 : new FileDateDescendingComparator();
         } else {
-            throw new IllegalArgumentException();
+            throw new IllegalArgumentException("Invalid column name for file comparator.");
         }
     }