[kaffe] CVS kaffe (robilad): resynced with gnu classpath: swing fixes

Kaffe CVS cvs-commits at kaffe.org
Sun May 15 10:12:21 PDT 2005


PatchSet 6503 
Date: 2005/05/15 17:03:03
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
resynced with gnu classpath: swing fixes

2005-05-15  Dalibor Topic  <robilad at kaffe.org>

        Resynced with GNU Classpath.

        2005-04-25  Roman Kennke  <roman at kennke.org>

        * javax/swing/plaf/metal/MetalBorders.java:
        Added inner class ScrollPaneBorder.
        * javax/swing/plaf/metal/MetalLookAndFeel.java
        (initComponentDefaults): Added default for ScrollPane.border
        to use the new ScrollPaneBorder.

Members: 
	ChangeLog:1.4028->1.4029 
	libraries/javalib/javax/swing/plaf/metal/MetalBorders.java:1.2->1.3 
	libraries/javalib/javax/swing/plaf/metal/MetalLookAndFeel.java:1.9->1.10 
	libraries/javalib/javax/swing/tree/DefaultTreeSelectionModel.java:1.8->1.9 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4028 kaffe/ChangeLog:1.4029
--- kaffe/ChangeLog:1.4028	Sun May 15 16:53:48 2005
+++ kaffe/ChangeLog	Sun May 15 17:03:03 2005
@@ -2,6 +2,18 @@
 
 	Resynced with GNU Classpath.
 
+	2005-04-25  Roman Kennke  <roman at kennke.org>
+
+        * javax/swing/plaf/metal/MetalBorders.java:
+        Added inner class ScrollPaneBorder.
+        * javax/swing/plaf/metal/MetalLookAndFeel.java
+        (initComponentDefaults): Added default for "ScrollPane.border"
+        to use the new ScrollPaneBorder.
+
+2005-05-15  Dalibor Topic  <robilad at kaffe.org>
+
+	Resynced with GNU Classpath.
+
 	2005-05-01  Mark Wielaard  <mark at klomp.org>
 
         * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c:
Index: kaffe/libraries/javalib/javax/swing/plaf/metal/MetalBorders.java
diff -u kaffe/libraries/javalib/javax/swing/plaf/metal/MetalBorders.java:1.2 kaffe/libraries/javalib/javax/swing/plaf/metal/MetalBorders.java:1.3
--- kaffe/libraries/javalib/javax/swing/plaf/metal/MetalBorders.java:1.2	Sat Apr 23 11:10:52 2005
+++ kaffe/libraries/javalib/javax/swing/plaf/metal/MetalBorders.java	Sun May 15 17:03:07 2005
@@ -184,6 +184,82 @@
   }
 
   /**
+   * A border for JScrollPanes.
+   */
+  public static class ScrollPaneBorder
+    extends AbstractBorder
+    implements UIResource
+  {
+    /** The border insets. */
+    private static Insets insets = new Insets(1, 1, 2, 2);
+    
+    /**
+     * Constructs a new ScrollPaneBorder.
+     */
+    public ScrollPaneBorder()
+    {
+    }
+    
+    /**
+     * Returns the insets of the border for the Component <code>c</code>.
+     *
+     * @param c the Component for which we return the border insets
+     */
+    public Insets getBorderInsets(Component c)
+    {
+      return insets;
+    }
+
+    /**
+     * Paints the border.
+     *
+     * @param c the Component for which the border is painted
+     * @param g the Graphics context
+     * @param x the X coordinate of the upper left corner of the border
+     * @param y the Y coordinate of the upper left corner of the border
+     * @param w the width of the border
+     * @param h the height of the border
+     */
+    public void paintBorder(Component c, Graphics g, int x, int y,
+                            int w, int h)
+    {
+      Color darkShadow = MetalLookAndFeel.getControlDarkShadow();
+      Color shadow = MetalLookAndFeel.getControlShadow();
+      Color light = MetalLookAndFeel.getWhite();
+      Color middle = MetalLookAndFeel.getControl();
+
+      // paint top border line
+      g.setColor(darkShadow);
+      g.drawLine(x, y, x + w - 2, y);
+
+      // paint left border line
+      g.drawLine(x, y, x, y + h - 2);
+ 
+      // paint right inner border line
+      g.drawLine(x + w - 2, y, x + w - 2, y + h + 1);
+
+      // paint bottom inner border line
+      g.drawLine(x + 2, y + h - 2, x + w - 2, y + h - 2);
+
+      // draw right outer border line
+      g.setColor(light);
+      g.drawLine(x + w - 1, y, x + w - 1, y + h - 1);
+
+      // draw bottom outer border line
+      g.drawLine(x, y + h - 1, x + w - 1, y + h - 1);
+
+      // paint the lighter points
+      g.setColor(middle);
+      g.drawLine(x + w - 1, y, x + w - 1, y);
+      g.drawLine(x + w - 2, y + 2, x + w - 2, y + 2);
+      g.drawLine(x, y + h - 1, x, y + h - 1);
+      g.drawLine(x + 1, y + h - 2, x + 1, y + h - 2);
+
+    }
+    
+  }
+  
+  /**
    * This border is used in Toolbar buttons as inner border.
    */
   static class RolloverMarginBorder extends AbstractBorder
Index: kaffe/libraries/javalib/javax/swing/plaf/metal/MetalLookAndFeel.java
diff -u kaffe/libraries/javalib/javax/swing/plaf/metal/MetalLookAndFeel.java:1.9 kaffe/libraries/javalib/javax/swing/plaf/metal/MetalLookAndFeel.java:1.10
--- kaffe/libraries/javalib/javax/swing/plaf/metal/MetalLookAndFeel.java:1.9	Sun May 15 11:20:50 2005
+++ kaffe/libraries/javalib/javax/swing/plaf/metal/MetalLookAndFeel.java	Sun May 15 17:03:07 2005
@@ -482,6 +482,7 @@
       "Slider.background", new ColorUIResource(getControl()),
       "OptionPane.background", new ColorUIResource(getControl()),
       "ProgressBar.background", new ColorUIResource(getControl()),
+      "ScrollPane.border", new MetalBorders.ScrollPaneBorder(),
       "TabbedPane.background", new ColorUIResource(getControl()),
       "Label.background", new ColorUIResource(getControl()),
       "Label.font", getControlTextFont(),
Index: kaffe/libraries/javalib/javax/swing/tree/DefaultTreeSelectionModel.java
diff -u kaffe/libraries/javalib/javax/swing/tree/DefaultTreeSelectionModel.java:1.8 kaffe/libraries/javalib/javax/swing/tree/DefaultTreeSelectionModel.java:1.9
--- kaffe/libraries/javalib/javax/swing/tree/DefaultTreeSelectionModel.java:1.8	Sun May 15 10:13:31 2005
+++ kaffe/libraries/javalib/javax/swing/tree/DefaultTreeSelectionModel.java	Sun May 15 17:03:07 2005
@@ -231,9 +231,9 @@
    *
    * @param path the path to set as selection
    */
-  public void setSelectionPath(TreePath value0)
+  public void setSelectionPath(TreePath path)
   {
-    // TODO
+    selection = new TreePath[] { path };
   }
 
   /**




More information about the kaffe mailing list