aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/awt/Rectangle.java
diff options
context:
space:
mode:
authorThomas Fitzsimmons <fitzsim@redhat.com>2004-02-03 17:10:56 +0000
committerThomas Fitzsimmons <fitzsim@gcc.gnu.org>2004-02-03 17:10:56 +0000
commitb6d3cb37ef676c2439fdf9498e4dbe8042fb3c6a (patch)
tree69b793f3808108f9a710a0f4875efb2e7eea8892 /libjava/java/awt/Rectangle.java
parent5a98fa7bdb847dc92fdbeddf4dfcff51835aca48 (diff)
downloadgcc-b6d3cb37ef676c2439fdf9498e4dbe8042fb3c6a.zip
gcc-b6d3cb37ef676c2439fdf9498e4dbe8042fb3c6a.tar.gz
gcc-b6d3cb37ef676c2439fdf9498e4dbe8042fb3c6a.tar.bz2
GtkListPeer.java, [...]: Fix handling of alias methods...
2004-02-03 Thomas Fitzsimmons <fitzsim@redhat.com> * gnu/java/awt/peer/gtk/GtkListPeer.java, java/awt/BorderLayout.java, java/awt/CardLayout.java, java/awt/CheckboxGroup.java, java/awt/Choice.java, java/awt/Component.java, java/awt/Container.java, java/awt/FontMetrics.java, java/awt/GridBagLayout.java, java/awt/LayoutManager2.java, java/awt/List.java, java/awt/Menu.java, java/awt/MenuBar.java, java/awt/MenuItem.java, java/awt/Polygon.java, java/awt/Rectangle.java, java/awt/ScrollPane.java, java/awt/Scrollbar.java, java/awt/TextArea.java, java/awt/TextField.java, java/awt/image/renderable/RenderContext.java, javax/swing/JApplet.java: Fix handling of alias methods, where a method has been deprecated in favour of a new one with the same funtion but a different name. Put the method implementation in the deprecated method and have the new method call the deprecated one. Make all other code call the new method. From-SVN: r77178
Diffstat (limited to 'libjava/java/awt/Rectangle.java')
-rw-r--r--libjava/java/awt/Rectangle.java49
1 files changed, 20 insertions, 29 deletions
diff --git a/libjava/java/awt/Rectangle.java b/libjava/java/awt/Rectangle.java
index 48a2fbe..c3340bb8 100644
--- a/libjava/java/awt/Rectangle.java
+++ b/libjava/java/awt/Rectangle.java
@@ -281,10 +281,7 @@ public class Rectangle extends Rectangle2D implements Shape, Serializable
*/
public void setBounds(Rectangle r)
{
- x = r.x;
- y = r.y;
- width = r.width;
- height = r.height;
+ setBounds (r.x, r.y, r.width, r.height);
}
/**
@@ -298,10 +295,7 @@ public class Rectangle extends Rectangle2D implements Shape, Serializable
*/
public void setBounds(int x, int y, int width, int height)
{
- this.x = x;
- this.y = y;
- this.width = width;
- this.height = height;
+ reshape (x, y, width, height);
}
/**
@@ -333,7 +327,10 @@ public class Rectangle extends Rectangle2D implements Shape, Serializable
*/
public void reshape(int x, int y, int width, int height)
{
- setBounds(x, y, width, height);
+ this.x = x;
+ this.y = y;
+ this.width = width;
+ this.height = height;
}
/**
@@ -360,8 +357,7 @@ public class Rectangle extends Rectangle2D implements Shape, Serializable
*/
public void setLocation(Point p)
{
- this.x = p.x;
- this.y = p.y;
+ setLocation (p.x, p.y);
}
/**
@@ -374,8 +370,7 @@ public class Rectangle extends Rectangle2D implements Shape, Serializable
*/
public void setLocation(int x, int y)
{
- this.x = x;
- this.y = y;
+ move (x, y);
}
/**
@@ -388,7 +383,8 @@ public class Rectangle extends Rectangle2D implements Shape, Serializable
*/
public void move(int x, int y)
{
- setLocation(x, y);
+ this.x = x;
+ this.y = y;
}
/**
@@ -426,8 +422,7 @@ public class Rectangle extends Rectangle2D implements Shape, Serializable
*/
public void setSize(Dimension d)
{
- width = d.width;
- height = d.height;
+ setSize (d.width, d.height);
}
/**
@@ -439,8 +434,7 @@ public class Rectangle extends Rectangle2D implements Shape, Serializable
*/
public void setSize(int width, int height)
{
- this.width = width;
- this.height = height;
+ resize (width, height);
}
/**
@@ -452,7 +446,8 @@ public class Rectangle extends Rectangle2D implements Shape, Serializable
*/
public void resize(int width, int height)
{
- setSize(width, height);
+ this.width = width;
+ this.height = height;
}
/**
@@ -469,9 +464,7 @@ public class Rectangle extends Rectangle2D implements Shape, Serializable
*/
public boolean contains(Point p)
{
- return width > 0 && height > 0
- && p.x >= x && p.x < x + width
- && p.y >= y && p.y < y + height;
+ return contains (p.x, p.y);
}
/**
@@ -487,9 +480,7 @@ public class Rectangle extends Rectangle2D implements Shape, Serializable
*/
public boolean contains(int x, int y)
{
- return width > 0 && height > 0
- && x >= this.x && x < this.x + width
- && y >= this.y && y < this.y + height;
+ return inside (x, y);
}
/**
@@ -504,9 +495,7 @@ public class Rectangle extends Rectangle2D implements Shape, Serializable
*/
public boolean contains(Rectangle r)
{
- return width > 0 && height > 0 && r.width > 0 && r.height > 0
- && r.x >= x && r.x + r.width <= x + width
- && r.y >= y && r.y + r.height <= y + height;
+ return contains (r.x, r.y, r.width, r.height);
}
/**
@@ -537,7 +526,9 @@ public class Rectangle extends Rectangle2D implements Shape, Serializable
*/
public boolean inside(int x, int y)
{
- return contains(x, y);
+ return width > 0 && height > 0
+ && x >= this.x && x < this.x + width
+ && y >= this.y && y < this.y + height;
}
/**