NASA World Wind

gov.nasa.worldwind.util
Class WWUtil

java.lang.Object
  extended by gov.nasa.worldwind.util.WWUtil

public class WWUtil
extends java.lang.Object


Constructor Summary
WWUtil()
           
 
Method Summary
static void alignComponent(java.awt.Component parent, java.awt.Component child, java.lang.String alignment)
           
static java.awt.Color computeContrastingColor(java.awt.Color color)
           
static java.lang.Boolean convertStringToBoolean(java.lang.String s)
          Converts a specified string to a boolean value.
static java.lang.Double convertStringToDouble(java.lang.String s)
          Converts a specified string to a floating point value.
static java.lang.Integer convertStringToInteger(java.lang.String s)
          Converts a specified string to an integer value.
static java.lang.Long convertStringToLong(java.lang.String s)
          Converts a specified string to a long integer value.
static java.awt.Color decodeColor(java.lang.String encodedString)
          Returns the Color described by the String encodedString.
protected static void doListFileNames(java.io.File file, java.io.FileFilter filter, boolean recurse, boolean exitBranchOnFirstMatch, java.util.Collection<java.lang.String> names)
           
protected static java.lang.String[] doListFileNames(java.lang.String filePath, java.io.FileFilter filter, boolean recurse, boolean exitBranchOnFirstMatch)
           
static java.lang.String encodeColor(java.awt.Color color)
          Returns a String encoding of the specified color.
static boolean isEmpty(java.lang.Object s)
          Determine whether an object reference is null or a reference to an empty string.
static java.lang.String[] listAllFileNames(java.lang.String filePath, java.io.FileFilter filter)
           
protected static boolean listFile(java.io.File file, java.io.FileFilter filter, java.util.Collection<java.lang.String> names)
           
static java.lang.String[] listFileNames(java.lang.String filePath, java.io.FileFilter filter)
           
static java.lang.String[] listTopFileNames(java.lang.String filePath, java.io.FileFilter filter)
           
static java.awt.Color makeColorBrighter(java.awt.Color color)
           
static java.awt.Color makeColorDarker(java.awt.Color color)
           
static java.lang.CharSequence trimCharSequence(java.lang.CharSequence charSequence)
          Returns a sub sequence of the specified CharSequence, with leading and trailing whitespace omitted.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WWUtil

public WWUtil()
Method Detail

alignComponent

public static void alignComponent(java.awt.Component parent,
                                  java.awt.Component child,
                                  java.lang.String alignment)

computeContrastingColor

public static java.awt.Color computeContrastingColor(java.awt.Color color)

convertStringToBoolean

public static java.lang.Boolean convertStringToBoolean(java.lang.String s)
Converts a specified string to a boolean value. Returns null if the string cannot be converted.

Parameters:
s - the string to convert.
Returns:
boolean value of the string, or null if the string cannot be converted.
Throws:
java.lang.IllegalArgumentException - if the string is null.

convertStringToDouble

public static java.lang.Double convertStringToDouble(java.lang.String s)
Converts a specified string to a floating point value. Returns null if the string cannot be converted.

Parameters:
s - the string to convert.
Returns:
floating point value of the string, or null if the string cannot be converted.
Throws:
java.lang.IllegalArgumentException - if the string is null.

convertStringToInteger

public static java.lang.Integer convertStringToInteger(java.lang.String s)
Converts a specified string to an integer value. Returns null if the string cannot be converted.

Parameters:
s - the string to convert.
Returns:
integer value of the string, or null if the string cannot be converted.
Throws:
java.lang.IllegalArgumentException - if the string is null.

convertStringToLong

public static java.lang.Long convertStringToLong(java.lang.String s)
Converts a specified string to a long integer value. Returns null if the string cannot be converted.

Parameters:
s - the string to convert.
Returns:
long integer value of the string, or null if the string cannot be converted.
Throws:
java.lang.IllegalArgumentException - if the string is null.

decodeColor

public static java.awt.Color decodeColor(java.lang.String encodedString)
Returns the Color described by the String encodedString. This understands Colors encoded with a call to encodeColor(java.awt.Color). If encodedString cannot be decoded, this method returns null.

Parameters:
encodedString - String to decode.
Returns:
Color decoded from the specified encodedString, or null if the String cannot be decoded.
Throws:
java.lang.IllegalArgumentException - If encodedString is null.

doListFileNames

protected static void doListFileNames(java.io.File file,
                                      java.io.FileFilter filter,
                                      boolean recurse,
                                      boolean exitBranchOnFirstMatch,
                                      java.util.Collection<java.lang.String> names)

doListFileNames

protected static java.lang.String[] doListFileNames(java.lang.String filePath,
                                                    java.io.FileFilter filter,
                                                    boolean recurse,
                                                    boolean exitBranchOnFirstMatch)

encodeColor

public static java.lang.String encodeColor(java.awt.Color color)
Returns a String encoding of the specified color. The Color can be restored with a call to decodeColor(String).

Parameters:
color - Color to encode.
Returns:
String encoding of the specified color.
Throws:
java.lang.IllegalArgumentException - If color is null.

isEmpty

public static boolean isEmpty(java.lang.Object s)
Determine whether an object reference is null or a reference to an empty string.

Parameters:
s - the refernce to examine.
Returns:
true if the reference is null or is a zero-length String.

listAllFileNames

public static java.lang.String[] listAllFileNames(java.lang.String filePath,
                                                  java.io.FileFilter filter)

listFile

protected static boolean listFile(java.io.File file,
                                  java.io.FileFilter filter,
                                  java.util.Collection<java.lang.String> names)

listFileNames

public static java.lang.String[] listFileNames(java.lang.String filePath,
                                               java.io.FileFilter filter)

listTopFileNames

public static java.lang.String[] listTopFileNames(java.lang.String filePath,
                                                  java.io.FileFilter filter)

makeColorBrighter

public static java.awt.Color makeColorBrighter(java.awt.Color color)

makeColorDarker

public static java.awt.Color makeColorDarker(java.awt.Color color)

trimCharSequence

public static java.lang.CharSequence trimCharSequence(java.lang.CharSequence charSequence)
Returns a sub sequence of the specified CharSequence, with leading and trailing whitespace omitted. If the CharSequence has length zero, this returns a reference to the CharSequence. If the CharSequence represents and empty character sequence, this returns an empty CharSequence.

Parameters:
charSequence - the CharSequence to trim.
Returns:
a sub sequence with leading and trailing whitespace omitted.
Throws:
java.lang.IllegalArgumentException - if the charSequence is null.

NASA World Wind