Class CalculateMinimumTimeFieldSize
- java.lang.Object
-
- com.github.lgooddatepicker.zinternaltools.CalculateMinimumTimeFieldSize
-
public class CalculateMinimumTimeFieldSize extends java.lang.Object
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 Constructor Description CalculateMinimumTimeFieldSize()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
getFormattedTimeWidthInPixels(java.time.format.DateTimeFormatter formatForDisplayTime, java.awt.Font fontValidTime, int numberOfExtraCharacters)
getFormattedDateWidthInPixels, This returns the width (in pixels) of the longest formatted time, using the supplied DateTimeFormatter instance and font.
-
-
-
Method Detail
-
getFormattedTimeWidthInPixels
public static int getFormattedTimeWidthInPixels(java.time.format.DateTimeFormatter formatForDisplayTime, java.awt.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.
-
-