fr.cnes.genopus.time
Class GPAbsoluteDate

java.lang.Object
  extended by fr.cnes.genius.main.GComponent
      extended by fr.cnes.genius.lowLevel.GContainer
          extended by fr.cnes.genopus.time.GPAbsoluteDate
All Implemented Interfaces:
fr.cnes.genius.main.GClear, fr.cnes.genius.main.GDisplay, fr.cnes.genius.main.GListener, fr.cnes.genius.main.GReadWrite, GPPatrius<org.orekit.time.AbsoluteDate>

public class GPAbsoluteDate
extends fr.cnes.genius.lowLevel.GContainer
implements fr.cnes.genius.main.GReadWrite, fr.cnes.genius.main.GListener, fr.cnes.genius.main.GDisplay, fr.cnes.genius.main.GClear, GPPatrius<org.orekit.time.AbsoluteDate>

Widget representing an OREKIT AbsoluteDate. This widget represents a date in different formats-origins and time scales. It also allows to compute a date as an offset from a previous date. Allowed formats-origins:

- Cal: <DD>/<MM>/<YYYY> <HH>h<MM>m<SS>s[<AAA>ms][<BBB>us][<CCC>ns] or <DD> <MM> <YYYY> <HH> <MM> <SS>[ <AAA>[ <BBB>[ <CCC>]]]
- ISO-8601: <YYYY>-<MM>-<DD>T<HH>:<MM>:<SS.SSSSSSSSS>
- jj: [-]<Days>[.<FractionOfDay>][ "~1950"| "~2000"]
- jj_sec: [-]<Days>[ <SecInDay>.<SecInDayFraction>][ "~1950"| "~2000"]

, with <Fr"~1950"nOfDay> up to 14 digits and <SecInDayFraction> up to 9 digits. <SecInDay> must be lower than 86400.

Allowed time scales: TAI, UTC, TT, GPS, GST

The allowed formats for the date offsets are:

- [-]<DD...>d<HH...>h<MM...>m<SS...>s<AAA...>ms<BBB...>us<CCC...>ns
- [-]<DD...> <HH...> <MM...> <SS...> <AAA...> <BBB...> <CCC...>
- [-]<Offset>[.<OffsetFraction>][ ~<Unit>]

, with <Unit> one of: j, h, mn, s, ms, us, ns (if not present, default unit is j). The number of digits allowed for <OffsetFraction> depends on the selected <Unit> in order to always have a precision of 1 nanosecond: 14 (for days), 13 (for hours), 11 (for minutes), 9 (for seconds), 6 (for milliseconds), 3 (for microseconds) and 0 for nanoseconds.

Author:
aadt
Default Constraint(s):
IndexClassItemConstraint
0GLabelWithIndicatorlabel0, 0 => "newline , gapleft 0 , split 2"
0, 1 => (null)
1GPDateFielddateField(null)
2GPopupListWithLabelpopupListTimeScales2, 0, 0 => "split 4"
2, 0, 1 => (null)
2, 1 => (null)
3GButtonbuttonRelativeDate(null)


Nested Class Summary
static class GPAbsoluteDate.GPDateTimeScale
          Time scales (with the same names used in Orekit).
 
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
GPAbsoluteDate(String label)
          Constructor without date.
GPAbsoluteDate(String label, org.orekit.time.AbsoluteDate date)
          Constructor.
GPAbsoluteDate(String widgetId, String label)
          Constructor without date.
GPAbsoluteDate(String widgetId, String label, org.orekit.time.AbsoluteDate date)
          Constructor.
 
Method Summary
 void addInterval(GPDateInterval interval)
          Adds a validity interval for the date.
 void after(fr.cnes.genius.main.GEvent e)
           
 void attachCopyPasteMenu(String label, fr.cnes.genius.main.GComponent.CopyPasteOperation... operationList)
           
 void before(fr.cnes.genius.main.GEvent e)
           
 void clear()
           
 void display()
           
 void generic()
           
 fr.cnes.genius.lowLevel.GButton getGButton()
          Getter for the GButton used to open the dialog defining a relative date.
 fr.cnes.genius.highLevel.GLabelWithIndicator getGLabel()
          Getter for the label of the GPAbsoluteDate widget.
 GPDateField getGPDateField()
          Getter for the GPDateField defining the date string.
 GPDateOffset getGPDateOffset()
          Getter for the GPDateOffset used to define the relative date.
 fr.cnes.genius.highLevel.GPopupListWithLabel getGPopupList()
          Getter for the GPopupList defining the time scale.
 fr.cnes.genius.lowLevel.GStandardDialog getGStandardDialog()
          Getter for the GStandardDialog used to define the relative date.
