Index: src/main/java/common/javax/swing/border/BevelBorder.java =================================================================== --- src/main/java/common/javax/swing/border/BevelBorder.java (revision 503484) +++ src/main/java/common/javax/swing/border/BevelBorder.java (working copy) @@ -24,8 +24,8 @@ import java.awt.Component; import java.awt.Graphics; import java.awt.Insets; -import java.security.InvalidParameterException; + public class BevelBorder extends AbstractBorder { public static final int RAISED = 0; @@ -41,29 +41,22 @@ protected Color shadowOuter; public BevelBorder(final int bevelType) { - setBevelType(bevelType); + this.bevelType = bevelType; } public BevelBorder(final int bevelType, final Color highlightOuterColor, final Color highlightInnerColor, final Color shadowOuterColor, final Color shadowInnerColor) { + this(bevelType); + if (highlightOuterColor == null || highlightInnerColor == null || shadowOuterColor == null || shadowInnerColor == null) { throw new NullPointerException("Color should not be null"); } - - setBevelType(bevelType); highlightOuter = highlightOuterColor; highlightInner = highlightInnerColor; shadowOuter = shadowOuterColor; shadowInner = shadowInnerColor; } - private void setBevelType(final int bevelType) { - if (bevelType != RAISED && bevelType != LOWERED) { - throw new InvalidParameterException("Incorrect type of the bevel border"); - } - this.bevelType = bevelType; - } - public BevelBorder(final int bevelType, final Color highlight, final Color shadow) { this(bevelType, highlight, highlight, shadow, shadow); }