|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.curre.prefcount.util.Utilities
public class Utilities
Object of this class represents a set of common utilities for prefcount.
Created date: Apr 7, 2007
| Nested Class Summary | |
|---|---|
static class |
Utilities.FieldType
Enumeration tha represents a field type. |
static class |
Utilities.PlatformType
Enumeration tha represents a platform/os type. |
| Field Summary | |
|---|---|
static java.util.Calendar |
lastTime
Helper object to be used in the printTime() method. |
| Constructor Summary | |
|---|---|
Utilities()
|
|
| Method Summary | |
|---|---|
static java.awt.Color |
createDarkerColor(java.awt.Color color,
int decrease)
Creates a new color that is darker than the passed color according to the passed int parameter. |
static javax.swing.ImageIcon |
createImage(java.lang.String fileName)
Creates a gif image for the given file name (image file is expected to be in the images/ directory relative to the net.curre.prefcount.App class). |
static java.awt.Dimension |
determineSizeOfString(java.awt.Graphics2D g2,
java.lang.String str)
Computes the size of the passed String. |
static void |
displayMessageInFrame(java.lang.String messageKey)
Opens a new frame and displayes a message in it (given its resource key). |
static java.lang.String |
getFirstLetterFromField(javax.swing.JTextField field)
Returns capitalized first letter from the passed text field or null if the text field is empty. |
static Utilities.PlatformType |
getPlatformType()
Determines the platform/os type we are running on. |
static boolean |
isMacOs()
Returns true if we are running on Mac OS; false otehrwise. |
static int |
parseIntFromTextField(javax.swing.JTextField field)
Gets and parses text from the given text field. |
static void |
printAvailableFonts()
Displays available fonts in a frame. |
static void |
printLookAndFeels()
Prints available looks and feels. |
static void |
printTime(java.lang.String msg)
This method is used for debugging purposes to print timestamps and the elapsed time since the last call to this method. |
static java.lang.String |
underlineLetter(java.lang.String str,
int ind)
Underlines a letter in the given string at the given position; note, that the string is converted to html. |
static boolean |
validateTextField(javax.swing.JTextField field,
Utilities.FieldType type)
Validates if the passed component value is valid. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static java.util.Calendar lastTime
| Constructor Detail |
|---|
public Utilities()
| Method Detail |
|---|
public static boolean validateTextField(javax.swing.JTextField field,
Utilities.FieldType type)
field - Input field, which value to validate.type - Type of the value to check (i.e. Utilities.TYPE_INTEGER).
public static java.lang.String getFirstLetterFromField(javax.swing.JTextField field)
field - Text field to read.
public static int parseIntFromTextField(javax.swing.JTextField field)
field - Text field to parse.
java.lang.NumberFormatException - If text field contains an invalid integer.
public static java.awt.Dimension determineSizeOfString(java.awt.Graphics2D g2,
java.lang.String str)
g2 - Graphics object to use.str - String to be measured.
Dimension object.public static javax.swing.ImageIcon createImage(java.lang.String fileName)
fileName - File name without extention.
public static java.lang.String underlineLetter(java.lang.String str,
int ind)
str - String to underline.ind - Letter index, which to underline.
public static java.awt.Color createDarkerColor(java.awt.Color color,
int decrease)
color - Model color.decrease - Value to be subtracted from the RGB chanels of the model color.
public static void displayMessageInFrame(java.lang.String messageKey)
messageKey - Message key.public static void printTime(java.lang.String msg)
msg - Message to add to the print statement.public static void printLookAndFeels()
public static void printAvailableFonts()
public static Utilities.PlatformType getPlatformType()
public static boolean isMacOs()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||