This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FYI:Patch: javax.swing.border merge


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi list,


I commited the attached patch to merge javax.swing.border with 
classpath again.


Michael
- -- 
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+36HkWSOgCCdjSDsRAsn5AKCChZQcMQ14JX6nbXAN57k97lhUJgCeLmxo
BGfijWlVWWVSk8lQkKXqg0Y=
=9gLY
-----END PGP SIGNATURE-----
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libjava/ChangeLog,v
retrieving revision 1.1914
diff -u -b -B -r1.1914 ChangeLog
--- ChangeLog	5 Jun 2003 17:57:30 -0000	1.1914
+++ ChangeLog	5 Jun 2003 19:57:27 -0000
@@ -1,3 +1,15 @@
+2003-06-05  Michael Koch  <konqueror@gmx.de>
+
+	* javax/swing/border/AbstractBorder.java,
+	javax/swing/border/BevelBorder.java,
+	javax/swing/border/CompoundBorder.java,
+	javax/swing/border/EmptyBorder.java,
+	javax/swing/border/EtchedBorder.java,
+	javax/swing/border/LineBorder.java,
+	javax/swing/border/MatteBorder.java,
+	javax/swing/border/TitledBorder.java:
+	New versions from Classpath.
+
 2003-06-05  Scott Gilbertson  <scottg@mantatest.com>
 
 	* java/text/SimpleDateFormat.java (SimpleDateFormat): Added
Index: javax/swing/border/AbstractBorder.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/border/AbstractBorder.java,v
retrieving revision 1.2
diff -u -b -B -r1.2 AbstractBorder.java
--- javax/swing/border/AbstractBorder.java	31 Mar 2003 06:30:00 -0000	1.2
+++ javax/swing/border/AbstractBorder.java	5 Jun 2003 19:57:27 -0000
@@ -35,16 +35,20 @@
 obligated to do so.  If you do not wish to do so, delete this
 exception statement from your version. */
 
+
 package javax.swing.border;
 
