|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.cesilko.rachota.gui.Tools
public class Tools
Helper class providing support for time conversion between long, Date and String formats and other static functions.
Field Summary | |
---|---|
static int |
BEEP_NOTIFICATION
Notification type of beep. |
static int |
BEEP_WARNING
Warning type of beep. |
static java.lang.String |
build
Build number. |
static java.lang.String |
title
Name and version of application. |
Constructor Summary | |
---|---|
Tools()
|
Method Summary | |
---|---|
static void |
beep(int type)
Produce couple of warning beeps at user when necessary. |
static java.awt.Font |
getFont()
Returns font that should be used for all UI components based on the language preferences or specified by user. |
static long |
getInactivity()
|
static java.lang.String |
getRID()
Returns unique Rachota identification string. |
static java.lang.String |
getTime(java.util.Date time)
Transforms time of Date to text string. |
static java.lang.String |
getTime(double time)
Transforms time in milliseconds to text string. |
static long |
getTime(java.lang.String text)
Transforms text string to time in milliseconds. |
static java.lang.String |
getTimeShort(double time)
Transforms time in milliseconds to text string. |
static long |
getTotalTime(boolean includeIdleTime,
boolean includePrivateTime,
java.util.Vector days)
Returns total time measured in selected period. |
static void |
recordActivity()
|
static java.lang.String |
replaceAll(java.lang.String text,
java.lang.String oldText,
java.lang.String newText)
Returns text string that has all occurences of oldText strings replaced by newText string. |
static void |
setupSelectAllListener(javax.swing.JSpinner spinner)
Sets up a focus gained listener to the JSpinner that selects all text
currently in the text field of the supplied JSpinner . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String title
public static final java.lang.String build
public static final int BEEP_WARNING
public static final int BEEP_NOTIFICATION
Constructor Detail |
---|
public Tools()
Method Detail |
---|
public static java.lang.String getTime(double time)
time
- Time in milliseconds.
public static java.lang.String getTimeShort(double time)
time
- Time in milliseconds.
public static java.lang.String getTime(java.util.Date time)
time
- Time in Date object.
public static long getTime(java.lang.String text) throws java.lang.NumberFormatException
text
- Textual representation of time in format hh:mm or hh:mm:ss.
java.lang.NumberFormatException
- in case format of time does not comply with hh:mm:ss format.public static long getTotalTime(boolean includeIdleTime, boolean includePrivateTime, java.util.Vector days)
includeIdleTime
- Should idle time be included in the total time?includePrivateTime
- Should private time be included in the total time?days
- Vector of days whose total time should be counted.
public static java.lang.String replaceAll(java.lang.String text, java.lang.String oldText, java.lang.String newText)
text
- String where all occurences of oldText should be replaced.oldText
- Substring to be searched for in text string.newText
- New replacement string for all occurences of oldText string.
public static void beep(int type)
type
- Type of beep i.e. BEEP_NOTIFICATION or BEEP_WARNING.public static java.lang.String getRID()
public static java.awt.Font getFont()
public static void recordActivity()
public static long getInactivity()
public static void setupSelectAllListener(javax.swing.JSpinner spinner)
JSpinner
that selects all text
currently in the text field of the supplied JSpinner
.
spinner
- The JSpinner
to add a select all listener to.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |