aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/awt/TextArea.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/TextArea.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/TextArea.java')
-rw-r--r--libjava/java/awt/TextArea.java96
1 files changed, 48 insertions, 48 deletions
diff --git a/libjava/java/awt/TextArea.java b/libjava/java/awt/TextArea.java
index 356efeb..6f60ee6 100644
--- a/libjava/java/awt/TextArea.java
+++ b/libjava/java/awt/TextArea.java
@@ -288,13 +288,7 @@ public class TextArea extends TextComponent implements java.io.Serializable
*/
public Dimension getMinimumSize (int rows, int columns)
{
- TextAreaPeer peer = (TextAreaPeer) getPeer ();
-
- // Sun returns Dimension (0,0) in this case.
- if (peer == null)
- return new Dimension (0, 0);
-
- return peer.getMinimumSize (rows, columns);
+ return minimumSize (rows, columns);
}
/**
@@ -311,7 +305,7 @@ public class TextArea extends TextComponent implements java.io.Serializable
*/
public Dimension minimumSize ()
{
- return getMinimumSize (getRows (), getColumns ());
+ return minimumSize (getRows (), getColumns ());
}
/**
@@ -333,7 +327,13 @@ public class TextArea extends TextComponent implements java.io.Serializable
*/
public Dimension minimumSize (int rows, int columns)
{
- return getMinimumSize (rows, columns);
+ TextAreaPeer peer = (TextAreaPeer) getPeer ();
+
+ // Sun returns Dimension (0,0) in this case.
+ if (peer == null)
+ return new Dimension (0, 0);
+
+ return peer.getMinimumSize (rows, columns);
}
/**
@@ -366,13 +366,7 @@ public class TextArea extends TextComponent implements java.io.Serializable
*/
public Dimension getPreferredSize (int rows, int columns)
{
- TextAreaPeer peer = (TextAreaPeer) getPeer ();
-
- // Sun returns Dimension (0,0) in this case.
- if (peer == null)
- return new Dimension (0, 0);
-
- return peer.getPreferredSize (rows, columns);
+ return preferredSize (rows, columns);
}
/**
@@ -389,7 +383,7 @@ public class TextArea extends TextComponent implements java.io.Serializable
*/
public Dimension preferredSize ()
{
- return getPreferredSize (getRows (), getColumns ());
+ return preferredSize (getRows (), getColumns ());
}
/**
@@ -411,7 +405,13 @@ public class TextArea extends TextComponent implements java.io.Serializable
*/
public Dimension preferredSize (int rows, int columns)
{
- return getPreferredSize (rows, columns);
+ TextAreaPeer peer = (TextAreaPeer) getPeer ();
+
+ // Sun returns Dimension (0,0) in this case.
+ if (peer == null)
+ return new Dimension (0, 0);
+
+ return peer.getPreferredSize (rows, columns);
}
/**
@@ -440,59 +440,59 @@ public class TextArea extends TextComponent implements java.io.Serializable
/**
* Append the specified text to the end of the current text.
*
- * @param text The text to append.
+ * @param str The text to append.
*/
public void append (String str)
{
- TextAreaPeer peer = (TextAreaPeer) getPeer ();
- if (peer == null)
- return;
-
- peer.insert (str, peer.getText().length ());
+ appendText (str);
}
/**
* Append the specified text to the end of the current text.
*
- * @param text The text to append.
+ * @param str The text to append.
*
* @deprecated This method is deprecated in favor of
* <code>append ()</code>.
*/
- public void appendText (String text)
+ public void appendText (String str)
{
- append (text);
+ TextAreaPeer peer = (TextAreaPeer) getPeer ();
+ if (peer == null)
+ return;
+
+ peer.insert (str, peer.getText().length ());
}
/**
* Insert the specified text at the specified position. The first
* character in the text area is at position zero.
*
- * @param text The text to insert.
+ * @param str The text to insert.
* @param pos The position at which to insert text.
*/
- public void insert (String text, int pos)
+ public void insert (String str, int pos)
{
- TextAreaPeer peer = (TextAreaPeer) getPeer ();
- if (peer == null)
- return;
-
- peer.insert (text, pos);
+ insertText (str, pos);
}
/**
* Insert the specified text at the specified position. The first
* character in the text area is at position zero.
*
- * @param text The text to insert.
+ * @param str The text to insert.
* @param pos The position at which to insert text.
*
- * @deprecated This method is depcreated in favor of
+ * @deprecated This method is deprecated in favor of
* <code>insert ()</code>.
*/
- public void insertText (String text, int pos)
+ public void insertText (String str, int pos)
{
- insert (text, pos);
+ TextAreaPeer peer = (TextAreaPeer) getPeer ();
+ if (peer == null)
+ return;
+
+ peer.insert (str, pos);
}
/**
@@ -503,17 +503,13 @@ public class TextArea extends TextComponent implements java.io.Serializable
* length of the replacement text may differ from the length of the
* text that is replaced.
*
- * @param text The new text for the range.
+ * @param str The new text for the range.
* @param start The start position of the replacement range.
* @param end The end position of the replacement range.
*/
- public void replaceRange (String text, int start, int end)
+ public void replaceRange (String str, int start, int end)
{
- TextAreaPeer peer = (TextAreaPeer) getPeer ();
- if (peer == null)
- return;
-
- peer.replaceRange (text, start, end);
+ replaceText (str, start, end);
}
/**
@@ -524,16 +520,20 @@ public class TextArea extends TextComponent implements java.io.Serializable
* length of the replacement text may differ from the length of the
* text that is replaced.
*
- * @param text The new text for the range.
+ * @param str The new text for the range.
* @param start The start position of the replacement range.
* @param end The end position of the replacement range.
*
* @deprecated This method is deprecated in favor of
* <code>replaceRange ()</code>.
*/
- public void replaceText (String text, int start, int end)
+ public void replaceText (String str, int start, int end)
{
- replaceRange (text, start, end);
+ TextAreaPeer peer = (TextAreaPeer) getPeer ();
+ if (peer == null)
+ return;
+
+ peer.replaceRange (str, start, end);
}
/**