This is the mail archive of the java-patches@sources.redhat.com 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]

Patch: GridBagConstraints


Here's another AWT class that I wrote the other day.

2000-12-06  Tom Tromey  <tromey@redhat.com>

	* Makefile.in: Rebuilt.
	* Makefile.am (awt_java_source_files): Added new file.
	* java/awt/GridBagConstraints.java: New file.

Tom

Index: Makefile.am
===================================================================
RCS file: /cvs/java/libgcj/libjava/Makefile.am,v
retrieving revision 1.115
diff -u -r1.115 Makefile.am
--- Makefile.am	2000/12/03 21:21:51	1.115
+++ Makefile.am	2000/12/06 21:17:32
@@ -592,6 +592,7 @@
 java/awt/Graphics.java \
 java/awt/Graphics2D.java \
 java/awt/GraphicsConfiguration.java \
+java/awt/GridBagConstraints.java \
 java/awt/GridLayout.java \
 java/awt/IllegalComponentStateException.java \
 java/awt/Image.java \
Index: java/awt/GridBagConstraints.java
===================================================================
RCS file: GridBagConstraints.java
diff -N GridBagConstraints.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ GridBagConstraints.java	Wed Dec  6 13:17:32 2000
@@ -0,0 +1,89 @@
+// GridBagConstraints.java - Constraints for GridBag layout manager
+
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
+details.  */
+
+package java.awt;
+
+import java.io.Serializable;
+
+/** This specifies the constraints for a component managed by the
+ * GridBagLayout layout manager.  */
+public class GridBagConstraints implements Cloneable, Serializable
+{
+  /** Fill in both directions.  */
+  public static final int BOTH;
+  /** Don't fill.  */
+  public static final int NONE;
+  /** Fill horizontally.  */
+  public static final int HORIZONTAL;
+  /** Fill vertically.  */
+  public static final int VERTICAL;
+
+  /** Position in the center.  */
+  public static final int CENTER;
+  /** Position to the east.  */
+  public static final int EAST;
+  /** Position to the north.  */
+  public static final int NORTH;
+  /** Position to the northeast.  */
+  public static final int NORTHEAST;
+  /** Position to the northwest.  */
+  public static final int NORTHWEST;
+  /** Position to the south.  */
+  public static final int SOUTH;
+  /** Position to the southeast.  */
+  public static final int SOUTHEAST;
+  /** Position to the southwest.  */
+  public static final int SOUTHWEST;
+  /** Position to the west.  */
+  public static final int WEST;
+
+  /** Occupy all remaining cells except last cell.  */
+  public static final int RELATIVE;
+  /** Occupy all remaining cells.  */
+  public static final int REMAINDER;
+
+  public int anchor;
+  public int fill;
+  public int gridheight;
+  public int gridwidth;
+  public int gridx;
+  public int gridy;
+  public Insets insets;
+  public int ipadx;
+  public int ipady;
+  public double weightx;
+  public double weighty;
+
+  /** Create a copy of this object.  */
+  public Object clone ()
+  {
+    // This is lazy but it works.
+    GridBagConstraints g = (GridBagConstraints) super.clone ();
+    g.insets = (Insets) insets.clone ();
+    return g;
+  }
+
+  /** Create a new GridBagConstraints object with the default
+   * parameters.  */
+  public GridBagConstraints ()
+  {
+    this.anchor = CENTER;
+    this.fill = NONE;
+    this.gridx = RELATIVE;
+    this.gridy = RELATIVE;
+    this.gridwidth = 1;
+    this.gridheight = 1;
+    this.ipadx = 0;
+    this.ipady = 0;
+    this.insets = new Insets (0, 0, 0, 0);
+    this.weightx = 0;
+    this.weighty = 0;
+  }
+}

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