public class GTime extends GContainer implements GReadWrite, GListener, GDisplay, GClear
Index | Class | Item | Constraint |
0 | GLabelWithIndicator | label | 0, 0 =>
"newline , gapleft 0 , split 2" 0, 1 => (null) |
1 | GPDateOffsetField | offsetField | "split 2" |
2 | GPopupList | popupListUnits | (null) |
GComponent.CopyPasteOperation, GComponent.DisplayIndicatorStatus, GComponent.ItemType, GComponent.Operation
NAME_ATTRIBUTE
Constructor and Description |
---|
GTime()
Empty constructor.
|
GTime(String label)
Constructor.
|
GTime(String label,
double duration)
Constructor.
|
GTime(String widgetId,
String label)
Constructor.
|
GTime(String widgetId,
String label,
double duration)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addGInterval(GInterval interval)
Adds a validity interval to the duration value.
|
void |
after(GEvent e)
Called after the event is processed.
|
void |
attachCopyPasteMenu(String label,
GComponent.CopyPasteOperation... operationList)
Attach the copy and paste menu to this component.
|
void |
before(GEvent e)
Called before the event is processed.
|
void |
clear()
Called when the element is to be cleared, so it can perform the actions required to return to the last
saved/loaded values.
|
void |
display()
Called when the element is to be displayed, so it can perform the actions required for its display, and
the display of its inmmediate descendants.
|
void |
generic()
The prototype of the generic function that shall exist in all the descendants.
|
GDateUtils.GDateFormat |
getCurrentDurationFormat()
Getter for the duration format.
|
double |
getDefaultValue()
Get default duration from GTime.
|
double |
getDuration()
Getter for the duration value.
|
String |
getDurationString()
Get duration from GTime.
|
GLabelWithIndicator |
getGlabel()
Getter for the label of the widget.
|
GPopupList |
getGPopupList()
Getter for the GPopupList defining the unit of a fractional offset.
|
GTextField |
getGTextField()
Getter for the duration field.
|
GComponent |
getSubComponent(int position)
Gets the subcomponent occupying the position defined by position.
|
double |
getValue()
Get duration from GTime.
|
boolean |
isEnabled()
Gets the enable status of the widget.
|
boolean |
isModified()
Gets the modification status of the component against the last set of values loaded or saved.
|
void |
read()
Implementaion of the routines that allow the component to be loaded from a configuration file.
|
void |
removeGInterval(GInterval interval)
Remove a validity interval of the field.
|
void |
setConstraint(int labelGap)
Setter for the constraints of the widget.
|
void |
setCurrentFormat(GDateUtils.GDateFormat durationFormat)
Setter for the duration format.
|
void |
setDefaultDuration(double defaultDuration)
Set default duration value.
|
void |
setDefaultDuration(String defaultDuration)
Set default duration value.
|
void |
setDuration(double duration)
Setter for the duration value in seconds.
|
void |
setEnabled(boolean b)
Set the enable status of the component.
|
void |
setUnit(GUnit durationUnit)
Setter for the duration unit.
|
void |
setValue(String stringDuration)
Set duration from string.
|
void |
setWidgetId(String widgetId)
Sets the widget identifier of the component.
|
void |
updateIsModifiedIndicator()
Updates the isModified indicator, this method shall be overwritten by the child classes that
need to.
|
void |
updateStatus()
Update the status of the field applying the defined validity intervals.
|
void |
write()
Implementaion of the routines that allow the component to be saved to a configuration file.
|
put
activateConstraintsByType, attachCopyPasteMenu, beginOfElement, beginOfElement, beginOfElement, beginOfElement, clearAllInnerDescendantConstraint, clearConstraint, clearInnerDescendantContraint, composeWidgetId, doDisplay, endOfElement, getCommentInConfigFile, getComponent, getConstraint, getCurrentOperation, getDisplayIndicatorStatus, getDisplayIsModifiedIndicator, getElement, getGClassName, getGPanel, getGParent, getGUnitInConfigFile, getInnerDescendantConstraint, getName, getNameInConfigFile, getOperationSaveValue, getPathInConfigFile, getSimpleWidgetId, getStatus, getStringConstraint, getWidgetId, handleCopyPasteEvent, handleCopyPasteEvent, handleProcessEventException, isCopyPasteEvent, isForcedStatus, 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, writeCollection, writeCollection, writeCollection, writeCollection, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem
public GTime() throws GDateFieldException, GArithmeticException
GArithmeticException
- thrown if failedGDateFieldException
- thrown if failedpublic GTime(String label) throws GDateFieldException, GArithmeticException
label
- text to display in the label.GArithmeticException
- thrown if failedGDateFieldException
- thrown if failedpublic GTime(String label, double duration) throws GDateFieldException, GArithmeticException
label
- text to display in the label.duration
- duration to set. Its absolute value must be lower than Long.MAX_VALUE
GArithmeticException
- thrown if failedGDateFieldException
- thrown if failedpublic GTime(String widgetId, String label) throws GDateFieldException, GArithmeticException
widgetId
- widget identifier.label
- text to display in the label.GArithmeticException
- thrown if failedGDateFieldException
- thrown if failedpublic GTime(String widgetId, String label, double duration) throws GArithmeticException
widgetId
- widget identifier.label
- text to display in the label.duration
- duration to set. Its absolute value must be lower than Long.MAX_VALUE
GArithmeticException
- thrown if failedpublic final void setWidgetId(String widgetId)
setWidgetId
in class GComponent
widgetId
- the widget identifier of the component.public GLabelWithIndicator getGlabel()
public GTextField getGTextField()
public GPopupList getGPopupList()
public void setDuration(double duration) throws GArithmeticException
duration
- the duration in seconds to set.GArithmeticException
- if duration is NaN.public void setUnit(GUnit durationUnit) throws GDateFieldException
durationUnit
- format in which the duration will be shown in the widget.GDateFieldException
- if given unit is not available in the widget.public void setValue(String stringDuration) throws GDateFieldException, GArithmeticException
stringDuration
- string duration to set.GArithmeticException
- if duration cannot be parsedsGDateFieldException
- if duration is in bad formatpublic void setDefaultDuration(double defaultDuration) throws GDateFieldException, GArithmeticException
defaultDuration
- new default duration value.GDateFieldException
- in case the value can not be parsed.GArithmeticException
- thrown if failedpublic void setDefaultDuration(String defaultDuration) throws GDateFieldException
defaultDuration
- new default string value.GDateFieldException
- in case the value can not be parsed.public double getValue() throws GArithmeticException
GArithmeticException
- thrown if failedpublic double getDefaultValue()
public String getDurationString() throws GArithmeticException
GArithmeticException
- thrown if failedpublic GDateUtils.GDateFormat getCurrentDurationFormat()
public void setCurrentFormat(GDateUtils.GDateFormat durationFormat)
durationFormat
- format in which the duration will be shown in the widget.public final void setConstraint(int labelGap)
labelGap
- left gap from panel border to display the labelpublic GComponent getSubComponent(int position) throws GComponentException
getSubComponent
in class GComponent
position
- position of the requested component.GComponentException
- in case the position argument is invalid.public void addGInterval(GInterval interval) throws GIntervalException
interval
- real interval to add.GIntervalException
- in case the interval overlaps with an existing one.public void attachCopyPasteMenu(String label, GComponent.CopyPasteOperation... operationList)
attachCopyPasteMenu
in class GComponent
label
- of the copy&paste menu, if null no label is displayed.operationList
- list of operations to set in the menu. Valid values are Copy if the
"Copy" menu is available, Paste if the "Paste" menu is available, Import if the
"Import" menu is available, and Export if the "Export" menu is available.public final void updateStatus()
public void updateIsModifiedIndicator()
updateIsModifiedIndicator
in class GComponent
public void removeGInterval(GInterval interval)
interval
- to be removedpublic boolean isEnabled()
isEnabled
in class GComponent
public void setEnabled(boolean b)
setEnabled
in class GComponent
b
- new enable status of the component.public boolean isModified()
isModified
in class GComponent
public void generic()
generic
in class GContainer
public void display() throws GException
display
in interface GDisplay
GException
- in case of problem while reading the value from file.public void before(GEvent e)
public void after(GEvent e) throws GDateFieldException
after
in interface GListener
e
- processed event.GDateFieldException
public void read() throws GException
read
in interface GReadWrite
GException
- in case of problem while reading the value from file.public void write() throws GException
write
in interface GReadWrite
GException
- in case of problem while writing the value to file.public void clear()
public double getDuration()
Copyright © 2024. All rights reserved.