From 87a574adce139fd1627dadcbbecaff0ca118cb75 Mon Sep 17 00:00:00 2001 From: Tania Bento Date: Fri, 3 Nov 2006 21:28:07 +0000 Subject: 2006-11-03 Tania Bento * java/awt/TextArea.java (getMinimumSize): Changed documentation. (getPreferredSize): Changed documentation. (getMinimumSize(int,int)): Changed documenation. (getPreferredSize(int,int)): Changed documenation. (minimumSize): Changed documentation. (preferredSize): Changed documenation. (minimumSize(int,int)): Changed documentation. Checked if minimum size had been previously set and changed values of Dimension returned if peer == null. (preferredSize(int, int)): Checked if preferred size had been previously set and changed values of Dimension returned if peer = null. --- ChangeLog | 16 ++++++++++++ java/awt/TextArea.java | 68 ++++++++++++++++---------------------------------- 2 files changed, 37 insertions(+), 47 deletions(-) diff --git a/ChangeLog b/ChangeLog index bf9764b0e..a5093cab6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2006-11-03 Tania Bento + + * java/awt/TextArea.java + (getMinimumSize): Changed documentation. + (getPreferredSize): Changed documentation. + (getMinimumSize(int,int)): Changed documenation. + (getPreferredSize(int,int)): Changed documenation. + (minimumSize): Changed documentation. + (preferredSize): Changed documenation. + (minimumSize(int,int)): Changed documentation. Checked if + minimum size had been previously set and changed values of + Dimension returned if peer == null. + (preferredSize(int, int)): Checked if preferred size had been + previously set and changed values of Dimension returned if + peer = null. + 2006-11-03 Tania Bento * java/awt/event/ComponentEvent.java diff --git a/java/awt/TextArea.java b/java/awt/TextArea.java index 7e3463ab8..30b278d0c 100644 --- a/java/awt/TextArea.java +++ b/java/awt/TextArea.java @@ -284,11 +284,7 @@ public class TextArea extends TextComponent implements java.io.Serializable } /** - * Retrieve the minimum size for this text area, considering the - * text area's current row and column values. A text area's minimum - * size depends on the number of rows and columns of text it would - * prefer to display, and on the size of the font in which the text - * would be displayed. + * Retrieve the minimum size for this text area. * * @return The minimum size for this text field. */ @@ -298,11 +294,8 @@ public class TextArea extends TextComponent implements java.io.Serializable } /** - * Retrieve the minimum size that this text area would have if its - * row and column values were equal to those specified. A text - * area's minimum size depends on the number of rows and columns of - * text it would prefer to display, and on the size of the font in - * which the text would be displayed. + * Retrieve the minimum size for this text area. If the minimum + * size has been set, then rows and columns are used in the calculation. * * @param rows The number of rows to use in the minimum size * calculation. @@ -317,12 +310,8 @@ public class TextArea extends TextComponent implements java.io.Serializable } /** - * Retrieve the minimum size for this text area, considering the - * text area's current row and column values. A text area's minimum - * size depends on the number of rows and columns of text it would - * prefer to display, and on the size of the font in which the text - * would be displayed. - * + * Retrieve the minimum size for this text area. + * * @return The minimum size for this text area. * * @deprecated This method is deprecated in favor of @@ -334,11 +323,8 @@ public class TextArea extends TextComponent implements java.io.Serializable } /** - * Retrieve the minimum size that this text area would have if its - * row and column values were equal to those specified. A text - * area's minimum size depends on the number of rows and columns of - * text it would prefer to display, and on the size of the font in - * which the text would be displayed. + * Retrieve the minimum size for this text area. If the minimum + * size has been set, then rows and columns are used in the calculation. * * @param rows The number of rows to use in the minimum size * calculation. @@ -352,21 +338,18 @@ public class TextArea extends TextComponent implements java.io.Serializable */ public Dimension minimumSize (int rows, int columns) { + if (isMinimumSizeSet()) + return new Dimension(minSize); + TextAreaPeer peer = (TextAreaPeer) getPeer (); - - // Sun returns Dimension (0,0) in this case. if (peer == null) - return new Dimension (0, 0); + return new Dimension (getWidth(), getHeight()); return peer.getMinimumSize (rows, columns); } /** - * Retrieve the preferred size for this text area, considering the - * text area's current row and column values. A text area's preferred - * size depends on the number of rows and columns of text it would - * prefer to display, and on the size of the font in which the text - * would be displayed. + * Retrieve the preferred size for this text area. * * @return The preferred size for this text field. */ @@ -376,11 +359,8 @@ public class TextArea extends TextComponent implements java.io.Serializable } /** - * Retrieve the preferred size that this text area would have if its - * row and column values were equal to those specified. A text - * area's preferred size depends on the number of rows and columns - * of text it would prefer to display, and on the size of the font - * in which the text would be displayed. + * Retrieve the preferred size for this text area. If the preferred + * size has been set, then rows and columns are used in the calculation. * * @param rows The number of rows to use in the preferred size * calculation. @@ -395,11 +375,7 @@ public class TextArea extends TextComponent implements java.io.Serializable } /** - * Retrieve the preferred size for this text area, considering the - * text area's current row and column values. A text area's preferred - * size depends on the number of rows and columns of text it would - * prefer to display, and on the size of the font in which the text - * would be displayed. + * Retrieve the preferred size for this text area. * * @return The preferred size for this text field. * @@ -412,11 +388,8 @@ public class TextArea extends TextComponent implements java.io.Serializable } /** - * Retrieve the preferred size that this text area would have if its - * row and column values were equal to those specified. A text - * area's preferred size depends on the number of rows and columns - * of text it would prefer to display, and on the size of the font - * in which the text would be displayed. + * Retrieve the preferred size for this text area. If the preferred + * size has been set, then rows and columns are used in the calculation. * * @param rows The number of rows to use in the preferred size * calculation. @@ -430,11 +403,12 @@ public class TextArea extends TextComponent implements java.io.Serializable */ public Dimension preferredSize (int rows, int columns) { + if (isPreferredSizeSet()) + return new Dimension(prefSize); + TextAreaPeer peer = (TextAreaPeer) getPeer (); - - // Sun returns Dimension (0,0) in this case. if (peer == null) - return new Dimension (0, 0); + return new Dimension (getWidth(), getHeight()); return peer.getPreferredSize (rows, columns); } -- cgit v1.2.1