![]() | [using it] | Interface Manipulation Package v4.0 (2008-06-25) | ![]() | ©copyright | ![]() |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
imp.gui.IComponent
imp.gui.DateInput
public class DateInput
Defines a date editor of the form year-month-day.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.BaselineResizeBehavior |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent |
---|
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Method Summary | |
---|---|
long |
getValue()
Gets the last input value. |
void |
outputValue(long value)
Called when a value is output. |
void |
outputValue(String value)
Called when a value is output. |
DateInput |
setFormat(String format)
Sets the display format and return this. |
DateInput |
setLocale(String localization)
Sets the display localization and return this. |
DateInput |
setMax(int max)
Sets the year max value and return this, default is 2020. |
DateInput |
setMin(int min)
Sets the year min value and return this, default is 1900. |
DateInput |
setValue(long value)
Sets the default value and return this. |
static long |
toDate(String localization,
String format,
String date)
Gets the date represented by the given string. |
static String |
toString(String localization,
String format,
long date)
Gets a string representation of the given date. |
Methods inherited from class imp.gui.IComponent |
---|
getBgcolor, getColor, getTextFont, getTitle, getTooltip, grab, refresh, setBgcolor, setColor, setHeight, setTextFont, setTitle, setTooltip, setWidth |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public long getValue()
public void outputValue(long value)
value
- A date as time in milliseconds after January 1, 1970 00:00:00 GMT.public void outputValue(String value)
value
- A date, using the specified format.public DateInput setFormat(String format)
format
- A string of the form date:verbosity, time:verbosity or date-time:verbosity
where verbosity defines the string representation, either standard (default), numeric, short, long, full.public DateInput setLocale(String localization)
localization
- A string of the form language_country:zone, language_country, language:zone, language or :zone
(e.g. en_US:America/Chicago) where the The language is a lowercase two-letter ISO-639 code. |
The country is an uppercase two-letter ISO-3166 code. |
The zone is either a time-zone abbreviation such as "PST", or a full name such as "America/Chicago", or a custom ID such as "GMT-8:00". |
public DateInput setMax(int max)
public DateInput setMin(int min)
public DateInput setValue(long value)
value
- A date as time in milliseconds after January 1, 1970 00:00:00 GMT. public static long toDate(String localization, String format, String date)
localization
- A string of the form language_country:zone, language_country, language:zone, language or :zone
(e.g. en_US:America/Chicago) where the The language is a lowercase two-letter ISO-639 code. |
The country is an uppercase two-letter ISO-3166 code. |
The zone is either a time-zone abbreviation such as "PST", or a full name such as "America/Chicago", or a custom ID such as "GMT-8:00". |
format
- A string of the form date:verbosity, time:verbosity or date-time:verbosity
where verbosity defines the string representation, either standard (default), numeric, short, long, full.date
- The date value using the locale format or the standard YYYY-MM-DD HH:MM:SS.mmm numerical format.
IllegalArgumentException
- If the string does not represent a valid date.public static String toString(String localization, String format, long date)
localization
- A string of the form language_country:zone, language_country, language:zone, language or :zone
(e.g. en_US:America/Chicago) where the The language is a lowercase two-letter ISO-639 code. |
The country is an uppercase two-letter ISO-3166 code. |
The zone is either a time-zone abbreviation such as "PST", or a full name such as "America/Chicago", or a custom ID such as "GMT-8:00". |
format
- A string of the form date:verbosity, time:verbosity or date-time:verbosity
where verbosity defines the string representation, either numeric, short, long or full (default).date
- The date as time in milliseconds after January 1, 1970 00:00:00 GMT.