|
||||||||||
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 uic.widgets.calendar.UICCalendar
public class UICCalendar
A widget for selecting a date.
By clicking on any date that date will be selected. If the next month is clicked, the view will change to the next month, the same goes for the previous month.
By calling the setShowWeekNrs(boolean)
method
weeknumbers can be turned on or off. With the weeknumbers
showing the UICCalendar looks like this:
The UICCalendar follows Translate.getLocale(), unless
specified otherwise. For instance, the UICCalendar for the
Dutch locale ("nl_NL") will look like this:
Nested Class Summary |
---|
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.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
static String |
SELECT_ACTION
The actionCommand for the ActionEvent that will be fired on date selections. |
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 | |
---|---|
UICCalendar()
Constructs a new UICCalendar with the default locale and today as selected date. |
|
UICCalendar(Locale locale,
Calendar calendar)
Constructs a new UICCalendar with the specified locale and Calendar to use as selected date. |
|
UICCalendar(UICCalendarModel model)
Constructs a new UICCalendar that uses the specified model. |
Method Summary | |
---|---|
void |
addActionListener(ActionListener listener)
Adds the specified listener to the ActionListener list. |
void |
changedDateSlot(int oldDate,
int newDate)
Gets called for date changes in the model. |
void |
changedMonthSlot()
Gets called for month changes in the model. |
Calendar |
getCalendar()
|
int |
getDate()
|
protected int |
getMaxStringWidth(String[] strings)
|
Dimension |
getMinimumSize()
Returns the minimal size for this UICCalendar component. |
UICCalendarModel |
getModel()
|
int |
getMonth()
|
protected int |
getMonth(int row,
int col)
Returns the month for the specified row and column, or -1 if out of range. |
protected String |
getMonthName(int row,
int col)
Returns the monthname for the specified row and column, or empty if out of range. |
boolean |
getMonthSelectMode()
Return true when the month selection popup should be visible. |
Dimension |
getPreferredSize()
Returns the preferred size for this UICCalendar component. |
boolean |
getShowWeekNrs()
Returns whether or not week numbers are shown. |
int |
getWeek()
|
int |
getYear()
|
static void |
main(String[] args)
|
void |
paintComponent(Graphics g)
Paint the calendar on this component. |
void |
removeActionListener(ActionListener listener)
Removes the specified listener from the ActionListener list. |
protected void |
selectDateSlot(int x,
int y,
boolean finalSelect)
Selects the date at the specified x,y position. |
protected void |
selectMonthSlot(int x,
int y,
boolean finalSelect)
|
void |
setCalendar(Calendar calendar)
|
void |
setDate(int date)
|
void |
setMonth(int month)
|
void |
setMonthSelectMode(boolean monthSelect)
Set to true when the month selection popup should be visible. |
void |
setShowWeekNrs(boolean showWeekNrs)
Sets the showing of week numbers on or off. |
void |
setWeek(int week)
|
void |
setYear(int year)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static String SELECT_ACTION
Constructor Detail |
---|
public UICCalendar()
public UICCalendar(Locale locale, Calendar calendar)
locale
- the locale to use.calendar
- the Calendar to use as selected date.public UICCalendar(UICCalendarModel model)
model
- the calendar model to use.Method Detail |
---|
public void setShowWeekNrs(boolean showWeekNrs)
showWeekNrs
- indicates whether or not to show week numbers.public boolean getShowWeekNrs()
public Dimension getMinimumSize()
getMinimumSize
in class JComponent
public Dimension getPreferredSize()
getPreferredSize
in class JComponent
public void paintComponent(Graphics g)
paintComponent
in class JComponent
public void setMonthSelectMode(boolean monthSelect)
monthSelect
- true when month selection popup should be visiblepublic boolean getMonthSelectMode()
protected String getMonthName(int row, int col)
protected int getMonth(int row, int col)
protected void selectMonthSlot(int x, int y, boolean finalSelect)
protected void selectDateSlot(int x, int y, boolean finalSelect)
public void changedMonthSlot()
public void changedDateSlot(int oldDate, int newDate)
public UICCalendarModel getModel()
public void setCalendar(Calendar calendar)
public Calendar getCalendar()
public void setYear(int year)
public int getYear()
public void setMonth(int month)
public int getMonth()
public void setDate(int date)
public int getDate()
public void setWeek(int week)
public int getWeek()
public void addActionListener(ActionListener listener)
listener
- the listener to add.public void removeActionListener(ActionListener listener)
listener
- the listener to remove.protected int getMaxStringWidth(String[] strings)
public static void main(String[] args) throws Exception
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |