|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
edu.wisc.ssec.mcidasv.data.dateChooser.JDateChooser
public class JDateChooser
A date chooser containig a date editor and a button, that makes a JCalendar visible for choosing a date. If no date editor is specified, a JTextFieldDateEditor is used as default.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected JButton |
calendarButton
|
private ChangeListener |
changeListener
|
protected IDateEditor |
dateEditor
|
protected boolean |
dateSelected
|
protected boolean |
isInitialized
|
protected JCalendar |
jcalendar
|
protected Date |
lastSelectedDate
|
protected JPopupMenu |
popup
|
private static long |
serialVersionUID
|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
JDateChooser()
Creates a new JDateChooser. |
|
JDateChooser(Date date)
Creates a new JDateChooser. |
|
JDateChooser(Date date,
String dateFormatString)
Creates a new JDateChooser. |
|
JDateChooser(Date date,
String dateFormatString,
IDateEditor dateEditor)
Creates a new JDateChooser. |
|
JDateChooser(IDateEditor dateEditor)
Creates a new JDateChooser with given IDateEditor. |
|
JDateChooser(JCalendar jcal,
Date date,
String dateFormatString,
IDateEditor dateEditor)
Creates a new JDateChooser. |
|
JDateChooser(String datePattern,
String maskPattern,
char placeholder)
Creates a new JDateChooser. |
Method Summary | |
---|---|
void |
actionPerformed(ActionEvent e)
Called when the jalendar button was pressed. |
void |
cleanup()
Should only be invoked if the JDateChooser is not used anymore. |
Calendar |
getCalendar()
Returns the calendar. |
JButton |
getCalendarButton()
Returns the calendar button. |
Date |
getDate()
Returns the date. |
IDateEditor |
getDateEditor()
Returns the date editor. |
String |
getDateFormatString()
Gets the date format string. |
JCalendar |
getJCalendar()
Returns the JCalendar component. |
Date |
getMaxSelectableDate()
Gets the maximum selectable date. |
Date |
getMinSelectableDate()
Gets the minimum selectable date. |
boolean |
isEnabled()
Returns true, if enabled. |
static void |
main(String[] s)
Creates a JFrame with a JDateChooser inside and can be used for testing. |
void |
propertyChange(PropertyChangeEvent evt)
Listens for a "date" property change or a "day" property change event from the JCalendar. |
void |
setCalendar(Calendar calendar)
Sets the calendar. |
void |
setDate(Date date)
Sets the date. |
void |
setDateFormatString(String dfString)
Sets the date format string. |
void |
setEnabled(boolean enabled)
Enable or disable the JDateChooser. |
void |
setFont(Font font)
Sets the font of all subcomponents. |
void |
setIcon(ImageIcon icon)
Sets the icon of the buuton. |
void |
setLocale(Locale l)
Sets the locale. |
void |
setMaxSelectableDate(Date max)
|
void |
setMinSelectableDate(Date min)
|
void |
setSelectableDateRange(Date min,
Date max)
Sets a valid date range for selectable dates. |
void |
updateUI()
Updates the UI of itself and the popup. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
protected IDateEditor dateEditor
protected JButton calendarButton
protected JCalendar jcalendar
protected JPopupMenu popup
protected boolean isInitialized
protected boolean dateSelected
protected Date lastSelectedDate
private ChangeListener changeListener
Constructor Detail |
---|
public JDateChooser()
public JDateChooser(IDateEditor dateEditor)
dateEditor
- the dateEditor to be used used to display the date. if null, a
JTextFieldDateEditor is used.public JDateChooser(Date date)
date
- the date or nullpublic JDateChooser(Date date, String dateFormatString)
date
- the date or nulldateFormatString
- the date format string or null (then MEDIUM SimpleDateFormat
format is used)public JDateChooser(Date date, String dateFormatString, IDateEditor dateEditor)
date
- the date or nulldateFormatString
- the date format string or null (then MEDIUM SimpleDateFormat
format is used)dateEditor
- the dateEditor to be used used to display the date. if null, a
JTextFieldDateEditor is used.public JDateChooser(String datePattern, String maskPattern, char placeholder)
datePattern
- the date pattern, e.g. "MM/dd/yy"maskPattern
- the mask pattern, e.g. "##/##/##"placeholder
- the placeholer charachter, e.g. '_'public JDateChooser(JCalendar jcal, Date date, String dateFormatString, IDateEditor dateEditor)
jcal
- the JCalendar to be useddate
- the date or nulldateFormatString
- the date format string or null (then MEDIUM Date format is
used)dateEditor
- the dateEditor to be used used to display the date. if null, a
JTextFieldDateEditor is used.Method Detail |
---|
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
e
- the action eventpublic void propertyChange(PropertyChangeEvent evt)
propertyChange
in interface PropertyChangeListener
evt
- the eventpublic void updateUI()
updateUI
in class JPanel
public void setLocale(Locale l)
setLocale
in class Component
l
- The new locale valuepublic String getDateFormatString()
public void setDateFormatString(String dfString)
dfString
- The dateFormatString to set.public Date getDate()
public void setDate(Date date)
date
- the new date.public Calendar getCalendar()
public void setCalendar(Calendar calendar)
calendar
- the calendar.public void setEnabled(boolean enabled)
setEnabled
in class JComponent
enabled
- the new enabled valuepublic boolean isEnabled()
isEnabled
in class Component
public void setIcon(ImageIcon icon)
icon
- The new iconpublic void setFont(Font font)
setFont
in class JComponent
font
- the new fontpublic JCalendar getJCalendar()
public JButton getCalendarButton()
public IDateEditor getDateEditor()
public void setSelectableDateRange(Date min, Date max)
min
- the minimum selectable date or null (then the minimum date is
set to 01\01\0001)max
- the maximum selectable date or null (then the maximum date is
set to 01\01\9999)public void setMaxSelectableDate(Date max)
public void setMinSelectableDate(Date min)
public Date getMaxSelectableDate()
public Date getMinSelectableDate()
public void cleanup()
public static void main(String[] s)
s
- The command line arguments
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |