|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel com.jidesoft.combobox.PopupPanel com.jidesoft.combobox.MonthChooserPanel
public class MonthChooserPanel
MonthChooserPanel is a popup panel that can choose Date. User can click and select a Month. It also support various operations such as typing year directly, go to next or previous year. It also supports ItemListener. Whenever a Month is selected, itemStateChanged will be fired.
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 | |
---|---|
static int |
NAVIGATION_BUTTON_HEIGHT
|
static int |
NAVIGATION_BUTTON_WIDTH
|
static String |
VIEWONLY_PROPERTY
Property of view only. |
Fields inherited from class com.jidesoft.combobox.PopupPanel |
---|
_previousSelectedObject, SELECTED_BY_MOUSE_ROLLOVER |
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 | |
---|---|
MonthChooserPanel()
Creates a new JPanel with a double buffer and a flow layout. |
|
MonthChooserPanel(boolean showNoneButton)
|
|
MonthChooserPanel(DateModel dateModel)
|
|
MonthChooserPanel(DateModel dateModel,
boolean showNoneButton)
|
|
MonthChooserPanel(DateModel dateModel,
boolean showNoneButton,
Locale locale)
|
Method Summary | |
---|---|
void |
actionPerformed(ActionEvent e)
|
protected void |
addModelListener()
Adds DateModelListener to DateModel. |
protected Component |
createButtonPanel()
|
protected JComponent |
createMonthLabel(int i)
|
protected Component |
createMonthPanel()
|
protected Component |
createMonthsPanel()
|
protected JComponent |
createYearLabel()
|
protected Component |
createYearPanel()
|
void |
dateModelChanged(DateModelEvent e)
This notification tells listeners the something changed in date model. |
void |
disableMouseWheel()
|
void |
enableMouseWheel()
|
DateModel |
getDateModel()
Gets the DateModel. |
Calendar |
getDisplayedCalendar()
|
protected Calendar |
getMonthCalendar()
Gets a Calendar representing the month. |
DateFormat |
getMonthFormatter()
|
protected String |
getResourceString(String key)
Gets the localized string from resource bundle. |
Calendar |
getSelectedCalendar()
Gets the selected calendar. |
Date |
getSelectedDate()
Gets the selected date. |
protected JTextField |
getTextField(JSpinner spinner)
Return the formatted text field used by the editor, or null if the editor doesn't descend from JSpinner.DefaultEditor. |
protected void |
initCalendar()
|
protected void |
initComponents()
|
protected void |
initDateFormat(Locale locale)
|
protected boolean |
isDateSelected(Calendar calendar)
|
protected boolean |
isMonthOutOfRange(Calendar calendar)
Checks if the month is out of the range of the DateModel. |
boolean |
isShowNoneButton()
Checks if none button is visible. |
boolean |
isShowThisMonthButton()
Checks if this month button is visible. |
protected boolean |
isToday(Calendar calendar)
|
boolean |
isViewOnly()
If the DateChooserPanel is view-only. |
void |
itemStateChanged(ItemEvent e)
|
void |
mouseClicked(MouseEvent e)
|
void |
mouseEntered(MouseEvent e)
|
void |
mouseExited(MouseEvent e)
|
void |
mousePressed(MouseEvent e)
|
void |
mouseReleased(MouseEvent e)
|
void |
mouseWheelMoved(MouseWheelEvent e)
|
protected void |
registerKeyStrokes()
|
protected void |
removeModeListener()
|
void |
setDateModel(DateModel dateModel)
Sets the DateModel. |
boolean |
setDisplayedYear(int year)
This method will set the displayed year of MonthChooserPanel. |
void |
setLocale(Locale locale)
|
void |
setMonthFormatter(DateFormat monthFormatter)
|
void |
setSelectedCalendar(Calendar selectedCalendar)
Sets the selected calendar. |
void |
setSelectedDate(Date selectedDate)
Sets the selected date. |
void |
setShowNoneButton(boolean showNoneButton)
Sets the none button visible. |
void |
setShowThisMonthButton(boolean showThisMonthButton)
Sets the this month button visible. |
void |
setViewOnly(boolean viewOnly)
Sets the view only attribute. |
protected void |
updateButtons()
|
protected void |
updateCalendar()
|
protected void |
updateDayOfWeekLabel(JComponent dayOfWeekLabel,
Calendar calendar)
|
protected void |
updateMonthCalendar(Calendar calendar)
Updates the calendar to represent the month. |
protected void |
updateMonthLabel(JComponent monthLabel,
Calendar date,
boolean isSelected,
boolean isToday)
|
void |
updateUI()
|
protected void |
updateYearLabel(JComponent yearLabel,
Calendar calendar)
|
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 |
---|
public static final String VIEWONLY_PROPERTY
public static int NAVIGATION_BUTTON_HEIGHT
public static int NAVIGATION_BUTTON_WIDTH
Constructor Detail |
---|
public MonthChooserPanel()
JPanel
with a double buffer and a flow layout.
public MonthChooserPanel(DateModel dateModel)
public MonthChooserPanel(boolean showNoneButton)
public MonthChooserPanel(DateModel dateModel, boolean showNoneButton)
public MonthChooserPanel(DateModel dateModel, boolean showNoneButton, Locale locale)
Method Detail |
---|
public DateModel getDateModel()
public void setDateModel(DateModel dateModel)
dateModel
- the date modelprotected void addModelListener()
protected void removeModeListener()
public void dateModelChanged(DateModelEvent e)
DateModelListener
dateModelChanged
in interface DateModelListener
public void mouseClicked(MouseEvent e)
mouseClicked
in interface MouseListener
public void mousePressed(MouseEvent e)
mousePressed
in interface MouseListener
public void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
public void mouseEntered(MouseEvent e)
mouseEntered
in interface MouseListener
public void mouseExited(MouseEvent e)
mouseExited
in interface MouseListener
public void mouseWheelMoved(MouseWheelEvent e)
mouseWheelMoved
in interface MouseWheelListener
public void enableMouseWheel()
public void disableMouseWheel()
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
public Date getSelectedDate()
public Calendar getSelectedCalendar()
public void setSelectedDate(Date selectedDate)
selectedDate
- the selected dateprotected Calendar getMonthCalendar()
protected void updateMonthCalendar(Calendar calendar)
calendar
- the calendar to represent to the month.public void setSelectedCalendar(Calendar selectedCalendar)
selectedCalendar
- the selected calendarpublic boolean setDisplayedYear(int year)
year
- Year to be viewed
public void itemStateChanged(ItemEvent e)
itemStateChanged
in interface ItemListener
protected Component createMonthsPanel()
protected Component createMonthPanel()
protected JComponent createMonthLabel(int i)
protected JTextField getTextField(JSpinner spinner)
spinner
- the spinner
protected Component createYearPanel()
protected Component createButtonPanel()
protected void initCalendar()
public void updateUI()
updateUI
in class JPanel
protected void initComponents()
protected void updateCalendar()
public boolean isViewOnly()
public void setViewOnly(boolean viewOnly)
viewOnly
- the flagprotected void updateDayOfWeekLabel(JComponent dayOfWeekLabel, Calendar calendar)
protected void updateMonthLabel(JComponent monthLabel, Calendar date, boolean isSelected, boolean isToday)
protected void updateYearLabel(JComponent yearLabel, Calendar calendar)
protected JComponent createYearLabel()
protected void registerKeyStrokes()
protected void updateButtons()
public boolean isShowNoneButton()
public void setShowNoneButton(boolean showNoneButton)
showNoneButton
- the flagpublic boolean isShowThisMonthButton()
public void setShowThisMonthButton(boolean showThisMonthButton)
showThisMonthButton
- the flagprotected boolean isDateSelected(Calendar calendar)
protected boolean isToday(Calendar calendar)
protected String getResourceString(String key)
key
- the key to get resource string
protected void initDateFormat(Locale locale)
public void setLocale(Locale locale)
setLocale
in class Component
protected boolean isMonthOutOfRange(Calendar calendar)
calendar
- the calendar.
public Calendar getDisplayedCalendar()
public DateFormat getMonthFormatter()
public void setMonthFormatter(DateFormat monthFormatter)
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |