AbstractBorder.java, [...]: New versions from Classpath.
authorMichael Koch <konqueror@gmx.de>
Thu, 5 Jun 2003 19:59:44 +0000 (19:59 +0000)
committerMichael Koch <mkoch@gcc.gnu.org>
Thu, 5 Jun 2003 19:59:44 +0000 (19:59 +0000)
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.

From-SVN: r67507

libjava/ChangeLog
libjava/javax/swing/border/AbstractBorder.java
libjava/javax/swing/border/BevelBorder.java
libjava/javax/swing/border/CompoundBorder.java
libjava/javax/swing/border/EmptyBorder.java
libjava/javax/swing/border/EtchedBorder.java
libjava/javax/swing/border/LineBorder.java
libjava/javax/swing/border/MatteBorder.java
libjava/javax/swing/border/TitledBorder.java

index 5b8e96e277fbeb975fa7cd9259eccd8f70f80c13..52c7762043166c5392541b713aff04129a256706 100644 (file)
@@ -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  Michael Koch  <konqueror@gmx.de>
 
        * java/awt/Button.java,
index d0285b33a5cc57b39ba2ab3dc4e02339b7b32794..fad3aa288ef53284470164d73cb594d7d9bc13a8 100644 (file)
@@ -35,18 +35,22 @@ this exception to your version of the library, but you are not
 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 ()
+  {
+  }
 
     public void paintBorder(Component c,
                            Graphics g,
index ef2c279fa715826cc08634c064ec596cd8de0fa5..44da5b4e1636e198c55c8bbb071dbb16fab9be19 100644 (file)
@@ -37,17 +37,42 @@ 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 BevelBorder extends EmptyBorder
+public class BevelBorder extends AbstractBorder
 {
-    Color c;
+  public static final int LOWERED = 1;
+  public static final int RAISED = 0;
+    
+  protected int bevelType;
+  protected Color highlightOuter;
+  protected Color highlightInner;
+  protected Color shadowOuter;
+  protected Color shadowInner;
 
-    public BevelBorder()
-    {
-    }
+  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,
                int bottom, 
index a1e731e17cfcc57ae1d2f6ff45453eeb34ee63fe..bf6a8caaefe5dfe31c721b3cf7c9e96e8c5acc37 100644 (file)
@@ -35,12 +35,28 @@ this exception to your version of the library, but you are not
 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 c09a0affc407164e431f7e7e7a1cc6156c4ad36c..679c56fcae07fc5df3eb32429150e17b6346a530 100644 (file)
@@ -35,13 +35,33 @@ this exception to your version of the library, but you are not
 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 97e5099d1a4446c29d705a42d22c495ede64599d..33c5073b18239a3bd24af210865dc2a40116a9cd 100644 (file)
@@ -35,18 +35,43 @@ this exception to your version of the library, but you are not
 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()
-    {
-    }
+  public EtchedBorder ()
+  {
+    this (LOWERED, null, null);
+  }
+
+  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 7f3c651166856f1ad93bb8ea8596e3fa59c83188..ba6c060810eb60c5a8a94ffb8fcb128773c738f8 100644 (file)
@@ -35,18 +35,38 @@ this exception to your version of the library, but you are not
 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()
-    {
-    }
+  public LineBorder (Color color)
+  {
+    this (color, 1);
+  }
+
+  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 30e5f59e14e957fcca86abfb921569ec2daa5905..9f1ed938a300a4ddb0281dc50694eecf3e9a2a9e 100644 (file)
@@ -35,18 +35,49 @@ this exception to your version of the library, but you are not
 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()
-    {
-    }
+  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 (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 5937aa4c0adb8ede39754aedc7555dc5ceec7643..8a16c1a0b7910596b7e6014de90b1b2532adcba0 100644 (file)
@@ -35,12 +35,89 @@ this exception to your version of the library, but you are not
 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)