datechooser.beans
Class DateChooserDialog

java.lang.Object
  extended by datechooser.beans.DateChooserDialog
All Implemented Interfaces:
DateChooserBean, java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener

public class DateChooserDialog
extends java.lang.Object
implements DateChooserBean, java.io.Serializable, java.beans.PropertyChangeListener

Bean: dialog for date selection. Not visual.
Компонент: диалоговое окно для выбора дат. Не визуальный.

Since:
1.0
Author:
Androsov Vadim
See Also:
Serialized Form

Field Summary
static java.lang.String DIALOG_PREFIX
          Dialog property's name prefix.
static java.lang.String PROPERTY_CAPTION
          Property name.
static java.lang.String PROPERTY_MODAL
          Property name.
static long serialVersionUID
           
 
Fields inherited from interface datechooser.beans.DateChooserBean
PREFIX, PROPERTY_AUTOSCROLL, PROPERTY_BACK_COLOR, PROPERTY_BEHAVIOR, PROPERTY_CALENDAR_SIZE, PROPERTY_CURRENT, PROPERTY_DEFAULT_DATES, PROPERTY_ENABLED, PROPERTY_FORBID_DATES, PROPERTY_LOCALE, PROPERTY_LOCKED, PROPERTY_MAX_DATE, PROPERTY_MIN_DATE, PROPERTY_NAVIG_FONT, PROPERTY_NAVIG_PANE, PROPERTY_NOTHING_ALLOWED, PROPERTY_ONE_MONTH, PROPERTY_VIEW, PROPERTY_WEEK_STYLE
 
Constructor Summary
DateChooserDialog()
           
 
Method Summary
 void addCommitListener(CommitListener listener)
          Adds listener for commit event.
 void addCursorMoveListener(CursorMoveListener listener)
          Adds listener for cursor move event.
 void addSelectionChangedListener(SelectionChangedListener listener)
          Adds listener for selection changed event.
 DateChooserDialog clone()
          Clones bean.
 void commit()
          Commits selection.
 AppearancesList getAppearancesList()
          Gets skins list.
 MultyModelBehavior getBehavior()
          Selection model: one date, single period, multy.
 java.awt.Color getCalendarBackground()
          Background color for calendar panel.
 java.awt.Dimension getCalendarPreferredSize()
          Calendar panel preferred size.
 java.lang.String getCaption()
          Dialog caption.
 java.util.Calendar getCurrent()
          Current date (date under cursor).
 int getCurrentNavigateIndex()
          Navigation panels:
1) ComboBox for month selection, textfield for year,
2) Use only buttons.
 AppearancesList getCurrentView()
          Current calendar appearance.
 PeriodSet getDefaultPeriods()
          Default date(s).
 PeriodSet getForbiddenPeriods()
          Forbidden date(s).
 java.util.Locale getLocale()
          Lovalization.
 java.util.Calendar getMaxDate()
          Maximal date user can select.
 java.util.Calendar getMinDate()
          Minimal date user can select.
 java.awt.Font getNavigateFont()
          Navigate panel font.
 java.awt.Dimension getPreferredSize()
           
 java.util.Calendar getSelectedDate()
          Selected date.
 PeriodSet getSelectedPeriodSet()
          All selected dates.
 java.lang.Iterable<Period> getSelection()
          All selected dates.
 WeekDaysStyle getWeekStyle()
          Weeddays output style: one letter, short, full.
 boolean isAutoScroll()
          If true component automatically scrolls when date from the next month selected, otherwise user can not select next month's date.
 boolean isEnabled()
          Is calendar enabled (allows date selection).
 boolean isLocked()
          If true - user can use calendar only in readonly mode, you can move cursor, scroll month and year, but can not select anything.
 boolean isModal()
          Modal dialog.
 boolean isNothingAllowed()
          Allows null selection.
 boolean isShowOneMonth()
          If true - days of next month are visible.
 void propertyChange(java.beans.PropertyChangeEvent evt)
           
 void removeCommitListener(CommitListener listener)
          Removes listener for commit event.
 void removeCursorMoveListener(CursorMoveListener listener)
          Removes listener for cursor move event.
 void removeSelectionChangedListener(SelectionChangedListener listener)
          Removes listener for selection change event.
 void setAutoScroll(boolean autoScroll)
           
 void setBehavior(MultyModelBehavior behavior)
           
 void setCalendarBackground(java.awt.Color backColor)
           
 void setCalendarPreferredSize(java.awt.Dimension dim)
           
 void setCaption(java.lang.String caption)
           
 boolean setCurrent(java.util.Calendar aDate)
           
 void setCurrentNavigateIndex(int currentNavigateIndex)
           
 void setCurrentView(AppearancesList aList)
           
 void setDefaultPeriods(PeriodSet periods)
          Задает значение по умолчанию.
 void setEnabled(boolean enabled)
           
 void setForbidden(java.lang.Iterable<Period> forbiddenPeriods)
           
 void setForbiddenPeriods(PeriodSet periods)
          Sets forbiddent date(s).
 void setLocale(java.util.Locale locale)
           
 void setLocked(boolean lock)
           
 void setMaxDate(java.util.Calendar aDate)
           
 void setMinDate(java.util.Calendar aDate)
           
 void setModal(boolean modal)
           
 void setNavigateFont(java.awt.Font font)
           
 void setNothingAllowed(boolean allow)
           
 void setSelectedDate(java.util.Calendar aDate)
           
 void setSelection(java.lang.Iterable<Period> periods)
           
 void setSelection(PeriodSet periods)
           
 void setShowOneMonth(boolean showOneMonth)
           
 void setWeekStyle(WeekDaysStyle weekStyle)
           
 void showDialog(java.awt.Frame owner)
          Displays dialog window using "modal" property.
 void showDialog(java.awt.Frame owner, boolean isModal)
          Displays dialog window centered in relation to the parent.
 void showDialog(java.awt.Frame owner, boolean isModal, java.awt.Point location)
          Displays dialog window with specified location.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values

