I added and fixed some stuff in MetalBorders.
2005-09-20 Roman Kennke <[EMAIL PROTECTED]>
* javax/swing/plaf/metal/MetalBorders.java
(ButtonBorder.paintBorder): Fetch correct color for disabled
button border.
(getTextFieldBorder): Correctly initialize text field border. This
should be a compound border with a MarginBorder and TextFieldBorder
instead of a plain TextFieldBorder.
(getTextBorder): New method.
/Roman
Index: javax/swing/plaf/metal/MetalBorders.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/metal/MetalBorders.java,v
retrieving revision 1.16
diff -u -r1.16 MetalBorders.java
--- javax/swing/plaf/metal/MetalBorders.java 16 Sep 2005 08:58:01 -0000 1.16
+++ javax/swing/plaf/metal/MetalBorders.java 20 Sep 2005 09:25:58 -0000
@@ -44,6 +44,7 @@
import java.awt.Insets;
import javax.swing.AbstractButton;
+import javax.swing.BorderFactory;
import javax.swing.ButtonModel;
import javax.swing.JInternalFrame;
import javax.swing.JMenu;
@@ -84,6 +85,11 @@
private static Border textFieldBorder;
/**
+ * The shared instance for getTextBorder().
+ */
+ private static Border textBorder;
+
+ /**
* A MarginBorder that gets shared by multiple components.
* Created on demand by the private helper function [EMAIL PROTECTED]
* #getMarginBorder()}.
@@ -166,11 +172,11 @@
}
}
else
- {
- // draw disabled border
- g.setColor(MetalLookAndFeel.getControlDisabled());
- g.drawRect(x, y, w - 2, h - 2);
- }
+ {
+ // draw disabled border
+ g.setColor(MetalLookAndFeel.getInactiveControlTextColor());
+ g.drawRect(x, y, w - 2, h - 2);
+ }
}
/**
@@ -1147,8 +1153,32 @@
public static Border getTextFieldBorder()
{
if (textFieldBorder == null)
- textFieldBorder = new TextFieldBorder();
+ {
+ Border inner = getMarginBorder();
+ Border outer = new TextFieldBorder();
+ textFieldBorder = BorderFactory.createCompoundBorder(outer, inner);
+ }
return textFieldBorder;
+ }
+
+ /**
+ * Returns the border that is used for text components (except text fields,
+ * which use [EMAIL PROTECTED] #getTextFieldBorder}.
+ *
+ * @return the border that is used for text components
+ *
+ * @since 1.3
+ */
+ public static Border getTextBorder()
+ {
+ if (textBorder == null)
+ {
+ Border inner = getMarginBorder();
+ Border outer = new Flush3DBorder();
+ textBorder =
+ new BorderUIResource.CompoundBorderUIResource(outer, inner);
+ }
+ return textBorder;
}
/**
_______________________________________________
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches