From 4434aab4fd7acec931989196a39dcc4d04005512 Mon Sep 17 00:00:00 2001 From: Tania Bento Date: Wed, 6 Dec 2006 18:29:26 +0000 Subject: 2006-12-06 Tania Bento * javax/swing/border/CompoundBorder.java: (isBorderOpaque): If inside border is null, return true if outside border is opaque, false otherwise; if outside border is null, return true if inside border is opaque, false otherwise; if inside or outside border are both not null, then return true only if both the inside and outside border are opaque, false otherwise. --- ChangeLog | 9 +++++++++ javax/swing/border/CompoundBorder.java | 22 ++++++++++++---------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7235a4547..fb6bc58f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-12-06 Tania Bento + + * javax/swing/border/CompoundBorder.java: + (isBorderOpaque): If inside border is null, return true if outside + border is opaque, false otherwise; if outside border is null, return + true if inside border is opaque, false otherwise; if inside or + outside border are both not null, then return true only if both the + inside and outside border are opaque, false otherwise. + 2006-12-06 Tania Bento * javax/swing/border/CompoundBorder.java: diff --git a/javax/swing/border/CompoundBorder.java b/javax/swing/border/CompoundBorder.java index 63a9a553d..ba2e745aa 100644 --- a/javax/swing/border/CompoundBorder.java +++ b/javax/swing/border/CompoundBorder.java @@ -121,16 +121,18 @@ public class CompoundBorder extends AbstractBorder // the inside or outside borders are null, then true is returned. if ((insideBorder == null) && (outsideBorder == null)) return true; - - // While it would be safe to assume true for the opacity of - // a null border, this behavior would not be according to - // the API specification. Also, it is pathological to have - // null borders anyway. - if ((insideBorder == null) || (outsideBorder == null)) - return false; - - return insideBorder.isBorderOpaque() - && outsideBorder.isBorderOpaque(); + + // A mauve test shows that if the inside border has a null value, + // then true is returned if the outside border is opaque; if the + // outside border has a null value, then true is returned if the + // inside border is opaque; else, true is returned if both the + // inside and outside borders are opaque. + if (insideBorder == null) + return outsideBorder.isBorderOpaque(); + else if (outsideBorder == null) + return insideBorder.isBorderOpaque(); + else + return insideBorder.isBorderOpaque() && outsideBorder.isBorderOpaque(); } /** -- cgit v1.2.1