DIALOG_PREFIX

public static final java.lang.String DIALOG_PREFIX
Dialog property's name prefix.
Приставка к названиям всех свойтсв диалогового окна выбора даты.

Since:
1.0
See Also:
Constant Field Values

PROPERTY_MODAL

public static final java.lang.String PROPERTY_MODAL
Property name.
Название свойства.

Since:
1.0
See Also:
isModal(), Constant Field Values

PROPERTY_CAPTION

public static final java.lang.String PROPERTY_CAPTION
Property name.
Название свойства.

Since:
1.0
See Also:
getCaption(), Constant Field Values
Constructor Detail

DateChooserDialog

public DateChooserDialog()
Method Detail

isModal

public boolean isModal()
Modal dialog.
Модальность окна.

Since:
1.0

setModal

public void setModal(boolean modal)
Since:
1.0
See Also:
isModal()

getCaption

public java.lang.String getCaption()
Dialog caption.
Заголовок окна.

Since:
1.0

setCaption

public void setCaption(java.lang.String caption)
Since:
1.0
See Also:
getCaption()

showDialog

public void showDialog(java.awt.Frame owner)
Displays dialog window using "modal" property.
Отображает диалоговое окно учитывая свойство "Модальное"

Since:
1.0
See Also:
showDialog(Frame, boolean), isModal()

showDialog

public void showDialog(java.awt.Frame owner,
                       boolean isModal)
Displays dialog window centered in relation to the parent.
Отображает диалоговое окно по центру относительно родителя.

Parameters:
owner - Parent component.
Родительский компонент.
isModal - Is dialog modal.
Модальность
Since:
1.0

showDialog

public void showDialog(java.awt.Frame owner,
                       boolean isModal,
                       java.awt.Point location)
Displays dialog window with specified location.
Отображает диалоговое в заданной позиции.

Parameters:
owner - Parent component.
Родительский компонент.
isModal - Is dialog modal.
Модальность
Since:
1.1

getBehavior

public MultyModelBehavior getBehavior()
Description copied from interface: DateChooserBean
Selection model: one date, single period, multy.
Модель выбора календаря: одна дата, один период или множественный.

Specified by:
getBehavior in interface DateChooserBean
See Also:
MultyModelBehavior

getCurrentView

public AppearancesList getCurrentView()
Description copied from interface: DateChooserBean
Current calendar appearance.
Текущий внешинй вид календаря.

Specified by:
getCurrentView in interface DateChooserBean
See Also:
AppearancesList

getDefaultPeriods

public PeriodSet getDefaultPeriods()
Description copied from interface: DateChooserBean
Default date(s).
Множество дат, выбранных по умолчанию.

