summaryrefslogtreecommitdiff
path: root/java/awt/Insets.java
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2002-05-06 02:43:17 +0000
committerEric Blake <ebb9@byu.net>2002-05-06 02:43:17 +0000
commitfb0219dcce2e53020800c655562b5f7351b0579b (patch)
tree9f82123162f4b28fe313e1777997035fb852cabf /java/awt/Insets.java
parentd76bb31a7c2246eea1f5f1b9624b8ddf1d841b88 (diff)
downloadclasspath-fb0219dcce2e53020800c655562b5f7351b0579b.tar.gz
2002-05-05 Eric Blake <ebb9@email.byu.edu>
* java/applet/Applet.java (getAccessibleState): Update. * java/awt/AWTEvent.java (INPUT_ENABLED_EVENT_MASK): New flag. * java/awt/AWTKeyStroke.java (keyCode): Make more visible. * java/awt/AlphaComposite.java: New file (needs documentation). * java/awt/AttributeValue.java: New file. * java/awt/BasicStroke.java: New file (needs docs). * java/awt/BufferCapabilities.java: New file (needs docs). * java/awt/Button.java (getActionListeners, getListeners): Use new features of AWTEventMulticater. * java/awt/Component.java: Partial update to 1.4. * java/awt/ComponentOrientation.java: Update to 1.4. * java/awt/Container.java (getContainerListeners, getListeners): Use new features of AWTEventMulticaster. * java/awt/ContainerOrderFocusTraversalPolicy.java: New file (stubbed, needs docs). * java/awt/DefaultFocusTraversalPolicy.java: New file (stubbed). * java/awt/DefaultKeyboardFocusManager.java: New file (stubbed). * java/awt/FocusTraversalPolicy.java: New file (needs docs). * java/awt/GradientPaint.java: New file (stubbed). * java/awt/GraphicsConfiguration.java: Update to 1.4. * java/awt/ImageCapabilities.java: New file (stubbed). * java/awt/Insets.java: Update to 1.4. * java/awt/JobAttributes.java: New file (needs docs). * java/awt/KeyboardFocusManager.java: New file (partially stubbed). * java/awt/Makefile.am (EXTRA_DIST): Account for new files. * java/awt/MenuItem.java (getActionListeners, getListeners): Use new features of AWTEventMulticaster. * java/awt/PageAttributes.java: New file (needs docs). * java/awt/PaintContext.java (paint): Remove redundant keyword. * java/awt/PrintJob.java: Update to 1.4. * java/awt/RenderingHints.java: Partial update to 1.4 (needs docs). * java/awt/Robot.java: New file (stubbed). * java/awt/TexturePaint.java: New file (stubbed). * java/awt/Window.java (getWindowListeners, getListeners): Use new features of AWTEventMulticaster. * java/awt/geom/Arc2D.java: Implement and document. * java/awt/geom/Rectangle2D.java: Fix doc typo.
Diffstat (limited to 'java/awt/Insets.java')
-rw-r--r--java/awt/Insets.java246
1 files changed, 115 insertions, 131 deletions
diff --git a/java/awt/Insets.java b/java/awt/Insets.java
index fb1d46563..573005a76 100644
--- a/java/awt/Insets.java
+++ b/java/awt/Insets.java
@@ -1,4 +1,4 @@
-/* Insets.java -- Information about a container border.
+/* Insets.java -- information about a container border
Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,137 +38,121 @@ exception statement from your version. */
package java.awt;
-/**
- * This class represents the "margin" or space around a container.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class Insets implements Cloneable, java.io.Serializable
-{
-
-/*
- * Instance Variable
- */
-
-/**
- * @serial The top inset
- */
-public int top;
-
-/**
- * @serial This bottom inset
- */
-public int bottom;
+import java.io.Serializable;
/**
- * @serial The left inset
- */
-public int left;
-
-/**
- * @serial The right inset
- */
-public int right;
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of <code>Inset</code> with the specified
- * inset values.
- *
- * @param top The top inset
- * @param left The left inset
- * @param bottom The bottom inset
- * @param right The right inset
- */
-public
-Insets(int top, int left, int bottom, int right)
-{
- this.top = top;
- this.left = left;
- this.bottom = bottom;
- this.right = right;
-}
-
-/*************************************************************************/
-
-/*
- * Instance Methods
+ * This class represents the "margin" or space around a container.
+ *
+ * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @status
*/
-
-/**
- * Tests whether this object is equal to the specified object. This will
- * be true if and only if the specified object:
- * <p>
- * <ul>
- * <li>Is not <code>null</code>.
- * <li>Is an instance of <code>Insets</code>.
- * <li>Has the same top, bottom, left, and right inset values as this object.
- * </ul>
- *
- * @param obj The object to test against.
- *
- * @return <code>true</code> if the specified object is equal to this
- * one, <code>false</code> otherwise.
- */
-public boolean
-equals(Object obj)
-{
- if (!(obj instanceof Insets))
- return(false);
-
- Insets i = (Insets)obj;
-
- if (i.top != top)
- return(false);
- if (i.bottom != bottom)
- return(false);
- if (i.left != left)
- return(false);
- if (i.right != right)
- return(false);
-
- return(true);
-}
-
-public int
-hashCode()
-{
- return top + bottom + left + right;
-}
-
-/*************************************************************************/
-
-/**
- * Returns a string representation of this object.
- *
- * @return A string representation of this object.
- */
-public String
-toString()
-{
- return(getClass().getName() + "(top=" + top + ",bottom=" + bottom +
- ",left=" + left + ",right=" + right + ")");
-}
-
-/*************************************************************************/
-
-/**
- * Returns a copy of this object.
- *
- * @return A copy of this object.
- */
-public Object
-clone()
+public class Insets implements Cloneable, Serializable
{
- try
- {
- return(super.clone());
- }
- catch(Exception e)
- {
- return(null);
- }
-}
-
-} // class Insets
+ /**
+ * Compatible with JDK 1.0+.
+ */
+ private static final long serialVersionUID = -2272572637695466749L;
+
+ /**
+ * The gap from the top.
+ *
+ * @serial the top inset
+ */
+ public int top;
+
+ /**
+ * The gap from the left.
+ *
+ * @serial the left inset
+ */
+ public int left;
+
+ /**
+ * The gap from the bottom.
+ *
+ * @serial the bottom inset
+ */
+ public int bottom;
+
+ /**
+ * The gap from the right.
+ *
+ * @serial the right inset
+ */
+ public int right;
+
+ /**
+ * Initializes a new instance of <code>Inset</code> with the specified
+ * inset values.
+ *
+ * @param top the top inset
+ * @param left the left inset
+ * @param bottom the bottom inset
+ * @param right the right inset
+ */
+ public Insets(int top, int left, int bottom, int right)
+ {
+ this.top = top;
+ this.left = left;
+ this.bottom = bottom;
+ this.right = right;
+ }
+
+ /**
+ * Tests whether this object is equal to the specified object. The other
+ * object must be an instance of Insets with identical field values.
+ *
+ * @param obj the object to test against
+ * @return true if the specified object is equal to this one
+ */
+ public boolean equals(Object obj)
+ {
+ if (! (obj instanceof Insets))
+ return false;
+ Insets i = (Insets) obj;
+ return top == i.top && bottom == i.bottom
+ && left == i.left && right == i.right;
+ }
+
+ /**
+ * Returns a hashcode for this instance. The formula is unspecified, but
+ * appears to be <code>XXX what is it? </code>.
+ *
+ * @return the hashcode
+ */
+ public int hashCode()
+ {
+ // This can't be right...
+ return top + bottom + left + right;
+ }
+
+ /**
+ * Returns a string representation of this object, which will be non-null.
+ * The format is unspecified, but appears to be <code>XXX what is it?</code>.
+ *
+ * @return a string representation of this object
+ */
+ public String toString()
+ {
+ return getClass().getName() + "(top=" + top + ",bottom=" + bottom +
+ ",left=" + left + ",right=" + right + ')';
+ }
+
+ /**
+ * Returns a copy of this object.
+ *
+ * @return a copy of this object
+ */
+ public Object clone()
+ {
+ try
+ {
+ return super.clone();
+ }
+ catch (CloneNotSupportedException e)
+ {
+ throw (Error) new InternalError().initCause(e); // Impossible
+ }
+ }
+} // class Insets