Class 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.
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CalculateMinimumTimeFieldSize

        public CalculateMinimumTimeFieldSize()
    • 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.