|
MDateSelector | |||||||||
| 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
mseries.ui.MImagePanel
mseries.Calendar.MDateSelectorPanel
public class MDateSelectorPanel
A calender component that shows one month at a time with controls to change the month and year. The parameters to the calendar, including the style of the control are given in the MDateSelectorConstraints object that is passed. There is a default call MDefaultPullDownConstraints that can be used or subclassed to provide a set of application wide defaults.
MDateSelectorConstraints,
Serialized Form| 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 |
|---|
| 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 | |
|---|---|
MDateSelectorPanel()
|
|
MDateSelectorPanel(boolean lazy,
Date min,
Date max)
|
|
| Method Summary | |
|---|---|
void |
addMMonthListener(MMonthListener l)
Registers objects that are to listen to events from the DateSelector Event types of NEW_DATE and NEW_MONTH indicate that the value has changed |
void |
close(String command)
|
void |
dataChanged(MMonthEvent e)
Reacts to all changes in the data model (MMonth) which is given by the event type. |
boolean |
getCloseOnToday()
|
Date |
getDate()
Returns the currently selected date value |
int |
getFirstDay()
|
Date |
getMaximum()
Returns the latest possible date that can be displayed |
Date |
getMinimum()
Returns the earliest possible date that can be displayed |
boolean |
getShowTodayButton()
|
ResourceBundle |
getTextLocalizer()
|
void |
gridCellChanged(GridSelectionEvent e)
Captures changes in the currently selected cell and sets the current date in the data model from com.java.swing.event.ListSelectionListener |
boolean |
isFocusCycleRoot()
|
void |
mouseClicked(MouseEvent event)
|
void |
mouseEntered(MouseEvent event)
|
void |
mouseExited(MouseEvent event)
|
void |
mousePressed(MouseEvent event)
|
void |
mouseReleased(MouseEvent event)
|
void |
removeMMonthListener(MMonthListener l)
De-Registers objects that are to listen to events from the DateSelector |
void |
requestFocus()
|
void |
setBackground(Color background)
Set the background colour |
void |
setBackground(Color[] colors)
Sets the all the background colors for each day element 0 - SUNDAY, 6 - SATURDAY |
void |
setBackground(int day,
Color color)
Sets the background color for the column representing the day given. |
void |
setCellSize(Dimension cellSize)
|
protected void |
setChangerStyle(int style)
Sets the style of changer for the month & year, implementations include COMBOBOX/SPINNER and a scrollbar |
void |
setCloseOnToday(boolean close)
|
protected void |
setColours(Component c)
|
void |
setComponentFont(Component c)
|
void |
setDate(Date date)
Sets the date in the calendar |
void |
setDMY(Date date)
Sets a value in the component and does not change the time elements. |
void |
setEnabled(boolean enabled)
|
void |
setFirstDay(int firstDay)
The first column on the calendar grid shows the dates for the day passed here. |
void |
setFocusCycleRoot(boolean fcr)
|
void |
setFont(Font font)
|
void |
setForeground(Color foreground)
Set the foreground colour |
void |
setForeground(Color[] colors)
Sets the all the foreground colors for each day element 0 - SUNDAY, 6 - SATURDAY |
void |
setForeground(int day,
Color color)
Sets the foreground color for the column representing the day given. |
void |
setImageFile(String imageFile)
Sets the background image, if set the background color is ignored |
void |
setMaximum(Date max)
Sets the maximum date value allowed |
void |
setMinimum(Date min)
Sets the minimum date value allowed |
void |
setPullDownConstraints(MDateSelectorConstraints c)
Sets the display attributes for the pull down calendar |
void |
setShowTodayButton(boolean show)
|
void |
setTextLocalizer(ResourceBundle rb)
Sets the resource bundle for the day labels |
void |
valueChanged(MChangeEvent event)
for MChangeListener |
| Methods inherited from class mseries.ui.MImagePanel |
|---|
getImageFile, hasImage, loadImage, paintComponent, setImageURL |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MDateSelectorPanel()
public MDateSelectorPanel(boolean lazy,
Date min,
Date max)
lazy - set to true if it is known that the some constraints will be set before the panel is displayed,
this avoids the default constraints from being used only to get overridden by a new set.| Method Detail |
|---|
protected void setChangerStyle(int style)
style - a constant from MDateChangerMDateChangerpublic void requestFocus()
requestFocus in class JComponentpublic void setEnabled(boolean enabled)
setEnabled in class JComponentpublic void setTextLocalizer(ResourceBundle rb)
rb - resource bundlepublic ResourceBundle getTextLocalizer()
public void setMinimum(Date min)
min - the earliest possible datepublic Date getMinimum()
public void setMaximum(Date max)
max - the earliest possible datepublic Date getMaximum()
public void setCloseOnToday(boolean close)
public boolean getCloseOnToday()
public void setShowTodayButton(boolean show)
public boolean getShowTodayButton()
public void setDate(Date date)
date - the date to setpublic void setDMY(Date date)
date - the new datepublic Date getDate()
public void setFirstDay(int firstDay)
firstDay - a day constant from java.util.Calendar such as Calendar.SUNDAYpublic int getFirstDay()
public void addMMonthListener(MMonthListener l)
l - an MMonthListenerpublic void removeMMonthListener(MMonthListener l)
l - an MMonthListenerpublic void setPullDownConstraints(MDateSelectorConstraints c)
c - an instance of MDateSelectorConstraints that contains
the desired settings.public void gridCellChanged(GridSelectionEvent e)
gridCellChanged in interface GridSelectionListenerpublic void dataChanged(MMonthEvent e)
dataChanged in interface MMonthListenerpublic void setImageFile(String imageFile)
setImageFile in class MImagePanelimageFile - the image file, usual Java file types (.jpg, .gif, etc)
are supported.public void valueChanged(MChangeEvent event)
valueChanged in interface MChangeListenerpublic void mouseClicked(MouseEvent event)
mouseClicked in interface MouseListenerpublic void mouseEntered(MouseEvent event)
mouseEntered in interface MouseListenerpublic void mouseExited(MouseEvent event)
mouseExited in interface MouseListenerpublic void mousePressed(MouseEvent event)
mousePressed in interface MouseListenerpublic void mouseReleased(MouseEvent event)
mouseReleased in interface MouseListenerprotected void setColours(Component c)
public void setForeground(Color foreground)
setForeground in class JComponentpublic void setBackground(Color background)
setBackground in class JComponentpublic void setFont(Font font)
setFont in class JComponentpublic void setComponentFont(Component c)
public void setForeground(int day,
Color color)
day - a number in the range 1 - 7 from SUNDAY - SATURDAY, days not
set will assume the default foreground colorcolor - the color to set
public void setBackground(int day,
Color color)
day - a number in the range 1 - 7 from SUNDAY - SATURDAY, days not
set will assume the default background colorcolor - the color to setpublic void setBackground(Color[] colors)
colors - the array of colors to setpublic void setForeground(Color[] colors)
colors - the array of colors to setpublic void setCellSize(Dimension cellSize)
public void setFocusCycleRoot(boolean fcr)
setFocusCycleRoot in class Containerpublic boolean isFocusCycleRoot()
isFocusCycleRoot in class Containerpublic void close(String command)
|
MDateSelector | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||