Class DurationStringConverter
java.lang.Object
javafx.util.StringConverter<Number>
pamViewFX.fxNodes.pamScrollers.acousticScroller.DurationStringConverter
Converts a string into a time.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfromString
(String string) static String
getDurationMillisString
(double durationMillis, boolean showMillis) Get a string from a millisecond time.static double
getDurationMillisValue
(String durationString, boolean isMillis) Get the value of the duration from a time string.void
setShowMillis
(boolean showMillis)
-
Field Details
-
Constructor Details
-
Method Details
-
toString
- Specified by:
toString
in classjavafx.util.StringConverter<Number>
-
fromString
- Specified by:
fromString
in classjavafx.util.StringConverter<Number>
-
getDurationMillisString
Get a string from a millisecond time. Note that this returns a duration and NOT a date.- Parameters:
durationMillis
- - the duration in millis.showMillis
- - true if the string is in milliseconds only and does not follow the normal formatting- Returns:
- string representaiton of the duration.
-
getDurationMillisValue
Get the value of the duration from a time string.- Parameters:
durationString
- - the string represenation of the duration.isMillis
- - true if the input duration is in milliseconds.- Returns:
- -1 if the format is incorrect. Otherwise the duration in milliseconds.
-
setShowMillis
public void setShowMillis(boolean showMillis)
-