Class CalculateMinimumTimeFieldSize
java.lang.Object
com.github.lgooddatepicker.zinternaltools.CalculateMinimumTimeFieldSize
CalculateMinimumTimeFieldSize, This class is used to calculate the minimum horizontal size needed
for text fields that hold times. (Such as the text field in the TimePicker component.)
The size that is returned is designed to be the smallest size that will hold the longest
displayable time under current TimePickerSettings, without cropping the text. The "longest time",
needs to take into account the following factors: The longest (in pixels) time in the current
display format, and the font object for valid times (including the font type and size). Note that
the locale information is built into the display format.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
getFormattedTimeWidthInPixels
(DateTimeFormatter formatForDisplayTime, Font fontValidTime, int numberOfExtraCharacters) getFormattedDateWidthInPixels, This returns the width (in pixels) of the longest formatted time, using the supplied DateTimeFormatter instance and font.
-
Constructor Details
-
CalculateMinimumTimeFieldSize
public CalculateMinimumTimeFieldSize()
-
-
Method Details
-
getFormattedTimeWidthInPixels
public static int getFormattedTimeWidthInPixels(DateTimeFormatter formatForDisplayTime, Font fontValidTime, int numberOfExtraCharacters) getFormattedDateWidthInPixels, This returns the width (in pixels) of the longest formatted time, using the supplied DateTimeFormatter instance and font. Note that the locale information is built into the display format. You may optionally add extra characters to the longestTimeString that is used in the calculation, by supplying a nonzero value for the parameter numberOfExtraCharacters. This parameter can also be used with a negative value to reduce the size that is returned.
-