Package rma.swing

Class DateTimePanel

All Implemented Interfaces:
FocusListener, ImageObserver, MenuContainer, Serializable, Cloneable, EventListener, Accessible, Modifiable, TimeZoneComponent, RmaValidComponent

public class DateTimePanel extends JPanel implements RmaValidComponent, TimeZoneComponent, FocusListener, Modifiable, Cloneable
Class Description
See Also:
  • Field Details

    • VERTICAL_LAYOUT

      public static final int VERTICAL_LAYOUT
      Description
      See Also:
    • HORIZONTAL_LAYOUT

      public static final int HORIZONTAL_LAYOUT
      Description
      See Also:
    • _displayTimeZone

      protected TimeZone _displayTimeZone
      Description
    • _dataTimeZone

      protected TimeZone _dataTimeZone
      Description
    • _hTime

      protected HecTime _hTime
      Description
    • _dateFormat

      protected SimpleDateFormat _dateFormat
      Description
    • _timeFormat

      protected SimpleDateFormat _timeFormat
      Description
  • Constructor Details

    • DateTimePanel

      public DateTimePanel()
    • DateTimePanel

      public DateTimePanel(int layout, String dateLabel, String timeLabel, String dateFmt)
      Constructor for the DateTimePanel object
      Parameters:
      layout - Description
      dateLabel - Description
      timeLabel - Description
      dateFmt - Description
  • Method Details

    • setDateTime

      public void setDateTime(HecTimeArray hTimeArray)
      Sets the DateTime attribute of the DateTimePanel object
      Parameters:
      hTimeArray - The new DateTime value
    • setDateTime

      public void setDateTime(HecTime hTime, TimeZone dataTz)
      Sets the DateTime attribute of the DateTimePanel object
      Parameters:
      hTime - The new DateTime value
      dataTz - The new DateTime value
    • setDataTimeZone

      public void setDataTimeZone(TimeZone tz)
    • setDisplayTimeZone

      public void setDisplayTimeZone(TimeZone tz)
    • setTimeZone

      public void setTimeZone(TimeZone tz)
      Sets the Display TimeZone attribute of the DateTimePanel object. All times are converted from the dataTimeZone to the display time zone set here and displayed in the Text Fields
      Specified by:
      setTimeZone in interface TimeZoneComponent
      Parameters:
      tz - The new TimeZone value
    • setEditable

      public void setEditable(boolean b)
      Sets the Editable attribute of the DateTimePanel object
      Parameters:
      b - The new Editable value
    • setEnabled

      public void setEnabled(boolean b)
      Sets the Enabled attribute of the DateTimePanel object
      Overrides:
      setEnabled in class JComponent
      Parameters:
      b - The new Enabled value
    • setChangeColor

      public void setChangeColor(Color c)
      set the foreground color for the fields in this panel when the user edits the values
      Parameters:
      c - the foreground Color
    • setAllowsMinutes

      public void setAllowsMinutes(boolean b)
      Sets the AllowsMinutes attribute of the DateTimePanel object
      Parameters:
      b - The new AllowsMinutes value
    • getTimeUnconverted

      public String getTimeUnconverted()
      return the unconverted time in the time field
      Returns:
      The TimeUnconverted value
    • getDateUnconverted

      public String getDateUnconverted()
      return the unconverted date in the date field
      Returns:
      The DateUnconverted value
    • setTimeFieldVisible

      public void setTimeFieldVisible(boolean visible)
    • getTime

      public String getTime()
      Gets the Time attribute of the DateTimePanel object
      Returns:
      The Time value
    • getDate

      public String getDate(int style)
      Gets the Date attribute of the DateTimePanel object
      Parameters:
      style - Description of Parameter
      Returns:
      The Date value
    • getDateTime

      public HecTimeArray getDateTime()
      Returns the date and time in an HecTimeArray of size 1. The date and time is in a HecTime Object accompanied by the time zone it is in. The timezone is in the same time zone that was set by the setDateTime() call.
    • isValid

      public boolean isValid(boolean showError)
      Gets the Valid attribute of the DateTimePanel object
      Specified by:
      isValid in interface RmaValidComponent
      Parameters:
      showError - Description
      Returns:
      The Valid value
    • getTimeZone

      public TimeZone getTimeZone()
      Gets the TimeZone attribute of the DateTimePanel object
      Specified by:
      getTimeZone in interface TimeZoneComponent
      Returns:
      The TimeZone value
    • isEditable

      public boolean isEditable()
      Gets the Editable attribute of the DateTimePanel object
      Returns:
      The Editable value
    • isEnabled

      public boolean isEnabled()
      Gets the Enabled attribute of the DateTimePanel object
      Overrides:
      isEnabled in class Component
      Returns:
      The Enabled value
    • getAllowsMinutes

      public boolean getAllowsMinutes()
      Gets the AllowsMinutes attribute of the DateTimePanel object
      Returns:
      The AllowsMinutes value
    • fillPanel

      public void fillPanel()
      Method Description
    • savePanel

      public void savePanel()
      Method Description
    • showTimeAsBeginningOfDay

      public void showTimeAsBeginningOfDay(boolean b)
      Show midnight at the beginning of the next day, instead of the end of the previous day. (For example, 06Jan2002 00:00, instead of 05Jan2002 24:00.)
      Parameters:
      b - true to show midnight as 00:00 hrs, false to show midnight as 24:00 hrs (default).
      See Also:
    • clear

      public void clear()
      Description of the Method
    • removeDateTimeFocusListener

      public void removeDateTimeFocusListener(FocusListener fl)
      remove a focus listener from the datefield and the timefield
      Parameters:
      fl - Description of Parameter
    • addDateTimeFocusListener

      public void addDateTimeFocusListener(FocusListener fl)
      add a focus listener to the datefield and the timefield
      Parameters:
      fl - The feature to be added to the DateTimeFocusListener attribute
    • addKeyListener

      public void addKeyListener(KeyListener kl)
      add a KeyListener to the datefield and the timefield
      Overrides:
      addKeyListener in class Component
      Parameters:
      kl - the KeyListener
    • addActionListener

      public void addActionListener(ActionListener al)
    • focusGained

      public void focusGained(FocusEvent fe)
      this method is public as an implementation side-effect and probably shouldn't be called directly from users code.
      Specified by:
      focusGained in interface FocusListener
      Parameters:
      fe - Description of Parameter
    • focusLost

      public void focusLost(FocusEvent fe)
      this method is public as an implementation side-effect and probably shouldn't be called directly from users code.
      Specified by:
      focusLost in interface FocusListener
      Parameters:
      fe - Description of Parameter
    • timeFieldRequestFocus

      public void timeFieldRequestFocus()
      Description of the Method
    • dateFieldRequestFocus

      public void dateFieldRequestFocus()
      Description of the Method
    • isModified

      public boolean isModified()
      Specified by:
      isModified in interface Modifiable
      Returns:
      See Also:
    • setModified

      public void setModified(boolean modified)
      Specified by:
      setModified in interface Modifiable
      See Also:
    • setIgnoreModifiedEvents

      public void setIgnoreModifiedEvents(boolean b)
    • getIgnoreModifiedEvents

      public boolean getIgnoreModifiedEvents()
    • clone

      public DateTimePanel clone()
      Overrides:
      clone in class Object