| java.lang.Object de.gulden.util.Toolbox
Toolbox | public class Toolbox (Code) | | Class Toolbox.
author: Jens Gulden version: snapshot-beautyj-1.1 |
Field Summary | |
final public static int | CENTER Constant CENTER. | final public static int | EAST Constant EAST. | final public static String | NL Constant NL. | final public static int | NORTH Constant NORTH. | final public static int | NORTH_EAST Constant NORTH_EAST. | final public static int | NORTH_WEST Constant NORTH_WEST. | final public static int | SOUTH Constant SOUTH. | final public static int | SOUTH_EAST Constant SOUTH_EAST. | final public static int | SOUTH_WEST Constant SOUTH_WEST. | final public static int | WEST Constant WEST. |
Method Summary | |
public static int | abs(int i) | public static boolean | arrayContains(Object[] array, Object object) Tests if an element is contained in an array, based on a test using equals(...). | public static String | capitalize(String s) | public static void | centerComponent(Component component, Component parent) | public static void | centerOnScreen(Component component) | public static int | decimal(String hex) | public static void | drawString(Graphics g, String s, Point p, int anchor, Insets shift, Color backgroundColor, Insets backgroundBorder) | public static void | drawString(Graphics g, String s, Point p, int anchor, Insets shift) | public static void | drawString(Graphics g, String s, Point p, int anchor) | public static boolean | empty(String s) | public static String | emptyNull(String s) Returns null if the String has zero size, or is already null itself. | public static List | explode(String s, char seperator) | public static List | explode(String s) | public static Collection | filterCollectionOnType(Collection c, Class type) | public static Map | filterMapOnType(Map m, Class type) | public static Component | findChildComponent(Container c, Class childType) | public static Component | findChildComponentCloseTo(Container c, Class childType, Component anker) | public static URL | findResource(String resString, Object ref) | public static URL | findResource(String resString, ClassLoader cl) | public static void | fireEvent(Collection listeners, String methodName, EventObject event) | public static String | getDocumentText(Document d) Returns the document text. | public static List | getLines(String s) Returns the lines. | public static Class | getPrimitiveTypeClass(String typename) Returns the primitive type class. | public static Class | getPrimitiveTypeWrapperClass(String typename) Returns the primitive type wrapper class. | public static URL | getResourceURL(String resString) Converts a String to a URL. | public static String | hex(int i) | public static String | hex(int i, int minLength) | public static String | implode(Collection c, char separator) | public static String | implode(Collection c) | public static Object | instantiateClass(String classname, Class ensureType) Loads a class and instantiates it. | public static Object | invokeMethod(Object o, String methodName, Class[] signature, Object[] parameters) | public static Object | invokeMethod(Object o, String methodName, Class signatureSingle, Object parameterSingle) | public static List | invokeOnAll(Collection c, String methodName, Class[] signature, Object[] parameter) | public static Object | invokeValueOf(Class clazz, String s) | public static boolean | isEmpty(String s) | public static boolean | isNo(String s) | public static boolean | isPrimitiveType(String typename) | public static boolean | isYes(String s) | public static String | noNull(String s) | public static String | padLeft(String s, String fill, int len) | public static String | padRight(String s, String fill, int len) | public static boolean | parseBoolean(String s) Parses the boolean. | public static Color | parseColor(String s) Parses the color. | public static Properties | parseKeyValuePairs(String s) Parse key/value pairs in a string. | public static String | repeat(String s, int count) | public static String | repeat(char c, int count) | public static String | replace(String s, String search, String repl) | public static String | replaceCharsWithStrings(String s, char[] c, String[] r) | public static void | setDocumentText(Document d, String s) Sets the document text. | public static void | setLocationCentered(Component c, Point p) Sets the location centered. | public static String | toString(Color color) | public static String | trimLeft(String s) Removes all whitespace at the start of the string. | public static String | trimRight(String s) Removes all whitespace at the end of the string. | public static String | unqualify(String s) | public static String | unqualifyJavaName(String name) |
CENTER | final public static int CENTER(Code) | | Constant CENTER.
|
EAST | final public static int EAST(Code) | | Constant EAST.
|
NORTH | final public static int NORTH(Code) | | Constant NORTH.
|
NORTH_EAST | final public static int NORTH_EAST(Code) | | Constant NORTH_EAST.
|
NORTH_WEST | final public static int NORTH_WEST(Code) | | Constant NORTH_WEST.
|
SOUTH | final public static int SOUTH(Code) | | Constant SOUTH.
|
SOUTH_EAST | final public static int SOUTH_EAST(Code) | | Constant SOUTH_EAST.
|
SOUTH_WEST | final public static int SOUTH_WEST(Code) | | Constant SOUTH_WEST.
|
WEST | final public static int WEST(Code) | | Constant WEST.
|
abs | public static int abs(int i)(Code) | | |
arrayContains | public static boolean arrayContains(Object[] array, Object object)(Code) | | Tests if an element is contained in an array, based on a test using equals(...).
|
emptyNull | public static String emptyNull(String s)(Code) | | Returns null if the String has zero size, or is already null itself.
Otherwise returns the string.
Parameters: s - the String to test |
getResourceURL | public static URL getResourceURL(String resString) throws MalformedURLException(Code) | | Converts a String to a URL. If the string starts with "res:/",
this leading part is cut off and the URL is created via ClassLoader.getResource().
Otherwise, the URL is created sirectly from the String.
|
isPrimitiveType | public static boolean isPrimitiveType(String typename)(Code) | | |
parseBoolean | public static boolean parseBoolean(String s)(Code) | | Parses the boolean.
|
parseKeyValuePairs | public static Properties parseKeyValuePairs(String s)(Code) | | Parse key/value pairs in a string. Key and value are sperated by '='.
the pairs are seperated by whitespace or ';'.
Multiple occurrences of the same key will result in a String[]-array
parse result for that key.
Parameters: s - The string to parse. Properties, with value entries either of type String or String[] |
setDocumentText | public static void setDocumentText(Document d, String s)(Code) | | Sets the document text.
|
setLocationCentered | public static void setLocationCentered(Component c, Point p)(Code) | | Sets the location centered.
|
trimLeft | public static String trimLeft(String s)(Code) | | Removes all whitespace at the start of the string.
|
trimRight | public static String trimRight(String s)(Code) | | Removes all whitespace at the end of the string.
|
|
|