Specified by:
getDefaultPeriods in interface DateChooserBean
See Also:
PeriodSet, DateChooserBean.setDefaultPeriods(PeriodSet)

getForbiddenPeriods

public PeriodSet getForbiddenPeriods()
Description copied from interface: DateChooserBean
Forbidden date(s).
Множество запрещенных дат.

Specified by:
getForbiddenPeriods in interface DateChooserBean
See Also:
PeriodSet, DateChooserBean.setForbiddenPeriods(PeriodSet)

getMaxDate

public java.util.Calendar getMaxDate()
Description copied from interface: DateChooserBean
Maximal date user can select.
Максимально допустимая для выбора дата.

Specified by:
getMaxDate in interface DateChooserBean
See Also:
DateChooserBean.setMaxDate(Calendar)

getMinDate

public java.util.Calendar getMinDate()
Description copied from interface: DateChooserBean
Minimal date user can select.
Минимально допустимая для выбора дата.

Specified by:
getMinDate in interface DateChooserBean
See Also:
DateChooserBean.setMinDate(Calendar)

getSelectedDate

public java.util.Calendar getSelectedDate()
Description copied from interface: DateChooserBean
Selected date.
Выбранная дата.

Specified by:
getSelectedDate in interface DateChooserBean
Returns:
Selected date. First date if some dates or period(s) selected
Выбранная дата. Если выбрано несколько дат, вернет первую.

getSelectedPeriodSet

public PeriodSet getSelectedPeriodSet()
Description copied from interface: DateChooserBean
All selected dates.
Множество выбранных дат.

Specified by:
getSelectedPeriodSet in interface DateChooserBean
See Also:
PeriodSet

getSelection

public java.lang.Iterable<Period> getSelection()
Description copied from interface: DateChooserBean
All selected dates.
Множество выбранных дат.

Specified by:
getSelection in interface DateChooserBean
See Also:
Period

isAutoScroll

public boolean isAutoScroll()
Description copied from interface: DateChooserBean
If true component automatically scrolls when date from the next month selected, otherwise user can not select next month's date.
Если данное свойство истинно, календарь автоматически прокручивается при выборе даты из сосещнего месяца, иначе выбор дня из соседнего месяца не допускается.

Specified by:
isAutoScroll in interface DateChooserBean

isEnabled

public boolean isEnabled()
Description copied from interface: DateChooserBean
Is calendar enabled (allows date selection).
Свойство, определяющее доступен ли календарь для редактирования.

Specified by:
isEnabled in interface DateChooserBean

isShowOneMonth

public boolean isShowOneMonth()
Description copied from interface: DateChooserBean
If true - days of next month are visible. Does not influence scroll property.
Если свойство истинно, отображаются дни из соседнего месяца. На прокрутку это свойство никак не влияет.

Specified by:
isShowOneMonth in interface DateChooserBean

setAutoScroll

public void setAutoScroll(boolean autoScroll)
Specified by:
setAutoScroll in interface DateChooserBean
See Also:
DateChooserBean.isAutoScroll()

setBehavior

public void setBehavior(MultyModelBehavior behavior)
Specified by:
setBehavior in interface DateChooserBean
See Also:
DateChooserBean.getBehavior()

setCurrentView

public void setCurrentView(AppearancesList aList)
Specified by:
setCurrentView in interface DateChooserBean
See Also:
DateChooserBean.getCurrentView()

setDefaultPeriods

public void setDefaultPeriods(PeriodSet periods)
                       throws IncompatibleDataExeption
Description copied from interface: DateChooserBean
Задает значение по умолчанию. Нельзя сделать по умолчанию запрещенные даты, но можно лежащие за пределами минимальной и максимальной.

Specified by:
setDefaultPeriods in interface DateChooserBean
Throws:
IncompatibleDataExeption - Возникает при попытке задать по умолчанию запрещенные даты.
See Also:
DateChooserBean.getDefaultPeriods(), PeriodSet, IncompatibleDataExeption

setEnabled

public void setEnabled(boolean enabled)
Specified by:
setEnabled in interface DateChooserBean
See Also:
DateChooserBean.isEnabled()

setForbidden

public void setForbidden(java.lang.Iterable<Period> forbiddenPeriods)
Specified by:
setForbidden in interface DateChooserBean
See Also:
DateChooserBean.setForbiddenPeriods(PeriodSet), Period

setForbiddenPeriods

public void setForbiddenPeriods(PeriodSet periods)
                         throws IncompatibleDataExeption
