Module org.jcommon

Class JDatePanel

    • Field Detail

      • JANUARY

        public static final int JANUARY
        JANUARY month. This variable is a convenience variable that match the java.util.Calendar.JANUARY variable.
        See Also:
        Constant Field Values
      • FEBRUARY

        public static final int FEBRUARY
        FEBRUARY month. This variable is a convenience variable that match the java.util.Calendar.FEBRUARY variable.
        See Also:
        Constant Field Values
      • MARCH

        public static final int MARCH
        MARCH month. This variable is a convenience variable that match the java.util.Calendar.MARCH variable.
        See Also:
        Constant Field Values
      • APRIL

        public static final int APRIL
        APRIL month. This variable is a convenience variable that match the java.util.Calendar.APRIL variable.
        See Also:
        Constant Field Values
      • MAY

        public static final int MAY
        MAY month. This variable is a convenience variable that match the java.util.Calendar.MAY variable.
        See Also:
        Constant Field Values
      • JUNE

        public static final int JUNE
        JUNE month. This variable is a convenience variable that match the java.util.Calendar.JUNE variable.
        See Also:
        Constant Field Values
      • JULY

        public static final int JULY
        JULY month. This variable is a convenience variable that match the java.util.Calendar.JULY variable.
        See Also:
        Constant Field Values
      • AUGUST

        public static final int AUGUST
        AUGUST month. This variable is a convenience variable that match the java.util.Calendar.AUGUST variable.
        See Also:
        Constant Field Values
      • SEPTEMBER

        public static final int SEPTEMBER
        SEPTEMBER month. This variable is a convenience variable that match the java.util.Calendar.SEPTEMBER variable.
        See Also:
        Constant Field Values
      • OCTOBER

        public static final int OCTOBER
        OCTOBER month. This variable is a convenience variable that match the java.util.Calendar.OCTOBER variable.
        See Also:
        Constant Field Values
      • NOVEMBER

        public static final int NOVEMBER
        NOVEMBER month. This variable is a convenience variable that match the java.util.Calendar.NOVEMBER variable.
        See Also:
        Constant Field Values
      • DECEMBER

        public static final int DECEMBER
        DECEMBER month. This variable is a convenience variable that match the java.util.Calendar.DECEMBER variable.
        See Also:
        Constant Field Values
    • Constructor Detail

      • JDatePanel

        public JDatePanel()
        Construct a new default date panel. The date is set by default to the current date
      • JDatePanel

        public JDatePanel​(Date date)
        Construct a new date panel attached to the given date.
        Parameters:
        date - the date to edit within the panel.
    • Method Detail

      • initGUI

        protected void initGUI()
        Init the GUI
      • updateGUI

        protected void updateGUI()
        Update the panel graphical components. The components shows the current date.
        See Also:
        setDate(Date), getDate()
      • getDate

        public Date getDate()
        Get the date attached to this panel
        Returns:
        the java object representing the date attached to this panel.
        See Also:
        setDate(Date)
      • setDate

        public void setDate​(Date newDate)
        Set the date attached to this panel
        Parameters:
        newDate - the java object representing the date to attach to this panel.
        See Also:
        getDate()
      • getMinute

        public int getMinute()
        Get the minute of the hour (0 - 59) specified by the current date
        Returns:
        the minute in the hour.
        See Also:
        setMinute(int)
      • setMinute

        public void setMinute​(int minute)
        Set the minute of the hour (0 - 59) specified by the current date
        Parameters:
        minute - the minute in the hour.
        See Also:
        getMinute()
      • getHour

        public int getHour()
        Get the hour of the date
        Returns:
        the hour of the day (0 - 24)
        See Also:
        setHour(int)
      • setHour

        public void setHour​(int hour)
        Set the hour of the date.
        Parameters:
        hour - the hour of the day (0 - 24)
        See Also:
        getHour()
      • getMonth

        public int getMonth()
        Get the month of the date.
        Returns:
        the month of the date as stated in Calendar class
        See Also:
        setMonth(int)
      • setMonth

        public void setMonth​(int month)
        Set the month of the date. The month is given by the variable available in the class. If the day is not compatible with the given month, day is changed to match the new month.
        Parameters:
        month - the month.
        See Also:
        getMonth()
      • getDay

        public int getDay()
        Get the day of the date. The day number if the day in the month.
        Returns:
        int the day of the date (month relative).
        See Also:
        setDay(int)
      • setDay

        public void setDay​(int day)
        Set the day of the date. If the day does not fit the month and the year, it is changed to fit.
        Parameters:
        day - the day of the date
        See Also:
        getDay()
      • getYear

        public int getYear()
        Return the year of the date.
        Returns:
        the year of the date.
        See Also:
        setYear(int)
      • setYear

        public void setYear​(int year)
        Set the year of the date. A year has to be positive.
        Parameters:
        year - the year of the date.
        See Also:
        getYear()
      • isBisextile

        public boolean isBisextile​(int year)
        Compute if the given year if a bisextile year. A year is bisextile if it can be divided by 400 or if it can be divided by 4 but not by 100 at the same time.
        Parameters:
        year - the year to check
        Returns:
        true if the year is bisextile, false otherwise.