summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--javax/swing/border/CompoundBorder.java22
2 files changed, 21 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 7235a4547..fb6bc58f3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,15 @@
2006-12-06 Tania Bento <tbento@redhat.com>
* 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 <tbento@redhat.com>
+
+ * javax/swing/border/CompoundBorder.java:
(isBorderOpaque): If inside and outside border both have a null
value, return true.
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();
}
/**