|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.java.sip.communicator.util.GuiUtils
public class GuiUtils
The StringUtils class is used through this ui implementation for some special operations with strings.
| Field Summary | |
|---|---|
static long |
MILLIS_PER_DAY
Number of milliseconds in a standard day. |
static long |
MILLIS_PER_HOUR
Number of milliseconds in a standard hour. |
static long |
MILLIS_PER_MINUTE
Number of milliseconds in a standard minute. |
static long |
MILLIS_PER_SECOND
Number of milliseconds in a second. |
| Constructor Summary | |
|---|---|
GuiUtils()
|
|
| Method Summary | |
|---|---|
static void |
addWindow(Window w)
Adds a Window into window list |
static int |
compareDates(Date date1,
Date date2)
Compares the two dates. |
static int |
compareDates(long date1,
long date2)
Compares the two dates. |
static int |
compareDatesOnly(long date1,
long date2)
Compares the two dates. |
static int |
countOccurrences(String text,
char needle)
Counts occurrences of the needle character in the given text. |
static String |
formatDate(Date date)
Formats the given date. |
static String |
formatDate(long date)
Formats the given date. |
static void |
formatDate(long date,
StringBuffer dateStrBuf)
Formats the given date as: Month DD, YYYY and appends it to the given dateStrBuf string buffer. |
static String |
formatSeconds(long millis)
Formats the given long to X hour, Y min, Z sec. |
static String |
formatTime(Date date)
Formats the time for the given date. |
static String |
formatTime(Date startDate,
Date endDate)
Formats the time period duration for the given start date and end date. |
static String |
formatTime(long time)
Formats the time for the given date. |
static String |
formatTime(long start,
long end)
Formats the time period duration for the given start date and end date. |
static int |
getComponentIndex(Component c,
Container container)
Returns the index of the given component in the given container. |
static Rectangle2D |
getDefaultStringSize(String text)
Returns the bounds of the given string. |
static Dimension |
getStringSize(Component c,
String text)
Returns the size of the given text computed towards to the given component. |
static int |
getStringWidth(Component c,
String text)
Returns the width in pixels of a text. |
static Window[] |
getWindows()
Returns an array of all Windows, both owned and ownerless,
created by this application. |
static void |
removeWindow(Window w)
Removes a Window into window list |
static String |
replaceSpecialRegExpChars(String text)
Replaces some chars that are special in a regular expression. |
static void |
updateComponentTreeUI(Component c)
A simple minded look and feel change: ask each node in the tree to updateUI() -- that is, to initialize its UI property
with the current look and feel. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final long MILLIS_PER_SECOND
public static final long MILLIS_PER_MINUTE
public static final long MILLIS_PER_HOUR
public static final long MILLIS_PER_DAY
| Constructor Detail |
|---|
public GuiUtils()
| Method Detail |
|---|
public static String replaceSpecialRegExpChars(String text)
text - The initial text.
public static int getStringWidth(Component c,
String text)
c - the component where the text is containedtext - the text to measure
public static Dimension getStringSize(Component c,
String text)
c - the component where the text is containedtext - the text to measure
public static Rectangle2D getDefaultStringSize(String text)
text - the string to measure
public static int countOccurrences(String text,
char needle)
text - the text in which we searchneedle - the character we're looking for
public static int compareDates(Date date1,
Date date2)
date1 - the first date to comparedate2 - the second date to compare with
public static int compareDates(long date1,
long date2)
date1 - the first date to comparedate2 - the second date to compare with
public static int compareDatesOnly(long date1,
long date2)
date1 - the first date to comparedate2 - the second date to compare with
public static String formatDate(Date date)
date - the date to format
public static String formatDate(long date)
date - the date to format
public static void formatDate(long date,
StringBuffer dateStrBuf)
date - the date to formatdateStrBuf - the StringBuffer, where to append the
formatted datepublic static String formatTime(Date date)
date - the date to format
public static String formatTime(long time)
time - the date to format
public static String formatTime(Date startDate,
Date endDate)
startDate - the start dateendDate - the end date
public static String formatTime(long start,
long end)
start - the start date in millisecondsend - the end date in milliseconds
public static String formatSeconds(long millis)
millis - the time in milliseconds to format
public static Window[] getWindows()
Windows, both owned and ownerless,
created by this application.
If called from an applet, the array includes only the Windows
accessible by that applet.
Warning: this method may return system created windows, such
as a print dialog. Applications should not assume the existence of
these dialogs, nor should an application assume anything about these
dialogs such as component positions, LayoutManagers
or serialization.
Windows.public static void addWindow(Window w)
Window into window list
w - Window to be added.public static void removeWindow(Window w)
Window into window list
w - Window to be removed.public static void updateComponentTreeUI(Component c)
updateUI() -- that is, to initialize its UI property
with the current look and feel.
c - UI component.
public static int getComponentIndex(Component c,
Container container)
c - the Component to look forcontainer - the parent container, where this component is added
|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||