Package xal.extension.widgets.plot
Class DateGraphFormat
java.lang.Object
java.text.Format
java.text.NumberFormat
xal.extension.widgets.plot.DateGraphFormat
- All Implemented Interfaces:
Serializable
,Cloneable
DateGraphFormat is the subclass of the NumberFormat class. It produces the
x-axis markers as a date by using an internal date format. X-axis values are
supposed to be the number of seconds since January 1, 1970, 00:00:00 GMT. To
use this format for the x-axis call the method setNumberFormatX(NumberFormat
df) of the instance of FunctionGraphsJPanel class with the DateGraphFormat
instance instead of NumberFormat.
- Author:
- shishlo
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.text.NumberFormat
NumberFormat.Field, NumberFormat.Style
-
Field Summary
Fields inherited from class java.text.NumberFormat
FRACTION_FIELD, INTEGER_FIELD
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor with a default DateFormat (it is SimpleDateFormat("HH:mm:ss")).DateGraphFormat
(String pattern) Constructor with a date format pattern as the parameter.DateGraphFormat
(DateFormat dateFormatIn) Constructor with a DateFormat as a parameter. -
Method Summary
Modifier and TypeMethodDescriptionformat
(double tSec, StringBuffer toAppendTo, FieldPosition pos) The overridden format method of the NumberFormat class.format
(long tSec, StringBuffer toAppendTo, FieldPosition pos) The overridden format method of the NumberFormat class.static Date
getDate
(double seconds) Transforms the seconds since January 1, 1970, 00:00:00 GMT to the date.Returns the instance of the DateFormat class that is used to format the seconds to the date.static double
getSeconds
(Date date) Transforms the date to the seconds since January 1, 1970, 00:00:00 GMT.parse
(String input, ParsePosition position) Don't call.void
setDateFormat
(DateFormat dateFormat) Sets the instance of the DateFormat class that will be used to format the seconds to the date.Methods inherited from class java.text.NumberFormat
clone, equals, format, format, format, getAvailableLocales, getCompactNumberInstance, getCompactNumberInstance, getCurrency, getCurrencyInstance, getCurrencyInstance, getInstance, getInstance, getIntegerInstance, getIntegerInstance, getMaximumFractionDigits, getMaximumIntegerDigits, getMinimumFractionDigits, getMinimumIntegerDigits, getNumberInstance, getNumberInstance, getPercentInstance, getPercentInstance, getRoundingMode, hashCode, isGroupingUsed, isParseIntegerOnly, parse, parseObject, setCurrency, setGroupingUsed, setMaximumFractionDigits, setMaximumIntegerDigits, setMinimumFractionDigits, setMinimumIntegerDigits, setParseIntegerOnly, setRoundingMode
Methods inherited from class java.text.Format
format, formatToCharacterIterator, parseObject
-
Constructor Details
-
DateGraphFormat
public DateGraphFormat()Constructor with a default DateFormat (it is SimpleDateFormat("HH:mm:ss")). -
DateGraphFormat
Constructor with a date format pattern as the parameter. -
DateGraphFormat
Constructor with a DateFormat as a parameter.
-
-
Method Details
-
parse
Don't call. Just returns null. Satisfied abstract method requirement.- Specified by:
parse
in classNumberFormat
-
format
The overridden format method of the NumberFormat class.- Specified by:
format
in classNumberFormat
-
format
The overridden format method of the NumberFormat class.- Specified by:
format
in classNumberFormat
-
getDateFormat
Returns the instance of the DateFormat class that is used to format the seconds to the date. -
setDateFormat
Sets the instance of the DateFormat class that will be used to format the seconds to the date. -
getSeconds
Transforms the date to the seconds since January 1, 1970, 00:00:00 GMT.- Returns:
- double as a number of seconds
-
getDate
Transforms the seconds since January 1, 1970, 00:00:00 GMT to the date.- Returns:
- an instance of the Date class.
-