|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfr.cnes.genius.main.GComponent
fr.cnes.genius.lowLevel.GTextField
fr.cnes.genopus.time.GPDateOffsetField
public class GPDateOffsetField
Class implementing a dedicated field to hold date offsets.
| Nested Class Summary | |
|---|---|
static class |
GPDateOffsetField.GPOffsetFormat
Date formats. |
| Nested classes/interfaces inherited from class fr.cnes.genius.lowLevel.GTextField |
|---|
fr.cnes.genius.lowLevel.GTextField.GDocumentFieldFilterAbstract |
| Nested classes/interfaces inherited from class fr.cnes.genius.main.GComponent |
|---|
fr.cnes.genius.main.GComponent.CopyPasteOperation, fr.cnes.genius.main.GComponent.DisplayIndicatorStatus, fr.cnes.genius.main.GComponent.ItemType, fr.cnes.genius.main.GComponent.Operation |
| Field Summary |
|---|
| Fields inherited from class fr.cnes.genius.main.GComponent |
|---|
NAME_ATTRIBUTE |
| Constructor Summary | |
|---|---|
GPDateOffsetField(String widgetId,
String textValue)
Constructor. |
|
| Method Summary | |
|---|---|
void |
after(fr.cnes.genius.main.GEvent e)
|
void |
before(fr.cnes.genius.main.GEvent e)
|
String |
formatOffset()
Formats a given offset in seconds into the current format and units defined in the widget. |
static String |
formatOffset(double offset,
GPDateOffsetField.GPOffsetFormat format,
fr.cnes.genius.unit.GUnit outUnit)
Formats a given offset in seconds into the given format and converting to the given units (unit conversion is only needed if target format is fractional). |
static String |
formatOffsetCal(double offset)
Formats a given offset in seconds to the calendar format: [-]<DD... |
static String |
formatOffsetFrac(double offset,
fr.cnes.genius.unit.GUnit outUnit)
Formats a given offset in seconds, converting the value to the given units and rounding to a precision of 1 nanosecond. |
GPDateOffsetField.GPOffsetFormat |
getCurrentFormat()
Getter for the offset format. |
fr.cnes.genius.unit.GUnit |
getCurrentUnit()
Get the current unit. |
double |
getOffset()
Getter for the offset value in seconds. |
static double |
parseOffset(String stringOffset,
fr.cnes.genius.unit.GUnit inUnit)
Parse a given offset as a real number of seconds. |
static Double |
parseOffsetCal(String stringOffset)
Parse a given offset in Cal1 or Cal2 format as a real number of seconds. |
static Double |
parseOffsetFrac(String stringOffset,
fr.cnes.genius.unit.GUnit inUnit)
Parse a given offset in fraction format as a real number of seconds. |
void |
setCurrentFormat(GPDateOffsetField.GPOffsetFormat offsetFormat)
Setter for the offset format. |
void |
setCurrentUnit(fr.cnes.genius.unit.GUnit offsetUnit)
Setter for the offset unit. |
void |
setDefaultUnit(fr.cnes.genius.unit.GUnit unit)
Set the default unit. |
void |
setOffset(double offset)
Setter for the offset value in seconds. |
void |
setValue(String stringOffset)
Set offset from string. |
void |
setWidgetId(String widgetId)
|
| Methods inherited from class fr.cnes.genius.lowLevel.GTextField |
|---|
actionPerformed, computeDefaultWidth, display, focusGained, focusLost, getCharWidth, getComponent, getJTextField, getText, keyPressed, keyReleased, keyTyped, setDocumentFilter, setEnabled, setText |
| Methods inherited from class fr.cnes.genius.main.GComponent |
|---|
activateConstraintsByType, attachCopyPasteMenu, attachCopyPasteMenu, beginOfElement, beginOfElement, beginOfElement, beginOfElement, composeWidgetId, doDisplay, endOfElement, getCommentInConfigFile, getConstraint, getCurrentOperation, getDisplayIndicatorStatus, getDisplayIsModifiedIndicator, getElement, getGPanel, getGParent, getGUnitInConfigFile, getInnerDescendantConstraint, getName, getNameInConfigFile, getOperationSaveValue, getSimpleWidgetId, getStatus, getStringConstraint, getSubComponent, getWidgetId, handleCopyPasteEvent, handleProcessEventException, isCopyPasteEvent, isEnabled, isModified, launchInvalidPositionException, parseSimpleConstraint, processGEvent, setBusyCursor, setCommentInConfigFile, setConstraint, setCopyPasteMenuEnabled, setCurrentOperation, setDataForConstraintsByType, setDisplayIsModifiedIndicator, setElement, setGPanel, setGParent, setGUnitInConfigFile, setInnerDescendantConstraint, setNameAndCommentInConfigFile, setNameInConfigFile, setStatus, setStringConstraint, setToolTipText, setWidth, updateIsModifiedIndicator, writeCollection, writeCollection, writeCollection, writeCollection, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GPDateOffsetField(String widgetId,
String textValue)
widgetId - widget identifier.textValue - offset value as string.| Method Detail |
|---|
public void setWidgetId(String widgetId)
setWidgetId in class fr.cnes.genius.main.GComponent
public void setCurrentUnit(fr.cnes.genius.unit.GUnit offsetUnit)
throws GPDateException
offsetUnit - format in which the offset will be shown in the widget.
GPDateException - if given unit is not available in the widget.public fr.cnes.genius.unit.GUnit getCurrentUnit()
public void setDefaultUnit(fr.cnes.genius.unit.GUnit unit)
unit - default unit.public void setCurrentFormat(GPDateOffsetField.GPOffsetFormat offsetFormat)
offsetFormat - format in which the offset will be shown in the widget.public GPDateOffsetField.GPOffsetFormat getCurrentFormat()
public void setOffset(double offset)
throws GPDateException
offset - the offset in seconds to set.
GPDateException - if the absolute value of the offset in days is too high ( Long.MAX_VALUE
)public double getOffset()
public void setValue(String stringOffset)
throws GPDateException
stringOffset - string offset to set.
GPDateException - if offset is in bad format
public static String formatOffset(double offset,
GPDateOffsetField.GPOffsetFormat format,
fr.cnes.genius.unit.GUnit outUnit)
throws GPDateException
offset - offset in seconds to format.format - target format.outUnit - target unit (only if target format is fractional).
GPDateException - if the absolute value of the offset in days is too high ( Long.MAX_VALUE
)
public static String formatOffsetCal(double offset)
throws GPDateException
offset - offset in seconds to format.
GPDateException - if the absolute value of the offset in days is too high ( Long.MAX_VALUE
)
public static String formatOffsetFrac(double offset,
fr.cnes.genius.unit.GUnit outUnit)
offset - offset in seconds to format.outUnit - output unit for the formated offset.
public String formatOffset()
public static double parseOffset(String stringOffset,
fr.cnes.genius.unit.GUnit inUnit)
throws GPDateException
stringOffset - offset string to parseinUnit - the time unit in which the string offset is defined (only needed for fractional format if
string offset does not contain the unit)
GPDateException - if offset is in bad formatpublic static Double parseOffsetCal(String stringOffset)
stringOffset - offset string in Cal1 or Cal2 format to parse
public static Double parseOffsetFrac(String stringOffset,
fr.cnes.genius.unit.GUnit inUnit)
stringOffset - offset string in fraction format (days, hours, minutes...) to parseinUnit - the time unit in which the string offset is defined (only needed if string offset does not
contain the unit)
public void before(fr.cnes.genius.main.GEvent e)
throws fr.cnes.genius.exception.GException
before in interface fr.cnes.genius.main.GListenerbefore in class fr.cnes.genius.lowLevel.GTextFieldfr.cnes.genius.exception.GException
public void after(fr.cnes.genius.main.GEvent e)
throws GPDateException
after in interface fr.cnes.genius.main.GListenerafter in class fr.cnes.genius.lowLevel.GTextFieldGPDateException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||