-import java.io.*;
-import java.awt.*; 
+import java.awt.Component;
+import java.awt.Graphics;
+import java.awt.Insets;
+import java.awt.Rectangle;
+import java.io.Serializable;
 
 public abstract class AbstractBorder implements Border, Serializable
 {
   static final long serialVersionUID = -545885975315191844L;
 
-    AbstractBorder()
+  public AbstractBorder ()
     {
     }
 
Index: javax/swing/border/BevelBorder.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/border/BevelBorder.java,v
retrieving revision 1.1
diff -u -b -B -r1.1 BevelBorder.java
--- javax/swing/border/BevelBorder.java	9 Aug 2002 04:26:11 -0000	1.1
+++ javax/swing/border/BevelBorder.java	5 Jun 2003 19:57:27 -0000
@@ -37,16 +37,41 @@
 
 package javax.swing.border;
 
-import java.awt.*;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Graphics;
 
-public class BevelBorder extends EmptyBorder
+public class BevelBorder extends AbstractBorder
 {
-    Color c;
+  public static final int LOWERED = 1;
+  public static final int RAISED = 0;
 
-    public BevelBorder()
+  protected int bevelType;
+  protected Color highlightOuter;
+  protected Color highlightInner;
+  protected Color shadowOuter;
+  protected Color shadowInner;
+
+  public BevelBorder (int bevelType)
+  {
+    this (bevelType, null, null, null, null);
+  }
+
+  public BevelBorder(int bevelType, Color highlight, Color shadow)
     {
+    this (bevelType, highlight, highlight, shadow, shadow);
     }
 
+  public BevelBorder (int bevelType, Color highlightOuter,
+                      Color highlightInner, Color shadowOuter,
+                      Color shadowInner)
+  {
+    this.bevelType = bevelType;
+    this.highlightOuter = highlightOuter;
+    this.highlightInner = highlightInner;
+    this.shadowOuter = shadowOuter;
+    this.shadowInner = shadowInner;
+  }
     
     public BevelBorder(int top,
 		int left,
Index: javax/swing/border/CompoundBorder.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/border/CompoundBorder.java,v
retrieving revision 1.1
diff -u -b -B -r1.1 CompoundBorder.java
--- javax/swing/border/CompoundBorder.java	9 Aug 2002 04:26:11 -0000	1.1
+++ javax/swing/border/CompoundBorder.java	5 Jun 2003 19:57:27 -0000
@@ -35,12 +35,28 @@
 obligated to do so.  If you do not wish to do so, delete this
 exception statement from your version. */
 
+
 package javax.swing.border;
 
-import java.awt.*;
+import java.awt.Component;
+import java.awt.Graphics;
+import java.awt.Insets;
 
 public class CompoundBorder extends AbstractBorder
 {
+  protected Border insideBorder;
+  protected Border outsideBorder;
+
+  public CompoundBorder ()
+  {
+    this (null, null);
+  }
+
+  public CompoundBorder (Border outsideBorder, Border insideBorder)
+  {
+    this.outsideBorder = outsideBorder;
+    this.insideBorder = insideBorder;
+  }
     
     public Insets getBorderInsets(Component  c,
 				  Insets s)
Index: javax/swing/border/EmptyBorder.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/border/EmptyBorder.java,v
retrieving revision 1.1
diff -u -b -B -r1.1 EmptyBorder.java
--- javax/swing/border/EmptyBorder.java	9 Aug 2002 04:26:11 -0000	1.1
+++ javax/swing/border/EmptyBorder.java	5 Jun 2003 19:57:27 -0000
@@ -35,13 +35,33 @@
 obligated to do so.  If you do not wish to do so, delete this
 exception statement from your version. */
 
-package javax.swing.border;
 
-import java.awt.*;
+package javax.swing.border;
 
+import java.awt.Component;
+import java.awt.Graphics;
+import java.awt.Insets;
 
 public class EmptyBorder extends AbstractBorder
 {
+  protected int left;
+  protected int right;
+  protected int bottom;
+  protected int top;
+
+  public EmptyBorder (Insets borderInsets)
+  {
+    this (borderInsets.left, borderInsets.right,
+          borderInsets.top, borderInsets.bottom);
+  }
+
+  public EmptyBorder (int left, int right, int top, int bottom)
+  {
+    this.left = left;
+    this.right = right;
+    this.top = top;
+    this.bottom = bottom;
+  }
     
     protected int l,r,b,t;
 
Index: javax/swing/border/EtchedBorder.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/border/EtchedBorder.java,v
retrieving revision 1.1
diff -u -b -B -r1.1 EtchedBorder.java
--- javax/swing/border/EtchedBorder.java	9 Aug 2002 04:26:11 -0000	1.1
+++ javax/swing/border/EtchedBorder.java	5 Jun 2003 19:57:27 -0000
@@ -35,18 +35,43 @@
 obligated to do so.  If you do not wish to do so, delete this
 exception statement from your version. */
 
+
 package javax.swing.border;
 
-import java.awt.*;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Graphics;
 
-public class EtchedBorder extends EmptyBorder
+public class EtchedBorder extends AbstractBorder
 {
-    Color c;
+  public static final int LOWERED = 1;
+  public static final int RAISED = 0;
+    
+  protected int etchType;
+  protected Color highlight;
+  protected Color shadow;
+
+  public EtchedBorder ()
+  {
+    this (LOWERED, null, null);
+  }
 
-    public EtchedBorder()
+  public EtchedBorder (Color highlight, Color shadow)
     {
+    this (LOWERED, highlight, shadow);
     }
 
+  public EtchedBorder (int etchType)
+  {
+    this (etchType, null, null);
+  }
+
+  public EtchedBorder (int etchType, Color highlight, Color shadow)
+  {
+    this.etchType = etchType;
+    this.highlight = highlight;
+    this.shadow = shadow;
+  }
     
     public EtchedBorder(int top,
 		int left,
Index: javax/swing/border/LineBorder.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/border/LineBorder.java,v
retrieving revision 1.1
diff -u -b -B -r1.1 LineBorder.java
--- javax/swing/border/LineBorder.java	9 Aug 2002 04:26:11 -0000	1.1
+++ javax/swing/border/LineBorder.java	5 Jun 2003 19:57:27 -0000
@@ -35,18 +35,38 @@
 obligated to do so.  If you do not wish to do so, delete this
 exception statement from your version. */
 
+
 package javax.swing.border;
 
-import java.awt.*;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Graphics;
 
-public class LineBorder extends EmptyBorder
+public class LineBorder extends AbstractBorder
 {
-    Color c;
+  protected Color lineColor;
+  protected boolean roundedCorners;
+  protected int thickness;
+
+  public LineBorder (Color color)
+  {
+    this (color, 1);
+  }
 
-    public LineBorder()
+  public LineBorder (Color color, int thickness)
     {
+    this (color, thickness, false); // FIXME: check roundedCorners argument
     }
 
+  /**
+   * @since 1.3
+   */
+  public LineBorder (Color color, int thickness, boolean roundedCorners)
+  {
+    this.lineColor = color;
+    this.thickness = thickness;
+    this.roundedCorners = roundedCorners;
+  }
     
     public LineBorder(int top,
 		int left,
Index: javax/swing/border/MatteBorder.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/border/MatteBorder.java,v
retrieving revision 1.1
diff -u -b -B -r1.1 MatteBorder.java
--- javax/swing/border/MatteBorder.java	9 Aug 2002 04:26:11 -0000	1.1
+++ javax/swing/border/MatteBorder.java	5 Jun 2003 19:57:27 -0000
@@ -35,18 +35,49 @@
 obligated to do so.  If you do not wish to do so, delete this
 exception statement from your version. */
 
+
 package javax.swing.border;
 
-import java.awt.*;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Graphics;
+import java.awt.Insets;
+import javax.swing.Icon;
 
 public class MatteBorder extends EmptyBorder
 {
-    Color c;
+  protected Color color;
+  protected Icon tileIcon;
+
+  public MatteBorder (Icon tileIcon)
+  {
+    // FIXME: implement this
+    this (null, tileIcon);
+  }
+
+  public MatteBorder (Insets borderInsets, Color color)
+  {
+    this (borderInsets.top, borderInsets.left, borderInsets.bottom,
+          borderInsets.right, color);
+  }
+
+  public MatteBorder (Insets borderInsets, Icon tileIcon)
+  {
+    this (borderInsets.top, borderInsets.left, borderInsets.bottom,
+          borderInsets.right, tileIcon);
+  }
 
-    public MatteBorder()
+  public MatteBorder (int top, int left, int bottom, int right, Icon tileIcon)
     {
+    super (top, left, bottom, right);
+    this.tileIcon = tileIcon;
     }
 
+  public MatteBorder (int top, int left, int bottom, int right, Color color)
+  {
+    super (top, left, bottom, right);
+    this.color = color;
+  }
     
     public MatteBorder(int top,
 		int left,
Index: javax/swing/border/TitledBorder.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/border/TitledBorder.java,v
retrieving revision 1.1
diff -u -b -B -r1.1 TitledBorder.java
--- javax/swing/border/TitledBorder.java	9 Aug 2002 04:26:11 -0000	1.1
+++ javax/swing/border/TitledBorder.java	5 Jun 2003 19:57:27 -0000
@@ -35,12 +35,89 @@
 obligated to do so.  If you do not wish to do so, delete this
 exception statement from your version. */
 
+
 package javax.swing.border;
 
-import java.awt.*;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.Graphics;
+import java.awt.Insets;
 
 public class TitledBorder extends AbstractBorder
 {
+  public static final int ABOVE_BOTTOM = 4;
+  public static final int ABOVE_TOP = 1;
+  public static final int BELOW_BOTTOM = 6;
+  public static final int BELOW_TOP = 3;
+  public static final int BOTTOM = 5;
+  public static final int CENTER = 2;
+  public static final int DEFAULT_JUSTIFICATION = 0;
+  public static final int DEFAULT_POSITION = 0;
+  public static final int LEADING = 4;
+  public static final int LEFT = 1;
+  public static final int RIGHT = 3;
+  public static final int TOP = 2;
+  public static final int TRAILING = 5;
+
+  protected static final int EDGE_SPACING = 2;
+  protected static final int TEXT_INSET_H = 5;
+  protected static final int TEXT_SPACING = 2;
+
+  protected Border border;
+  protected String title;
+  protected Color titleColor;
+  protected Font titleFont;
+  protected int titleJustification;
+  protected int titlePosition;
+
+  private static Border defaultBorder = new BorderUIRessource ();
+  private static Font defaultFont = new FontUIRessource ("Dialog", BOLD, 12);
+  private static Color defaultColor = new ColorUIRessource (Color.black);
+  
+  public TitledBorder (String title)
+  {
+    this (defaultBorder, title, DEFAULT_JUSTIFICATION, DEFAULT_POSITION,
+	  defaultFont, defaultColor);
+  }
+
+  public TitledBorder (Border border)
+  {
+    this (border, "", DEFAULT_JUSTIFICATION, DEFAULT_POSITION, defaultFont,
+	  defaultColor);
+  }
+  
+  public TitledBorder (Border border, String title)
+  {
+    this (border, title, DEFAULT_JUSTIFICATION, DEFAULT_POSITION, defaultFont,
+	  defaultColor);
+  }
+  
+  public TitledBorder (Border border, String title, int titleJustification,
+                       int titlePosition)
+  {
+    this (border, title, titleJustification, titlePosition, defaultFont,
+	  defaultColor);
+  }
+  
+  public TitledBorder (Border border, String title, int titleJustification,
+                       int titlePosition, Font titleFont)
+  {
+    this (border, title, titleJustification, titlePosition, titleFont,
+	  defaultColor);
+  }
+  
+  public TitledBorder (Border border, String title, int titleJustification,
+                       int titlePosition, Font titleFont, Color titleColor)
+  {
+    this.border = border;
+    this.title = title;
+    this.titleJustification = titleJustification;
+    this.titlePosition = titlePosition;
+    this.titleFont = titleFont;
+    this.titleColor = titleColor;
+  }
     
     public Insets getBorderInsets(Component  c,
 				  Insets s)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]