diff options
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | javax/swing/Timer.java | 10 | ||||
-rw-r--r-- | javax/swing/ToolTipManager.java | 18 |
3 files changed, 31 insertions, 7 deletions
@@ -1,3 +1,13 @@ +2006-07-09 David Gilbert <david.gilbert@object-refinery.com> + + * javax/swing/Timer.java + (setDelay): Throw IllegalArgumentException for negative delay, + (setInitialDelay): Likewise, + * javax/swing/ToolTipManager.java + (setInitialDelay): Document IllegalArgumentException, + (setDismissDelay): Likewise, + (setReshowDelay): Likewise. + 2006-07-09 Andrew John Hughes <gnu_andrew@member.fsf.org> * java/lang/management/MemoryUsage.java: diff --git a/javax/swing/Timer.java b/javax/swing/Timer.java index 231b71d73..acd226249 100644 --- a/javax/swing/Timer.java +++ b/javax/swing/Timer.java @@ -1,5 +1,5 @@ /* Timer.java -- - Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2005, 2006, Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -264,9 +264,13 @@ public class Timer * firing the first event. * * @param d The time gap between the subsequent events, in milliseconds + * + * @throws IllegalArgumentException if <code>d</code> is less than zero. */ public void setDelay(int d) { + if (d < 0) + throw new IllegalArgumentException("Invalid delay: " + d); delay = d; } @@ -287,9 +291,13 @@ public class Timer * subsequent events. * * @param i the initial delay, in milliseconds + * + * @throws IllegalArgumentException if <code>i</code> is less than zero. */ public void setInitialDelay(int i) { + if (i < 0) + throw new IllegalArgumentException("Invalid initial delay: " + i); initialDelay = i; } diff --git a/javax/swing/ToolTipManager.java b/javax/swing/ToolTipManager.java index c7de4db83..963ccf881 100644 --- a/javax/swing/ToolTipManager.java +++ b/javax/swing/ToolTipManager.java @@ -1,5 +1,5 @@ /* ToolTipManager.java -- - Copyright (C) 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2006, Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -267,10 +267,12 @@ public class ToolTipManager extends MouseAdapter implements MouseMotionListener } /** - * This method sets the initial delay before the ToolTip is shown when the + * Sets the initial delay before the ToolTip is shown when the * mouse enters a Component. * * @param delay The initial delay before the ToolTip is shown. + * + * @throws IllegalArgumentException if <code>delay</code> is less than zero. */ public void setInitialDelay(int delay) { @@ -289,9 +291,11 @@ public class ToolTipManager extends MouseAdapter implements MouseMotionListener } /** - * This method sets the time the ToolTip will be shown before being hidden. + * Sets the time the ToolTip will be shown before being hidden. * - * @param delay The time the ToolTip will be shown before being hidden. + * @param delay the delay (in milliseconds) before tool tips are hidden. + * + * @throws IllegalArgumentException if <code>delay</code> is less than zero. */ public void setDismissDelay(int delay) { @@ -310,10 +314,12 @@ public class ToolTipManager extends MouseAdapter implements MouseMotionListener } /** - * This method sets the amount of delay where if the mouse re-enters a + * Sets the amount of delay where if the mouse re-enters a * Component, the tooltip will be shown immediately. * - * @param delay The reshow delay. + * @param delay The reshow delay (in milliseconds). + * + * @throws IllegalArgumentException if <code>delay</code> is less than zero. */ public void setReshowDelay(int delay) { |