Package ucar.unidata.ui
Class TimeLengthField
java.lang.Object
ucar.unidata.ui.TimeLengthField
Class TimeField is a widget that provides for showing a time length label borken down as
days/hours/minutes and a dialog that allows the user to set the time length.
- Version:
- $Revision: 1.13 $
- Author:
- IDV Development Team
-
Constructor Summary
ConstructorsConstructorDescriptionTimeLengthField
(String name) ctorTimeLengthField
(String name, boolean isPositiveOnly) ctorTimeLengthField
(String name, boolean isPositiveOnly, boolean showYearsFld) ctorTimeLengthField
(String name, double minutes) ctorTimeLengthField
(String name, double minutes, boolean isPositiveOnly, boolean showYearsFld) ctor -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a PropertyChangeListener.boolean
applyFields
(boolean allFields) Apply the fields to the internal stateGet the gui contentsgetFieldsComponent
(boolean allFields) Get the gui componentdouble
getTime()
Current time interval as minutesvoid
setTime
(double minutes) set the time as minutesboolean
Show the dialogboolean
showDialog
(String topMsg) Show the dialogvoid
Signal that the time changedtoString()
to string
-
Constructor Details
-
TimeLengthField
ctor- Parameters:
name
- The name we use
-
TimeLengthField
ctor- Parameters:
name
- The name we useisPositiveOnly
- Only show positive numbers
-
TimeLengthField
ctor- Parameters:
name
- The name we useminutes
- minutes
-
TimeLengthField
ctor- Parameters:
name
- The nameisPositiveOnly
- only have positive valuesshowYearsFld
- Also show the years field
-
TimeLengthField
ctor- Parameters:
name
- The nameminutes
- Number of initial minutesisPositiveOnly
- only have positive valuesshowYearsFld
- Also show the years field
-
-
Method Details
-
showDialog
public boolean showDialog()Show the dialog- Returns:
- User pressed ok
-
getFieldsComponent
Get the gui component- Parameters:
allFields
- ignored- Returns:
- the gui
-
showDialog
Show the dialog- Parameters:
topMsg
- If non-null show this in the dialog as a label- Returns:
- User pressed ok
-
applyFields
public boolean applyFields(boolean allFields) Apply the fields to the internal state- Parameters:
allFields
- ignored- Returns:
- everything ok
-
addPropertyChangeListener
Adds a PropertyChangeListener.- Parameters:
listener
- The PropertyChangeListener to add.
-
getContents
Get the gui contents- Returns:
- contents
-
getTime
public double getTime()Current time interval as minutes- Returns:
- time length as minutes
-
setTime
public void setTime(double minutes) set the time as minutes- Parameters:
minutes
- minutes
-
timeChanged
public void timeChanged()Signal that the time changed -
toString
to string
-