Description copied from interface: DateChooserBean
Sets forbiddent date(s). You can not forbid default date(s).
Задает запрещенные даты. Нельзя запретить даты по умолчанию.

Specified by:
setForbiddenPeriods in interface DateChooserBean
Throws:
IncompatibleDataExeption - If you are trying to forbid default date.
Возникает при попытке запретить дату по умолчанию.
See Also:
DateChooserBean.getForbiddenPeriods(), PeriodSet, IncompatibleDataExeption

setMaxDate

public void setMaxDate(java.util.Calendar aDate)
Specified by:
setMaxDate in interface DateChooserBean
See Also:
DateChooserBean.getMaxDate()

setMinDate

public void setMinDate(java.util.Calendar aDate)
Specified by:
setMinDate in interface DateChooserBean
See Also:
DateChooserBean.getMinDate()

setSelectedDate

public void setSelectedDate(java.util.Calendar aDate)
Specified by:
setSelectedDate in interface DateChooserBean
See Also:
DateChooserBean.getSelectedDate()

setSelection

public void setSelection(java.lang.Iterable<Period> periods)
Specified by:
setSelection in interface DateChooserBean
See Also:
DateChooserBean.getSelection()

setSelection

public void setSelection(PeriodSet periods)
Specified by:
setSelection in interface DateChooserBean
See Also:
DateChooserBean.getSelectedPeriodSet()

setShowOneMonth

public void setShowOneMonth(boolean showOneMonth)
Specified by:
setShowOneMonth in interface DateChooserBean
See Also:
DateChooserBean.isShowOneMonth()

getPreferredSize

public java.awt.Dimension getPreferredSize()

getNavigateFont

public java.awt.Font getNavigateFont()
Description copied from interface: DateChooserBean
Navigate panel font.
Шрифт панели навигации.

Specified by:
getNavigateFont in interface DateChooserBean
See Also:
DateChooserBean.setCurrentNavigateIndex(int)

setNavigateFont

public void setNavigateFont(java.awt.Font font)
Specified by:
setNavigateFont in interface DateChooserBean
See Also:
DateChooserBean.getNavigateFont()

getLocale

public java.util.Locale getLocale()
Description copied from interface: DateChooserBean
Lovalization.
Локализация.

Specified by:
getLocale in interface DateChooserBean

setLocale

public void setLocale(java.util.Locale locale)
Specified by:
setLocale in interface DateChooserBean
See Also:
DateChooserBean.getLocale()

getCurrentNavigateIndex

public int getCurrentNavigateIndex()
Description copied from interface: DateChooserBean
Navigation panels:
1) ComboBox for month selection, textfield for year,
2) Use only buttons.
Навигационная панель: 1) Месяц выбирается с помощью раскрывающегося списка, год - поля 2) Все выбирается с помощью кнопок.

Specified by:
getCurrentNavigateIndex in interface DateChooserBean

setCurrentNavigateIndex

public void setCurrentNavigateIndex(int currentNavigateIndex)
Specified by:
setCurrentNavigateIndex in interface DateChooserBean
See Also:
DateChooserBean.getCurrentNavigateIndex()

isLocked

public boolean isLocked()
Description copied from interface: DateChooserBean
If true - user can use calendar only in readonly mode, you can move cursor, scroll month and year, but can not select anything.
Если истинно - календарь можно использовать только для просмотра значений. Можно перемещать курсор, переключать месяцы и годы, но нельзы что-то выбрать.

Specified by:
isLocked in interface DateChooserBean

setLocked

public void setLocked(boolean lock)
Specified by:
setLocked in interface DateChooserBean
See Also:
DateChooserBean.isLocked()

getWeekStyle

public WeekDaysStyle getWeekStyle()
Description copied from interface: DateChooserBean
Weeddays output style: one letter, short, full.
Возвращает стиль вывода дней недели: одной буквой, кратко, полностью.

Specified by:
getWeekStyle in interface DateChooserBean
See Also:
WeekDaysStyle

setWeekStyle

public void setWeekStyle(WeekDaysStyle weekStyle)
Specified by:
setWeekStyle in interface DateChooserBean
See Also:
DateChooserBean.getWeekStyle()

getCurrent

public java.util.Calendar getCurrent()
Description copied from interface: DateChooserBean
Current date (date under cursor).
Дата, на которой находится курсор.

