|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdatechooser.model.AbstractDateChooseModel
public abstract class AbstractDateChooseModel
Dafault date selection model.
Uses one fully visible month and partially two neighbour months.
Provides basic functionality for month scrolling.
Only selection functions are abstract.
Модель выбора даты по умолчанию.
Отображается только месяц и частично предыдущий и следующий.
Обеспечивает всю базовую функциональность по прокрутке месяцев.
Делегирует только функции непосредственного выбора.
DateChoose,
Serialized Form| Field Summary | |
|---|---|
protected boolean |
changeEventsOn
|
| Constructor Summary | |
|---|---|
AbstractDateChooseModel(java.util.Calendar current,
int rowsCount,
int colsCount)
Constructor for abstract model. |
|
| Method Summary | |
|---|---|
void |
addCommitListener(CommitListener listener)
Adds commit selection event listener. |
void |
addCursorMoveListener(CursorMoveListener listener)
Adds cursor move listener. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds property change listener. |
void |
addSelectionChangedListener(SelectionChangedListener listener)
Adds selection change listener. |
protected abstract void |
applySelection()
Делает попытка выбрать ячейку под курсором. |
protected abstract void |
applySelectNothing()
Попытка не выбрать ни одной даты. |
void |
commit()
Commits selection. |
protected void |
fireCursorMove()
|
void |
firePropertyChange(java.lang.String name,
java.lang.Object oldValue,
java.lang.Object newValue)
|
void |
fireSelectionChange()
Fires "Selection changed" event. |
java.lang.String |
getCellCaption(int row,
int column)
Caption of the specified cell. |
java.util.Calendar |
getCellDate(int row,
int column)
Date corresponding to the specified cell. |
CellState |
getCellState(int row,
int column)
State of the specified cell. |
int |
getColsCount()
Columns count in day selection grid. |
java.util.Calendar |
getCurrent()
Get date under cursor. |
java.util.Calendar |
getDefaultDate()
Default date. |
java.lang.Iterable<Period> |
getForbidden()
Forbidden date for selection. |
PeriodSet |
getForbiddenSet()
|
java.util.Locale |
getLocale()
Locale. |
java.util.Calendar |
getMaxConstraint()
Get maximal enabled date. |
java.util.Calendar |
getMinConstraint()
Get minimal enabled date. |
int |
getRowsCount()
Rows count in day selection grid. |
java.util.Calendar |
getVisibleDate()
Visible date. |
protected void |
invalidate()
|
boolean |
isAutoScroll()
Is auto month scroll enabled. |
boolean |
isChangeEventsOn()
|
boolean |
isCursor(int row,
int column)
Is cursor in specified position. |
protected boolean |
isDateForbidden(java.util.Calendar date)
|
boolean |
isEnabled()
Is model enabled. |
protected boolean |
isForbiddenDefault(PeriodSet forbiddenPeriods)
|
boolean |
isLocked()
Is model locked (cursor is moving but no selection available). |
boolean |
isNothingAllowed()
Is null selection allowed. |
protected boolean |
isPeriodForbidden(Period period)
|
boolean |
isShowNeighbourMonth()
Are neighbour months visible. |
void |
monthShift(int shift)
Jumps on specified months count. |
boolean |
needsFullValidation()
Note: returns validation flag and resets it. |
void |
removeCommitListener(CommitListener listener)
Removes commit selection event listener. |
void |
removeCursorMoveListener(CursorMoveListener listener)
Removes cursor move listener. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes property change listener. |
void |
removeSelectionChangedListener(SelectionChangedListener listener)
Removes selection change listener. |
boolean |
select(java.util.Calendar aDate)
Selects specified date. |
boolean |
select(int row,
int column)
Selects specified cell. |
protected abstract void |
selectColumn(int column)
|
void |
selectNothing()
Selects null. |
void |
setAutoScroll(boolean autoScroll)
Sets auto month scroll enabled. |
void |
setChangeEventsOn(boolean changeEventsOn)
|
void |
setConstraints(java.util.Calendar min,
java.util.Calendar max)
Date selection constraints. |
void |
setDefaultDate(java.util.Calendar aDate)
Sets default date. |
void |
setEnabled(boolean enabled)
Sets model enabled. |
void |
setForbidden(java.lang.Iterable<Period> forbiddenPeriods)
Sets forbiddend for selection dates. |
void |
setForbiddenSet(PeriodSet forbiddenPeriods)
|
void |
setLocale(java.util.Locale locale)
Sets locale. |
void |
setLocked(boolean locked)
Sets lock. |
void |
setMaxConstraint(java.util.Calendar maxConstraint)
Sets maximal date. |
void |
setMinConstraint(java.util.Calendar minConstraint)
Sets minimal date. |
void |
setNothingAllowed(boolean allow)
Allows null selection. |
void |
setSelectedDate(java.util.Calendar aDate)
Sets cursor on specified date. |
void |
setShowNeighbourMonth(boolean showNeighbourMonth)
Sets neighbour months visibility. |
void |
shift(int rowShift,
int columnShift)
Shifts cursor on specified steps count vertically and hirizontally. |
void |
showMonthYear(int month,
int year)
Shows specified month and year. |
void |
tryApplySelection()
Trying select date under cursor, must be defined in child classes. |
void |
yearShift(int shift)
Jumps on specified years count. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface datechooser.model.DateChoose |
|---|
getSelectedDate, isNothingSelected, isSelected, setNothingSelected |
| Field Detail |
|---|
protected boolean changeEventsOn
| Constructor Detail |
|---|
public AbstractDateChooseModel(java.util.Calendar current,
int rowsCount,
int colsCount)
current - Current date.rowsCount - Rows count in day selection grid.colsCount - Columns count in day selection grid.| Method Detail |
|---|
protected abstract void selectColumn(int column)
public int getRowsCount()
DateChoose
getRowsCount in interface DateChoosepublic int getColsCount()
DateChoose
getColsCount in interface DateChoose
public boolean isCursor(int row,
int column)
DateChoose
isCursor in interface DateChoose
public CellState getCellState(int row,
int column)
DateChoose
getCellState in interface DateChoose
public java.lang.String getCellCaption(int row,
int column)
DateChoose
getCellCaption in interface DateChoose
public java.util.Calendar getCellDate(int row,
int column)
DateChoose
getCellDate in interface DateChoose
public void setConstraints(java.util.Calendar min,
java.util.Calendar max)
DateChoose
setConstraints in interface DateChoosepublic boolean needsFullValidation()
needsFullValidation in interface DateChoose
public boolean select(int row,
int column)
DateChoose
select in interface DateChoosepublic boolean select(java.util.Calendar aDate)
DateChoose
select in interface DateChooseprotected void invalidate()
public java.util.Calendar getCurrent()
DateChoose
getCurrent in interface DateChoose
public void showMonthYear(int month,
int year)
DateChoose
showMonthYear in interface DateChoosepublic java.util.Calendar getVisibleDate()
DateChoose
getVisibleDate in interface DateChoosepublic java.util.Calendar getDefaultDate()
DateChoose
getDefaultDate in interface DateChoose
public void setDefaultDate(java.util.Calendar aDate)
throws IncompatibleDataExeption
DateChoose
setDefaultDate in interface DateChooseIncompatibleDataExeption
public void shift(int rowShift,
int columnShift)
DateChoose
shift in interface DateChoosepublic void monthShift(int shift)
DateChoose
monthShift in interface DateChooseshift - На скоько месяцев переместиться.
Отрицательные значения обозначают прыжок назад.public void yearShift(int shift)
DateChoose
yearShift in interface DateChooseshift - На скоько лет переместиться.
Отрицательные значения обозначают прыжок назад.public boolean isAutoScroll()
DateChoose
isAutoScroll in interface DateChoosepublic void setAutoScroll(boolean autoScroll)
DateChoose
setAutoScroll in interface DateChoosepublic boolean isShowNeighbourMonth()
DateChoose
isShowNeighbourMonth in interface DateChoosepublic void setShowNeighbourMonth(boolean showNeighbourMonth)
DateChoose
setShowNeighbourMonth in interface DateChoosepublic boolean isEnabled()
DateChoose
isEnabled in interface DateChoosepublic void setEnabled(boolean enabled)
DateChoose
setEnabled in interface DateChoosepublic PeriodSet getForbiddenSet()
protected boolean isForbiddenDefault(PeriodSet forbiddenPeriods)
public void setForbiddenSet(PeriodSet forbiddenPeriods)
throws IncompatibleDataExeption
IncompatibleDataExeptionpublic java.lang.Iterable<Period> getForbidden()
DateChoose
getForbidden in interface DateChoosepublic void setForbidden(java.lang.Iterable<Period> forbiddenPeriods)
DateChoose
setForbidden in interface DateChooseprotected boolean isPeriodForbidden(Period period)
protected boolean isDateForbidden(java.util.Calendar date)
public java.util.Calendar getMinConstraint()
DateChoose
getMinConstraint in interface DateChoosepublic void setMinConstraint(java.util.Calendar minConstraint)
DateChoose
setMinConstraint in interface DateChoosepublic java.util.Calendar getMaxConstraint()
DateChoose
getMaxConstraint in interface DateChoosepublic void setMaxConstraint(java.util.Calendar maxConstraint)
DateChoose
setMaxConstraint in interface DateChoosepublic void setSelectedDate(java.util.Calendar aDate)
DateChoose
setSelectedDate in interface DateChoosepublic java.util.Locale getLocale()
DateChoose
getLocale in interface DateChoosepublic void setLocale(java.util.Locale locale)
DateChoose
setLocale in interface DateChoosepublic void commit()
DateChoose
commit in interface DateChoosepublic final void tryApplySelection()
DateChoose
tryApplySelection in interface DateChoosepublic boolean isLocked()
DateChoose
isLocked in interface DateChoosepublic void setLocked(boolean locked)
DateChoose
setLocked in interface DateChoosepublic void setNothingAllowed(boolean allow)
DateChoose
setNothingAllowed in interface DateChoosepublic boolean isNothingAllowed()
DateChoose
isNothingAllowed in interface DateChoosepublic boolean isChangeEventsOn()
public void setChangeEventsOn(boolean changeEventsOn)
public void selectNothing()
DateChoose
selectNothing in interface DateChoosepublic void addSelectionChangedListener(SelectionChangedListener listener)
DateChoose
addSelectionChangedListener in interface DateChoosepublic void removeSelectionChangedListener(SelectionChangedListener listener)
DateChoose
removeSelectionChangedListener in interface DateChoosepublic void fireSelectionChange()
DateChoose
fireSelectionChange in interface DateChoosepublic void addCommitListener(CommitListener listener)
DateChoose
addCommitListener in interface DateChoosepublic void removeCommitListener(CommitListener listener)
DateChoose
removeCommitListener in interface DateChoosepublic void addCursorMoveListener(CursorMoveListener listener)
DateChoose
addCursorMoveListener in interface DateChoosepublic void removeCursorMoveListener(CursorMoveListener listener)
DateChoose
removeCursorMoveListener in interface DateChooseprotected void fireCursorMove()
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
DateChoose
addPropertyChangeListener in interface DateChoosepublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
DateChoose
removePropertyChangeListener in interface DateChoose
public void firePropertyChange(java.lang.String name,
java.lang.Object oldValue,
java.lang.Object newValue)
protected abstract void applySelection()
protected abstract void applySelectNothing()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||