mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-28 01:55:16 +08:00
5472d1951a
* java/awt/MenuContainer.java: Fixed typo. * Makefile.in: Rebuilt. * Makefile.am (awt_java_source_files): Added SystemColor.java. * java/awt/SystemColor.java: New file. * java/awt/Color.java (rgba): Now package-private. * java/awt/event/InputEvent.java (isAltGraphDown): New method. * java/awt/event/ContainerEvent.java (getContainer): Renamed from getComponent. * java/awt/MenuItem.java (addNotify): New method. (MenuItem(String,MenuShortcut)): New constructor. (setLabel): Notify peer of change. (setEnabled): Likewise. * java/awt/GridLayout.java (toString): New method. * java/awt/FlowLayout.java (LEADING, TRAILING): New constants. (FlowLayout): Check for LEADING and TRAILING. (setAlignment): Likewise. (layoutContainer): Handle component orientation. * java/awt/Component.java (orientatin): New field. (setComponentOrientation): Wrote. (getComponentOrientation): Wrote. * java/awt/Event.java (Event): Implements Serializable. (consumed): New field for serialization. * java/awt/Dimension.java (Dimension): Implements Serializable. * java/awt/Cursor.java (Cursor): Implements Serializable. * java/awt/Container.java (Container): No longer abstract. * java/awt/Choice.java: Wrote. * java/awt/Checkbox.java: Wrote. * java/awt/ItemSelectable.java: Documented. * java/awt/CheckboxGroup.java: Wrote. * java/awt/CardLayout.java (layoutContainer): Directly use fields in other classes. (getSize): Likewise. From-SVN: r38486
80 lines
1.7 KiB
Java
80 lines
1.7 KiB
Java
/* Copyright (C) 1999, 2000 Free Software Foundation
|
|
|
|
This file is part of libjava.
|
|
|
|
This software is copyrighted work licensed under the terms of the
|
|
Libjava License. Please consult the file "LIBJAVA_LICENSE" for
|
|
details. */
|
|
|
|
package java.awt;
|
|
|
|
/**
|
|
* @author Per Bothner <bothner@cygnus.com>
|
|
* @date Fenruary 8, 1999.
|
|
*/
|
|
|
|
/* Written using "Java Class Libraries", 2nd edition, plus online
|
|
* API docs for JDK 1.2 beta from http://www.javasoft.com.
|
|
* Status: Believed complete and correct, except that neither toString
|
|
* has not been compared with JDK output.
|
|
*/
|
|
|
|
public class Dimension extends java.awt.geom.Dimension2D
|
|
implements java.io.Serializable
|
|
{
|
|
public int height;
|
|
public int width;
|
|
|
|
public Dimension () { }
|
|
|
|
public Dimension (Dimension dim)
|
|
{
|
|
this.width = dim.width;
|
|
this.height = dim.height;
|
|
}
|
|
|
|
public Dimension (int width, int height)
|
|
{
|
|
this.width = width;
|
|
this.height = height;
|
|
}
|
|
|
|
public boolean equals (Object obj)
|
|
{
|
|
if (! (obj instanceof Dimension))
|
|
return false;
|
|
Dimension dim = (Dimension) obj;
|
|
return height == dim.height && width == dim.width;
|
|
}
|
|
|
|
public Dimension getSize () { return new Dimension(this); }
|
|
|
|
public void setSize (Dimension dim)
|
|
{
|
|
this.width = dim.width;
|
|
this.height = dim.height;
|
|
}
|
|
|
|
public void setSize (int width, int height)
|
|
{
|
|
this.width = width;
|
|
this.height = height;
|
|
}
|
|
|
|
public String toString ()
|
|
{
|
|
return "Dimension[w:"+width+",h:"+height+']';
|
|
}
|
|
|
|
/* Note: There is no Dimension.hashCode. */
|
|
|
|
public double getWidth() { return width; }
|
|
public double getHeight() { return height; }
|
|
|
|
public void setSize (double width, double height)
|
|
{
|
|
this.width = (int) width;
|
|
this.height = (int) height;
|
|
}
|
|
}
|