Specified by:
getCurrent in interface DateChooserBean

setCurrent

public boolean setCurrent(java.util.Calendar aDate)
Specified by:
setCurrent in interface DateChooserBean
See Also:
DateChooserBean.getCurrent()

setNothingAllowed

public void setNothingAllowed(boolean allow)
Specified by:
setNothingAllowed in interface DateChooserBean
See Also:
DateChooserBean.isNothingAllowed()

isNothingAllowed

public boolean isNothingAllowed()
Description copied from interface: DateChooserBean
Allows null selection.
Разрешает не выбирать ни одной даты (делать пустой выбор).

Specified by:
isNothingAllowed in interface DateChooserBean

getCalendarPreferredSize

public java.awt.Dimension getCalendarPreferredSize()
Description copied from interface: DateChooserBean
Calendar panel preferred size.
Предпочтительный размер панели календаря.

Specified by:
getCalendarPreferredSize in interface DateChooserBean

setCalendarPreferredSize

public void setCalendarPreferredSize(java.awt.Dimension dim)
Specified by:
setCalendarPreferredSize in interface DateChooserBean
See Also:
DateChooserBean.getCalendarPreferredSize()

commit

public void commit()
Description copied from interface: DateChooserBean
Commits selection.
Подтверждает выбор.

Specified by:
commit in interface DateChooserBean

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent evt)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener

addCommitListener

public void addCommitListener(CommitListener listener)
Description copied from interface: DateChooserBean
Adds listener for commit event.
Добавляет слушателя события "подтверждение выбора" (commit).

Specified by:
addCommitListener in interface DateChooserBean
See Also:
CommitListener, CommitEvent

removeCommitListener

public void removeCommitListener(CommitListener listener)
Description copied from interface: DateChooserBean
Removes listener for commit event.
Удаляет слушателя события "подтверждение выбора" (commit).

Specified by:
removeCommitListener in interface DateChooserBean
See Also:
CommitListener, CommitEvent

addSelectionChangedListener

public void addSelectionChangedListener(SelectionChangedListener listener)
Description copied from interface: DateChooserBean
Adds listener for selection changed event. Добавляет слушателя события "изменение выбора".

Specified by:
addSelectionChangedListener in interface DateChooserBean
See Also:
SelectionChangedListener, SelectionChangedEvent

removeSelectionChangedListener

public void removeSelectionChangedListener(SelectionChangedListener listener)
Description copied from interface: DateChooserBean
Removes listener for selection change event.
Удаляет слушателя события "изменение выбора".

Specified by:
removeSelectionChangedListener in interface DateChooserBean
See Also:
SelectionChangedListener, SelectionChangedEvent

addCursorMoveListener

public void addCursorMoveListener(CursorMoveListener listener)
Description copied from interface: DateChooserBean
Adds listener for cursor move event.
Добавляет слушателя события "перемещение курсора".

Specified by:
addCursorMoveListener in interface DateChooserBean
See Also:
CursorMoveListener, CursorMoveEvent

removeCursorMoveListener

public void removeCursorMoveListener(CursorMoveListener listener)
Description copied from interface: DateChooserBean
Removes listener for cursor move event.
Удаляет слушателя события "перемещение курсора".

Specified by:
removeCursorMoveListener in interface DateChooserBean
See Also:
CursorMoveListener, CursorMoveEvent

getCalendarBackground

public java.awt.Color getCalendarBackground()
Description copied from interface: DateChooserBean
Background color for calendar panel. Visible only if some of day cells are transparent.
Цвет фона панели календаря. Внимание! Влияет на внешний вид только при условии прозрачности ячеек выбора дня.

Specified by:
getCalendarBackground in interface DateChooserBean

setCalendarBackground

public void setCalendarBackground(java.awt.Color backColor)
Specified by:
setCalendarBackground in interface DateChooserBean
See Also:
DateChooserBean.getCalendarBackground()

getAppearancesList

public AppearancesList getAppearancesList()
Description copied from interface: DateChooserBean
Gets skins list. Возвращает список скинов.

Specified by:
getAppearancesList in interface DateChooserBean
Returns:
Appearances list. Специальный объект - список представлений.

clone

public DateChooserDialog clone()
Description copied from interface: DateChooserBean
Clones bean.
Клонирование компонента.

Specified by:
clone in interface DateChooserBean
Overrides:
clone in class java.lang.Object