public class GPDateField
extends fr.cnes.genius.lowLevel.GTextField
implements fr.cnes.genius.main.GListener
Modifier and Type | Class and Description |
---|---|
static class |
GPDateField.GPDateFormat
Date formats.
|
Constructor and Description |
---|
GPDateField()
Empty constructor.
|
GPDateField(fr.cnes.sirius.patrius.time.AbsoluteDate date,
fr.cnes.sirius.patrius.time.TimeScale timeScale)
Constructor.
|
GPDateField(String widgetId,
fr.cnes.sirius.patrius.time.AbsoluteDate date,
fr.cnes.sirius.patrius.time.TimeScale timeScale)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
after(fr.cnes.genius.main.GEvent e) |
void |
before(fr.cnes.genius.main.GEvent e) |
static String |
formatDate(fr.cnes.sirius.patrius.time.AbsoluteDate date,
fr.cnes.sirius.patrius.time.TimeScale timeScale,
GPDateField.GPDateFormat dateFormat)
Format an AbsoluteDate in the specified format-origin.
|
static String |
formatDateCal(fr.cnes.sirius.patrius.time.AbsoluteDate date,
fr.cnes.sirius.patrius.time.TimeScale timeScale)
Format an AbsoluteDate in calendar format: <DD>/<MM>/<YYYY>
<HH>h<MM>m<SS>s[<AAA>ms][<BBB>us][<CCC>ns].
|
static String |
formatDateISO8601(fr.cnes.sirius.patrius.time.AbsoluteDate date,
fr.cnes.sirius.patrius.time.TimeScale timeScale)
Format an AbsoluteDate in ISO-8601 format:
<YYYY>-<MM>-<DD>T<HH>:<MM>:<SS.SSSSSSSSS>.
|
static String |
formatDateJJ(fr.cnes.sirius.patrius.time.AbsoluteDate date,
fr.cnes.sirius.patrius.time.AbsoluteDate dateOrigin,
fr.cnes.sirius.patrius.time.TimeScale timeScale)
|
static String |
formatDateJJSec(fr.cnes.sirius.patrius.time.AbsoluteDate date,
fr.cnes.sirius.patrius.time.AbsoluteDate dateOrigin,
fr.cnes.sirius.patrius.time.TimeScale timeScale)
|
fr.cnes.sirius.patrius.time.AbsoluteDate |
getDate()
Date getter.
|
GPDateField.GPDateFormat |
getFormat()
Date format-origin getter.
|
fr.cnes.sirius.patrius.time.TimeScale |
getScale()
Time scale getter.
|
static fr.cnes.sirius.patrius.time.AbsoluteDate |
parseDateCal(String stringDate,
fr.cnes.sirius.patrius.time.TimeScale timeScale)
Parse a given date string in calendar format as an AbsoluteDate.
|
static fr.cnes.sirius.patrius.time.AbsoluteDate |
parseDateISO8601(String stringDate,
fr.cnes.sirius.patrius.time.TimeScale timeScale)
Parse a given date string in ISO-8601 format as an AbsoluteDate.
|
fr.cnes.sirius.patrius.time.AbsoluteDate |
parseDateJJ(String stringDate,
fr.cnes.sirius.patrius.time.TimeScale timeScale)
Parse a given date string in jj format as an AbsoluteDate.
|
fr.cnes.sirius.patrius.time.AbsoluteDate |
parseDateJJSec(String stringDate,
fr.cnes.sirius.patrius.time.TimeScale timeScale)
Parse a given date string in jj_sec format as an AbsoluteDate.
|
fr.cnes.sirius.patrius.time.AbsoluteDate |
parseDateString(String stringDate,
fr.cnes.sirius.patrius.time.TimeScale timeScale)
Parse a given date string as an AbsoluteDate.
|
void |
setDate(fr.cnes.sirius.patrius.time.AbsoluteDate date)
Date setter.
|
void |
setEnabled(boolean b) |
void |
setFormat(GPDateField.GPDateFormat dateFormat)
Date format-origin setter.
|
void |
setScale(fr.cnes.sirius.patrius.time.TimeScale timeScale)
Time scale setter.
|
void |
setValue(String stringDate)
Set date from string.
|
void |
setWidgetId(String widgetId) |
actionPerformed, computeDefaultWidth, display, focusGained, focusLost, getCharWidth, getComponent, getJTextField, getText, keyPressed, keyReleased, keyTyped, setDocumentFilter, setText
activateConstraintsByType, attachCopyPasteMenu, attachCopyPasteMenu, beginOfElement, beginOfElement, beginOfElement, beginOfElement, clearAllInnerDescendantConstraint, clearConstraint, clearInnerDescendantContraint, composeWidgetId, doDisplay, endOfElement, getCommentInConfigFile, getConstraint, getCurrentOperation, getDisplayIndicatorStatus, getDisplayIsModifiedIndicator, getElement, getGClassName, getGPanel, getGParent, getGUnitInConfigFile, getInnerDescendantConstraint, getName, getNameInConfigFile, getOperationSaveValue, getPathInConfigFile, getSimpleWidgetId, getStatus, getStringConstraint, getSubComponent, getWidgetId, handleCopyPasteEvent, handleCopyPasteEvent, handleProcessEventException, isCopyPasteEvent, isEnabled, isForcedStatus, isModified, launchInvalidPositionException, mouseWheelMoved, parseSimpleConstraint, processGEvent, processMouseWheelEvent, setBusyCursor, setCommentInConfigFile, setConstraint, setCopyPasteMenuEnabled, setCurrentOperation, setDataForConstraintsByType, setDefaultConstraints, setDisplayIsModifiedIndicator, setElement, setForcedStatus, setGPanel, setGParent, setGUnitInConfigFile, setInnerDescendantConstraint, setName, setNameAndCommentInConfigFile, setNameInConfigFile, setPathInConfigFile, setStatus, setStringConstraint, setToolTipText, setWidth, setWindowBusyCursor, updateIsModifiedIndicator, writeCollection, writeCollection, writeCollection, writeCollection, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem
public GPDateField()
public GPDateField(fr.cnes.sirius.patrius.time.AbsoluteDate date, fr.cnes.sirius.patrius.time.TimeScale timeScale)
date
- initial date.timeScale
- time scale in which the date is defined.public GPDateField(String widgetId, fr.cnes.sirius.patrius.time.AbsoluteDate date, fr.cnes.sirius.patrius.time.TimeScale timeScale)
widgetId
- widget identifier.date
- initial date.timeScale
- time scale in which the date is defined.public void setWidgetId(String widgetId)
setWidgetId
in class fr.cnes.genius.main.GComponent
public fr.cnes.sirius.patrius.time.AbsoluteDate getDate()
public void setDate(fr.cnes.sirius.patrius.time.AbsoluteDate date) throws fr.cnes.genius.exception.GArithmeticException
date
- date to set in the DateFieldfr.cnes.genius.exception.GArithmeticException
- if date contains NaN seconds.public void setValue(String stringDate) throws GPDateException
stringDate
- date to set in the DateFieldGPDateException
- if string is in bad format.public fr.cnes.sirius.patrius.time.TimeScale getScale()
public void setScale(fr.cnes.sirius.patrius.time.TimeScale timeScale)
timeScale
- time scale in which to show the date in the DateFieldpublic void setFormat(GPDateField.GPDateFormat dateFormat)
dateFormat
- format (and origin) in which the date will be shown in the DateFieldpublic GPDateField.GPDateFormat getFormat()
public static String formatDate(fr.cnes.sirius.patrius.time.AbsoluteDate date, fr.cnes.sirius.patrius.time.TimeScale timeScale, GPDateField.GPDateFormat dateFormat) throws fr.cnes.genius.exception.GArithmeticException
date
- date to formattimeScale
- date time scaledateFormat
- date format-originfr.cnes.genius.exception.GArithmeticException
- if date contains NaN secondspublic static String formatDateCal(fr.cnes.sirius.patrius.time.AbsoluteDate date, fr.cnes.sirius.patrius.time.TimeScale timeScale) throws fr.cnes.genius.exception.GArithmeticException
date
- date to formattimeScale
- date time scalefr.cnes.genius.exception.GArithmeticException
- if date contains NaN secondspublic static String formatDateISO8601(fr.cnes.sirius.patrius.time.AbsoluteDate date, fr.cnes.sirius.patrius.time.TimeScale timeScale) throws fr.cnes.genius.exception.GArithmeticException
date
- date to formattimeScale
- date time scalefr.cnes.genius.exception.GArithmeticException
- if date contains NaN seconds.public static String formatDateJJ(fr.cnes.sirius.patrius.time.AbsoluteDate date, fr.cnes.sirius.patrius.time.AbsoluteDate dateOrigin, fr.cnes.sirius.patrius.time.TimeScale timeScale) throws fr.cnes.genius.exception.GArithmeticException
date
- date to formatdateOrigin
- origin of datetimeScale
- date time scalefr.cnes.genius.exception.GArithmeticException
- if date or dateOrigin contains NaN seconds.public static String formatDateJJSec(fr.cnes.sirius.patrius.time.AbsoluteDate date, fr.cnes.sirius.patrius.time.AbsoluteDate dateOrigin, fr.cnes.sirius.patrius.time.TimeScale timeScale) throws fr.cnes.genius.exception.GArithmeticException
date
- date to formatdateOrigin
- origin of datetimeScale
- date time scalefr.cnes.genius.exception.GArithmeticException
- if date or dateOrigin contains NaN seconds.public fr.cnes.sirius.patrius.time.AbsoluteDate parseDateString(String stringDate, fr.cnes.sirius.patrius.time.TimeScale timeScale) throws GPDateException
stringDate
- date string to parse in calendar, jj or jj_sec (1950 or 2000) formattimeScale
- time scaleGPDateException
- if calendar date or reference epoch does not exist or if date cannot be parsed
(because of
bad format or non existing date or reference epoch)public static fr.cnes.sirius.patrius.time.AbsoluteDate parseDateCal(String stringDate, fr.cnes.sirius.patrius.time.TimeScale timeScale) throws GPDateException
stringDate
- date string in calendar format to parsetimeScale
- time scaleGPDateException
- if calendar date does not existpublic static fr.cnes.sirius.patrius.time.AbsoluteDate parseDateISO8601(String stringDate, fr.cnes.sirius.patrius.time.TimeScale timeScale) throws GPDateException
stringDate
- date string in calendar format to parsetimeScale
- time scaleGPDateException
- if formatted date does not existpublic fr.cnes.sirius.patrius.time.AbsoluteDate parseDateJJ(String stringDate, fr.cnes.sirius.patrius.time.TimeScale timeScale) throws GPDateException
stringDate
- date string in jj format to parsetimeScale
- time scaleGPDateException
- if reference epoch does not existpublic fr.cnes.sirius.patrius.time.AbsoluteDate parseDateJJSec(String stringDate, fr.cnes.sirius.patrius.time.TimeScale timeScale) throws GPDateException
stringDate
- date string in jj_sec format to parsetimeScale
- time scaleGPDateException
- if reference epoch does not existpublic void setEnabled(boolean b)
setEnabled
in class fr.cnes.genius.lowLevel.GTextField
public void before(fr.cnes.genius.main.GEvent e)
before
in interface fr.cnes.genius.main.GListener
before
in class fr.cnes.genius.lowLevel.GTextField
public void after(fr.cnes.genius.main.GEvent e) throws GPDateException
after
in interface fr.cnes.genius.main.GListener
after
in class fr.cnes.genius.lowLevel.GTextField
GPDateException
Copyright © 2023. All rights reserved.