Class DatePickerUI

  • Direct Known Subclasses:
    BasicDatePickerUI

    public abstract class DatePickerUI
    extends javax.swing.plaf.ComponentUI
    The ComponentUI for a JXDatePicker.

    Responsible for keeping the date property of all participants synchronized at all "stable" points in their life-cycle. That is the following invariant is guaranteed:

    
     Date selected = datePicker.getMonthView().getSelectedDate();
     assertEquals(selected, datePicker.getDate());
     assertEquals(selected, datePicker.getEditor().getValue());
     
    Author:
    Joshua Outwater, Jeanette Winzenburg
    • Constructor Summary

      Constructors 
      Constructor Description
      DatePickerUI()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      int getBaseline​(int width, int height)
      Get the baseline for the specified component, or a value less than 0 if the baseline can not be determined.
      abstract java.util.Date getSelectableDate​(java.util.Date date)
      Checks the given date for validity for selection.
      • Methods inherited from class javax.swing.plaf.ComponentUI

        contains, createUI, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, installUI, paint, uninstallUI, update
      • Methods inherited from class java.lang.Object

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

      • DatePickerUI

        public DatePickerUI()
    • Method Detail

      • getBaseline

        public int getBaseline​(int width,
                               int height)
        Get the baseline for the specified component, or a value less than 0 if the baseline can not be determined. The baseline is measured from the top of the component.
        Parameters:
        width - Width of the component to determine baseline for.
        height - Height of the component to determine baseline for.
        Returns:
        baseline for the specified component
      • getSelectableDate

        public abstract java.util.Date getSelectableDate​(java.util.Date date)
                                                  throws java.beans.PropertyVetoException
        Checks the given date for validity for selection. If valid, returns the date as appropriate in the picker's context, otherwise throws a propertyVetoException. Note that the returned date might be different from the input date, f.i. the time fields might be cleared. The input date is guaranteed to be unchanged.
        Parameters:
        date - date to check
        Returns:
        the date as allowed in the context of the picker.
        Throws:
        java.beans.PropertyVetoException - if the given date is not valid for selection