edu.stanford.rsl.konrad.utils
Class UserUtil

java.lang.Object
  extended by edu.stanford.rsl.konrad.utils.UserUtil

public abstract class UserUtil
extends java.lang.Object

Class for obtaining information from the user easyly.

Author:
akmaier

Constructor Summary
UserUtil()
           
 
Method Summary
static java.lang.Object chooseObject(java.lang.String message, java.lang.String messageTitle, java.lang.Object[] objects, java.lang.Object initialObject)
          Asks the User to select an Object from a given array of Objects.
static boolean queryBoolean(java.lang.String message)
          Queries the User for a Boolean value.
static double queryDouble(java.lang.String message, double initialValue)
          Queries the User for a Double values using Swing.
static int queryInt(java.lang.String message, int initialValue)
          Queries the User for an Integer value using Swing.
static EnergyDependentCoefficients.Material queryMaterial(java.lang.String message, java.lang.String messageTitle)
          Queries the user for a Material.
static AnalyticPhantom queryPhantom(java.lang.String message, java.lang.String messageTitle)
          Queries the user for a Phantom.
static java.lang.String queryString(java.lang.String message, java.lang.String initialValue)
          Queries the User for a String value.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserUtil

public UserUtil()
Method Detail

queryInt

public static int queryInt(java.lang.String message,
                           int initialValue)
                    throws java.lang.Exception
Queries the User for an Integer value using Swing.

Parameters:
message -
initialValue -
Returns:
the chosen int
Throws:
java.lang.Exception

queryDouble

public static double queryDouble(java.lang.String message,
                                 double initialValue)
                          throws java.lang.Exception
Queries the User for a Double values using Swing.

Parameters:
message -
initialValue -
Returns:
the chosen double
Throws:
java.lang.Exception

queryString

public static java.lang.String queryString(java.lang.String message,
                                           java.lang.String initialValue)
                                    throws java.lang.Exception
Queries the User for a String value.

Parameters:
message -
initialValue -
Returns:
the user input
Throws:
java.lang.Exception

queryMaterial

public static EnergyDependentCoefficients.Material queryMaterial(java.lang.String message,
                                                                 java.lang.String messageTitle)
                                                          throws java.lang.Exception
Queries the user for a Material.

Parameters:
message -
messageTitle -
Returns:
the chosen Material
Throws:
java.lang.Exception

queryPhantom

public static AnalyticPhantom queryPhantom(java.lang.String message,
                                           java.lang.String messageTitle)
                                    throws java.lang.Exception
Queries the user for a Phantom.

Parameters:
message -
messageTitle -
Returns:
the chosen Phantom
Throws:
java.lang.Exception

queryBoolean

public static boolean queryBoolean(java.lang.String message)
                            throws java.lang.Exception
Queries the User for a Boolean value.

Parameters:
message -
Returns:
the chosen boolean
Throws:
java.lang.Exception

chooseObject

public static java.lang.Object chooseObject(java.lang.String message,
                                            java.lang.String messageTitle,
                                            java.lang.Object[] objects,
                                            java.lang.Object initialObject)
                                     throws java.lang.Exception
Asks the User to select an Object from a given array of Objects.

Parameters:
message -
messageTitle -
objects -
initialObject -
Returns:
the chosen object
Throws:
java.lang.Exception