|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bbn.openmap.layer.util.LayerUtils
A Class that provides some static methods useful for generic tasks within the layer, like changing a single string of File.separator paths into an array of Strings, and creating java.awt.Colors from a hex string.
To merge all of the functions that deal with handling properties, these methods have been moved to the com.bbn.openmap.util.PropUtils class. If you call these methods, they now simply call the same PropUtils method.
Constructor Summary | |
LayerUtils()
Deprecated. |
Method Summary | |
static boolean |
booleanFromProperties(java.util.Properties p,
java.lang.String propName,
boolean defaultValue)
Deprecated. Gets an boolean out of a properties object. |
static double |
doubleFromProperties(java.util.Properties p,
java.lang.String propName,
double defaultValue)
Deprecated. Gets a double out of a properties object. |
static float |
floatFromProperties(java.util.Properties p,
java.lang.String propName,
float defaultValue)
Deprecated. Gets an float out of a properties object. |
static java.lang.String[] |
getPropertiesAsStringArray(java.util.Properties props)
Deprecated. Converts a properties object to an array of Strings. |
static java.net.URL |
getResourceOrFileOrURL(java.lang.Class askingClass,
java.lang.String name)
Deprecated. Returns a URL that names either a resource, a local file, or an internet URL. |
static java.net.URL |
getResourceOrFileOrURL(java.lang.Object askingClass,
java.lang.String name)
Deprecated. Returns a URL that names either a resource, a local file, or an internet URL. |
static java.net.URL |
getResourceOrFileOrURL(java.lang.String name)
Deprecated. Returns a URL that names either a resource, a local file, or an internet URL. |
static java.lang.String[] |
initPathsFromProperties(java.util.Properties p,
java.lang.String propName)
Deprecated. Takes a string of `;' separated paths and returns an array of parsed strings. |
static int |
intFromProperties(java.util.Properties p,
java.lang.String propName,
int defaultValue)
Deprecated. Gets an integer out of a properties object. |
static java.lang.Object |
objectFromProperties(java.util.Properties p,
java.lang.String propName)
Deprecated. Creates an object out of a property name. |
static java.awt.Color |
parseColor(java.lang.String colorString)
Deprecated. Convert a string representing a 24/32bit hex color value into a Color value. |
static java.awt.Paint |
parseColorFromProperties(java.util.Properties p,
java.lang.String propName,
java.awt.Paint dfault)
Deprecated. Take a string from a properties file, representing the 24bit RGB or 32bit ARGB hex values for a color, and convert it to a java.awt.Color. |
static java.awt.Color |
parseColorFromProperties(java.util.Properties p,
java.lang.String propName,
java.lang.String dfault)
Deprecated. Take a string from a properties file, representing the 24bit RGB or 32bit ARGB hex values for a color, and convert it to a java.awt.Color. |
static java.lang.String[] |
stringArrayFromProperties(java.util.Properties p,
java.lang.String propName,
java.lang.String tok)
Deprecated. Takes a string of representing token separated properties and returns an array of parsed strings. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LayerUtils()
Method Detail |
public static java.lang.String[] initPathsFromProperties(java.util.Properties p, java.lang.String propName)
p
- propertiespropName
- the name of the property
public static int intFromProperties(java.util.Properties p, java.lang.String propName, int defaultValue)
p
- propertiespropName
- name of the property associated with the wanted
value.defaultValue
- what to return if the property name doesn't
exist, or if the value isn't a numerical value.
public static float floatFromProperties(java.util.Properties p, java.lang.String propName, float defaultValue)
p
- propertiespropName
- name of the property associated with the wanted
value.defaultValue
- what to return if the property name doesn't
exist, or if the value isn't a numerical value.
public static boolean booleanFromProperties(java.util.Properties p, java.lang.String propName, boolean defaultValue)
p
- propertiespropName
- name of the property associated with the wanted
value.defaultValue
- what to return if the property name doesn't
exist, or if the value isn't a numerical value.
public static java.lang.Object objectFromProperties(java.util.Properties p, java.lang.String propName)
p
- propertiespropName
- name of class to instantiate.
public static java.lang.String[] stringArrayFromProperties(java.util.Properties p, java.lang.String propName, java.lang.String tok)
p
- propertiespropName
- the name of the propertytok
- the characters separating the strings.
public static double doubleFromProperties(java.util.Properties p, java.lang.String propName, double defaultValue)
p
- propertiespropName
- name of the property associated with the wanted
value.defaultValue
- what to return if the property name doesn't
exist, or if the value isn't a numerical value.
public static java.awt.Color parseColorFromProperties(java.util.Properties p, java.lang.String propName, java.lang.String dfault) throws java.lang.NumberFormatException
p
- propertiespropName
- the name of the propertydfault
- color to use if the property value doesn't work
java.lang.NumberFormatException
- if the specified string cannot
be interpreted as a hexidecimal integerColorFactory.parseColorFromProperties(Properties, String,
String, boolean)
public static java.awt.Paint parseColorFromProperties(java.util.Properties p, java.lang.String propName, java.awt.Paint dfault) throws java.lang.NumberFormatException
p
- propertiespropName
- the name of the propertydfault
- color to use if the property value doesn't work
java.lang.NumberFormatException
- if the specified string cannot
be interpreted as a hexidecimal integerColorFactory.parseColorFromProperties(Properties, String,
String, boolean)
public static java.awt.Color parseColor(java.lang.String colorString) throws java.lang.NumberFormatException
colorString
- the 24/32bit hex string value (ARGB)
java.lang.NumberFormatException
- if the specified string cannot
be interpreted as a hexidecimal integerColorFactory.parseColor(String, boolean)
public static java.lang.String[] getPropertiesAsStringArray(java.util.Properties props)
props
- the properties object to convert.
public static java.net.URL getResourceOrFileOrURL(java.lang.String name) throws java.net.MalformedURLException
name
- name of the resource, file or URL.
java.net.MalformedURLException
public static java.net.URL getResourceOrFileOrURL(java.lang.Object askingClass, java.lang.String name) throws java.net.MalformedURLException
askingClass
- the object asking for the URL.name
- name of the resource, file or URL.
java.net.MalformedURLException
public static java.net.URL getResourceOrFileOrURL(java.lang.Class askingClass, java.lang.String name) throws java.net.MalformedURLException
askingClass
- the class asking for the URL. Can be null.name
- name of the resource, file or URL.
java.net.MalformedURLException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |