summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTania Bento <tbento@redhat.com>2006-12-06 18:29:26 +0000
committerTania Bento <tbento@redhat.com>2006-12-06 18:29:26 +0000
commit4434aab4fd7acec931989196a39dcc4d04005512 (patch)
tree60e8c784b0e42d0bccc51252079616cc13cec88d
parent71c112823abe2e15cdf8dbc25f9e420553a31252 (diff)
downloadclasspath-4434aab4fd7acec931989196a39dcc4d04005512.tar.gz
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.
-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();
}
/**