diff options
author | Thomas Fitzsimmons <fitzsim@redhat.com> | 2004-02-03 17:10:56 +0000 |
---|---|---|
committer | Thomas Fitzsimmons <fitzsim@gcc.gnu.org> | 2004-02-03 17:10:56 +0000 |
commit | b6d3cb37ef676c2439fdf9498e4dbe8042fb3c6a (patch) | |
tree | 69b793f3808108f9a710a0f4875efb2e7eea8892 /libjava/java/awt/Container.java | |
parent | 5a98fa7bdb847dc92fdbeddf4dfcff51835aca48 (diff) | |
download | gcc-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/Container.java')
-rw-r--r-- | libjava/java/awt/Container.java | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/libjava/java/awt/Container.java b/libjava/java/awt/Container.java index 57cd833..ed869e1 100644 --- a/libjava/java/awt/Container.java +++ b/libjava/java/awt/Container.java @@ -106,7 +106,7 @@ public class Container extends Component */ public int getComponentCount() { - return ncomponents; + return countComponents (); } /** @@ -118,7 +118,7 @@ public class Container extends Component */ public int countComponents() { - return getComponentCount(); + return ncomponents; } /** @@ -186,10 +186,7 @@ public class Container extends Component */ public Insets getInsets() { - if (peer == null) - return new Insets(0, 0, 0, 0); - - return ((ContainerPeer) peer).getInsets(); + return insets (); } /** @@ -201,7 +198,10 @@ public class Container extends Component */ public Insets insets() { - return getInsets(); + if (peer == null) + return new Insets (0, 0, 0, 0); + + return ((ContainerPeer) peer).getInsets (); } /** @@ -463,8 +463,7 @@ public class Container extends Component */ public void doLayout() { - if (layoutMgr != null) - layoutMgr.layoutContainer(this); + layout (); } /** @@ -474,7 +473,8 @@ public class Container extends Component */ public void layout() { - doLayout(); + if (layoutMgr != null) + layoutMgr.layoutContainer (this); } /** @@ -555,7 +555,7 @@ public class Container extends Component */ public Dimension getPreferredSize() { - return preferredSize(); + return preferredSize (); } /** @@ -567,10 +567,10 @@ public class Container extends Component */ public Dimension preferredSize() { - if (layoutMgr != null) - return layoutMgr.preferredLayoutSize(this); - else - return super.preferredSize(); + if (layoutMgr != null) + return layoutMgr.preferredLayoutSize (this); + else + return super.preferredSize (); } /** @@ -580,7 +580,7 @@ public class Container extends Component */ public Dimension getMinimumSize() { - return minimumSize(); + return minimumSize (); } /** @@ -592,10 +592,10 @@ public class Container extends Component */ public Dimension minimumSize() { - if (layoutMgr != null) - return layoutMgr.minimumLayoutSize(this); - else - return super.minimumSize(); + if (layoutMgr != null) + return layoutMgr.minimumLayoutSize (this); + else + return super.minimumSize (); } /** @@ -833,23 +833,7 @@ public class Container extends Component */ public Component getComponentAt(int x, int y) { - synchronized (getTreeLock ()) - { - if (! contains(x, y)) - return null; - for (int i = 0; i < ncomponents; ++i) - { - // Ignore invisible children... - if (!component[i].isVisible()) - continue; - - int x2 = x - component[i].x; - int y2 = y - component[i].y; - if (component[i].contains(x2, y2)) - return component[i]; - } - return this; - } + return locate (x, y); } /** @@ -869,7 +853,23 @@ public class Container extends Component */ public Component locate(int x, int y) { - return getComponentAt(x, y); + synchronized (getTreeLock ()) + { + if (!contains (x, y)) + return null; + for (int i = 0; i < ncomponents; ++i) + { + // Ignore invisible children... + if (!component[i].isVisible ()) + continue; + + int x2 = x - component[i].x; + int y2 = y - component[i].y; + if (component[i].contains (x2, y2)) + return component[i]; + } + return this; + } } /** @@ -886,7 +886,7 @@ public class Container extends Component */ public Component getComponentAt(Point p) { - return getComponentAt(p.x, p.y); + return getComponentAt (p.x, p.y); } public Component findComponentAt(int x, int y) |