Package org.jfree.ui

Class SerialDateChooserPanel

All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public class SerialDateChooserPanel extends JPanel implements ActionListener
A panel that allows the user to select a date.

This class is incomplete and untested. You should not use it yet...

Author:
David Gilbert
See Also:
  • Field Details

  • Constructor Details

    • 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 Details

    • 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

      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.