static org.orekit.time.TimeScale getOrekitTimeScale(GPAbsoluteDate.GPDateTimeScale dateTimeScale)
          Getter for the Orekit TimeScale associated to a Genopus DateTimeScale.
 org.orekit.time.AbsoluteDate getPatriusObject()
          Getter for the date.
 fr.cnes.genius.main.GComponent getSubComponent(int position)
          
 boolean isDate(org.orekit.time.AbsoluteDate date)
          Check whether a given date is equal to the one defined in the widget.
 boolean isEnabled()
           
 boolean isModified()
           
 void read()
           
 void removeInterval(GPDateInterval interval)
          Removes a validity interval for the date.
 void setConstraint(int labelGap)
          Setter for the constraints of the widget.
 void setDate(org.orekit.time.AbsoluteDate date)
          Setter for the date.
 void setDefaultDate(org.orekit.time.AbsoluteDate defaultDate)
          Setter for the default date.
 void setEnabled(boolean b)
           
 void setSavedDate(org.orekit.time.AbsoluteDate savedDate)
          Setter for the saved date.
 void setTimeScale(GPAbsoluteDate.GPDateTimeScale timeScale)
          Method to modify the time scale in the widget.
 void setWidgetId(String widgetId)
          
protected  void updateIsModifiedIndicator()
           
 void write()
           
 
Methods inherited from class fr.cnes.genius.lowLevel.GContainer
put
 
Methods inherited from class fr.cnes.genius.main.GComponent
activateConstraintsByType, attachCopyPasteMenu, beginOfElement, beginOfElement, beginOfElement, beginOfElement, composeWidgetId, doDisplay, endOfElement, getCommentInConfigFile, getComponent, getConstraint, getCurrentOperation, getDisplayIndicatorStatus, getDisplayIsModifiedIndicator, getElement, getGPanel, getGParent, getGUnitInConfigFile, getInnerDescendantConstraint, getName, getNameInConfigFile, getOperationSaveValue, getSimpleWidgetId, getStatus, getStringConstraint, getWidgetId, handleCopyPasteEvent, handleProcessEventException, isCopyPasteEvent, launchInvalidPositionException, parseSimpleConstraint, processGEvent, setBusyCursor, setCommentInConfigFile, setConstraint, setCopyPasteMenuEnabled, setCurrentOperation, setDataForConstraintsByType, setDisplayIsModifiedIndicator, setElement, setGPanel, setGParent, setGUnitInConfigFile, setInnerDescendantConstraint, setNameAndCommentInConfigFile, setNameInConfigFile, setStatus, setStringConstraint, setToolTipText, setWidth, 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

GPAbsoluteDate

public GPAbsoluteDate(String label)
Constructor without date. The widgetId will be assigned automatically. Throws a GRuntimeException if TAI-UTC data is not initialized.

Parameters:
label - text to display in the label.

GPAbsoluteDate

public GPAbsoluteDate(String label,
                      org.orekit.time.AbsoluteDate date)
Constructor. The widgetId will be assigned automatically. Throws a GRuntimeException if TAI-UTC data is not initialized.

Parameters:
label - text to display in the label.
date - date to show

GPAbsoluteDate

public GPAbsoluteDate(String widgetId,
                      String label)
Constructor without date. Throws a GRuntimeException if TAI-UTC data is not initialized.

Parameters:
widgetId - widget identifier, if null an identifier will be automatically created.
label - text to display in the label.

GPAbsoluteDate

public GPAbsoluteDate(String widgetId,
                      String label,
                      org.orekit.time.AbsoluteDate date)
Constructor. Throws a GRuntimeException if TAI-UTC data is not initialized.

Parameters:
widgetId - widget identifier, if null an identifier will be automatically created.
label - text to display in the label.
date - date to show
Method Detail

setWidgetId

public void setWidgetId(String widgetId)

Overrides:
setWidgetId in class fr.cnes.genius.main.GComponent

getGLabel

public fr.cnes.genius.highLevel.GLabelWithIndicator getGLabel()
Getter for the label of the GPAbsoluteDate widget.

Returns:
the label of the GPAbsoluteDate widget.

getGPDateField

public GPDateField getGPDateField()
Getter for the GPDateField defining the date string.

Returns:
the GPDateField defining the date string.

getGPopupList

public fr.cnes.genius.highLevel.GPopupListWithLabel getGPopupList()
Getter for the GPopupList defining the time scale.

Returns:
the GPopupList defining the time scale.

getGButton

public fr.cnes.genius.lowLevel.GButton getGButton()
Getter for the GButton used to open the dialog defining a relative date.

Returns:
the GButton used to open the dialog defining a relative date.

getGPDateOffset

public GPDateOffset getGPDateOffset()
Getter for the GPDateOffset used to define the relative date.

Returns:
the GPDateOffset used to define the relative date.

