Package org.jfree.ui

Class SerialDateChooserPanel

    • Field Detail

      • DEFAULT_DATE_BUTTON_COLOR

        public static final Color DEFAULT_DATE_BUTTON_COLOR
        The default background color for the selected date.
      • DEFAULT_MONTH_BUTTON_COLOR

        public static final Color DEFAULT_MONTH_BUTTON_COLOR
        The default background color for the current month.
    • Constructor Detail

      • SerialDateChooserPanel

        public SerialDateChooserPanel()
        Constructs a new date chooser panel, using today's date as the initial selection.
      • SerialDateChooserPanel

        public SerialDateChooserPanel​(SerialDate date,
                                      boolean controlPanel)
        Constructs a new date chooser panel.
        Parameters:
        date - the date.
        controlPanel - a flag that indicates whether or not the 'today' button should appear on the panel.
      • SerialDateChooserPanel

        public SerialDateChooserPanel​(SerialDate date,
                                      boolean controlPanel,
                                      Color dateButtonColor,
                                      Color monthButtonColor)
        Constructs a new date chooser panel.
        Parameters:
        date - the date.
        controlPanel - the control panel.
        dateButtonColor - the date button color.
        monthButtonColor - the month button color.
    • Method Detail

      • setDate

        public void setDate​(SerialDate date)
        Sets the date chosen in the panel.
        Parameters:
        date - the new date.
      • getDate

        public SerialDate getDate()
        Returns the date selected in the panel.
        Returns:
        the selected date.
      • actionPerformed

        public void actionPerformed​(ActionEvent e)
        Handles action-events from the date panel.
        Specified by:
        actionPerformed in interface ActionListener
        Parameters:
        e - information about the event that occurred.
      • getButtonColor

        protected Color getButtonColor​(SerialDate targetDate)
        Returns the button color according to the specified date.
        Parameters:
        targetDate - the target date.
        Returns:
        the button color.
      • getFirstVisibleDate

        protected SerialDate getFirstVisibleDate()
        Returns the first date that is visible in the grid. This should always be in the month preceding the month of the selected date.
        Returns:
        the first visible date.
      • refreshButtons

        protected void refreshButtons()
        Update the button labels and colors to reflect date selection.