Class StoppableInput

java.lang.Object
  extended by StoppableInput

public class StoppableInput
extends java.lang.Object

A fork of SimpleInput that adds "Stop" buttons for whatever is displaying the dialog boxes.


Constructor Summary
StoppableInput()
           
 
Method Summary
static java.lang.String getDirectory(java.lang.String message)
          Method to get the name of a directory
static java.lang.Integer getIntNumber(java.lang.String message)
          Method to allow the user to input an integer.
static java.lang.Integer getIntNumber(java.lang.String message, int min, int max)
          Method to get an integer between a minimum and maximum (inclusive)
static java.lang.Double getNumber(java.lang.String message)
          Method to allow the user to input a number.
static java.lang.String getString(java.lang.String message)
          Method to get a string input by the user.
static void setThingToStop(Stoppable thing)
          Sets the thing that will be stopped by the "Stop" buttons on these dialog boxes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StoppableInput

public StoppableInput()
Method Detail

setThingToStop

public static void setThingToStop(Stoppable thing)
Sets the thing that will be stopped by the "Stop" buttons on these dialog boxes.

Parameters:
thing - The thing to stop, or null to disable the stop buttons.

getNumber

public static java.lang.Double getNumber(java.lang.String message)
Method to allow the user to input a number. the dialog will keep appearing till a valid number is input.

Parameters:
message - the message to display to the user in the dialog
Returns:
the number as a double

getIntNumber

public static java.lang.Integer getIntNumber(java.lang.String message)
Method to allow the user to input an integer. The dialog will keep appearing till a valid number is input.

Parameters:
message - the message to display to the user in the dialog
Returns:
the number as an integer

getIntNumber

public static java.lang.Integer getIntNumber(java.lang.String message,
                                             int min,
                                             int max)
Method to get an integer between a minimum and maximum (inclusive)

Parameters:
message - the message to display to the user in the dialog
min - the minimum number
max - the maximum number
Returns:
the user entered integer

getDirectory

public static java.lang.String getDirectory(java.lang.String message)
Method to get the name of a directory

Parameters:
message - the message to display to the user
Returns:
the pathname for a directory

getString

public static java.lang.String getString(java.lang.String message)
Method to get a string input by the user. The dialog will keep appearing till a string is entered.

Parameters:
message - the message to display to the user
Returns:
the input string