getGStandardDialog

public fr.cnes.genius.lowLevel.GStandardDialog getGStandardDialog()
Getter for the GStandardDialog used to define the relative date.

Returns:
the GStandardDialog used to define the relative date.

setConstraint

public void setConstraint(int labelGap)
Setter for the constraints of the widget.

Parameters:
labelGap - left gap from panel border to display the label

getPatriusObject

public org.orekit.time.AbsoluteDate getPatriusObject()
Getter for the date.

Specified by:
getPatriusObject in interface GPPatrius<org.orekit.time.AbsoluteDate>
Returns:
the current date.

setTimeScale

public void setTimeScale(GPAbsoluteDate.GPDateTimeScale timeScale)
                  throws GPDateException
Method to modify the time scale in the widget.

Parameters:
timeScale - time scale to be set.
Throws:
GPDateException - if Patrius Data Set has not been initialized.

setDate

public void setDate(org.orekit.time.AbsoluteDate date)
Setter for the date.

Parameters:
date - the date to set.

setDefaultDate

public void setDefaultDate(org.orekit.time.AbsoluteDate defaultDate)
Setter for the default date.

Parameters:
defaultDate - the default date to set.

setSavedDate

public void setSavedDate(org.orekit.time.AbsoluteDate savedDate)
Setter for the saved date.

Parameters:
savedDate - the saved date to set.

getOrekitTimeScale

public static org.orekit.time.TimeScale getOrekitTimeScale(GPAbsoluteDate.GPDateTimeScale dateTimeScale)
                                                    throws GPDateException
Getter for the Orekit TimeScale associated to a Genopus DateTimeScale.

Parameters:
dateTimeScale - the GENOPUS GPDateTimeScale
Returns:
the Orekit TimeScale associated to the input DateTimeScale
Throws:
GPDateException - if UTC-TAI data is not initialized

addInterval

public void addInterval(GPDateInterval interval)
                 throws fr.cnes.genius.exception.GIntervalException
Adds a validity interval for the date.

Parameters:
interval - to add.
Throws:
fr.cnes.genius.exception.GIntervalException - In case the new interval overlaps with an existing interval in the list.

removeInterval

public void removeInterval(GPDateInterval interval)
Removes a validity interval for the date.

Parameters:
interval - to be removed.

isDate

public boolean isDate(org.orekit.time.AbsoluteDate date)
Check whether a given date is equal to the one defined in the widget. The precision of the comparison is 0.5 nanoseconds.

Parameters:
date - to compare with specified date in the widget.
Returns:
true if the specified date in widget is equal to the one requested.

attachCopyPasteMenu

public void attachCopyPasteMenu(String label,
                                fr.cnes.genius.main.GComponent.CopyPasteOperation... operationList)
Overrides:
attachCopyPasteMenu in class fr.cnes.genius.main.GComponent

updateIsModifiedIndicator

protected void updateIsModifiedIndicator()
Overrides:
updateIsModifiedIndicator in class fr.cnes.genius.main.GComponent

before

public void before(fr.cnes.genius.main.GEvent e)
Specified by:
before in interface fr.cnes.genius.main.GListener

after

public void after(fr.cnes.genius.main.GEvent e)
           throws GPDateException
Specified by:
after in interface fr.cnes.genius.main.GListener
Throws:
GPDateException

generic

public void generic()
Specified by:
generic in class fr.cnes.genius.lowLevel.GContainer

display

public void display()
             throws fr.cnes.genius.exception.GException
Specified by:
display in interface fr.cnes.genius.main.GDisplay
Throws:
fr.cnes.genius.exception.GException

read

public void read()
          throws fr.cnes.genius.exception.GException
Specified by:
read in interface fr.cnes.genius.main.GReadWrite
Throws:
fr.cnes.genius.exception.GException

write

public void write()
           throws fr.cnes.genius.exception.GException
Specified by:
write in interface fr.cnes.genius.main.GReadWrite
Throws:
fr.cnes.genius.exception.GException

isEnabled

public boolean isEnabled()
Overrides:
isEnabled in class fr.cnes.genius.main.GComponent

setEnabled

public void setEnabled(boolean b)
Overrides:
setEnabled in class fr.cnes.genius.main.GComponent

isModified

public boolean isModified()
Overrides:
isModified in class fr.cnes.genius.main.GComponent

clear

public void clear()
Specified by:
clear in interface fr.cnes.genius.main.GClear

getSubComponent

public fr.cnes.genius.main.GComponent getSubComponent(int position)
                                               throws fr.cnes.genius.exception.GComponentException

Overrides:
getSubComponent in class fr.cnes.genius.main.GComponent
Throws:
fr.cnes.genius.exception.GComponentException


Copyright © 2017. All rights reserved.