|
||||||||||
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 FormField 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 DateChoose
public 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 DateChoose
public boolean needsFullValidation()
needsFullValidation
in interface DateChoose
public boolean select(int row, int column)
DateChoose
select
in interface DateChoose
public boolean select(java.util.Calendar aDate)
DateChoose
select
in interface DateChoose
protected void invalidate()
public java.util.Calendar getCurrent()
DateChoose
getCurrent
in interface DateChoose
public void showMonthYear(int month, int year)
DateChoose
showMonthYear
in interface DateChoose
public java.util.Calendar getVisibleDate()
DateChoose
getVisibleDate
in interface DateChoose
public java.util.Calendar getDefaultDate()
DateChoose
getDefaultDate
in interface DateChoose
public void setDefaultDate(java.util.Calendar aDate) throws IncompatibleDataExeption
DateChoose
setDefaultDate
in interface DateChoose
IncompatibleDataExeption
public void shift(int rowShift, int columnShift)
DateChoose
shift
in interface DateChoose
public void monthShift(int shift)
DateChoose
monthShift
in interface DateChoose
shift
- На скоько месяцев переместиться.
Отрицательные значения обозначают прыжок назад.public void yearShift(int shift)
DateChoose
yearShift
in interface DateChoose
shift
- На скоько лет переместиться.
Отрицательные значения обозначают прыжок назад.public boolean isAutoScroll()
DateChoose
isAutoScroll
in interface DateChoose
public void setAutoScroll(boolean autoScroll)
DateChoose
setAutoScroll
in interface DateChoose
public boolean isShowNeighbourMonth()
DateChoose
isShowNeighbourMonth
in interface DateChoose
public void setShowNeighbourMonth(boolean showNeighbourMonth)
DateChoose
setShowNeighbourMonth
in interface DateChoose
public boolean isEnabled()
DateChoose
isEnabled
in interface DateChoose
public void setEnabled(boolean enabled)
DateChoose
setEnabled
in interface DateChoose
public PeriodSet getForbiddenSet()
protected boolean isForbiddenDefault(PeriodSet forbiddenPeriods)
public void setForbiddenSet(PeriodSet forbiddenPeriods) throws IncompatibleDataExeption
IncompatibleDataExeption
public java.lang.Iterable<Period> getForbidden()
DateChoose
getForbidden
in interface DateChoose
public void setForbidden(java.lang.Iterable<Period> forbiddenPeriods)
DateChoose
setForbidden
in interface DateChoose
protected boolean isPeriodForbidden(Period period)
protected boolean isDateForbidden(java.util.Calendar date)
public java.util.Calendar getMinConstraint()
DateChoose
getMinConstraint
in interface DateChoose
public void setMinConstraint(java.util.Calendar minConstraint)
DateChoose
setMinConstraint
in interface DateChoose
public java.util.Calendar getMaxConstraint()
DateChoose
getMaxConstraint
in interface DateChoose
public void setMaxConstraint(java.util.Calendar maxConstraint)
DateChoose
setMaxConstraint
in interface DateChoose
public void setSelectedDate(java.util.Calendar aDate)
DateChoose
setSelectedDate
in interface DateChoose
public java.util.Locale getLocale()
DateChoose
getLocale
in interface DateChoose
public void setLocale(java.util.Locale locale)
DateChoose
setLocale
in interface DateChoose
public void commit()
DateChoose
commit
in interface DateChoose
public final void tryApplySelection()
DateChoose
tryApplySelection
in interface DateChoose
public boolean isLocked()
DateChoose
isLocked
in interface DateChoose
public void setLocked(boolean locked)
DateChoose
setLocked
in interface DateChoose
public void setNothingAllowed(boolean allow)
DateChoose
setNothingAllowed
in interface DateChoose
public boolean isNothingAllowed()
DateChoose
isNothingAllowed
in interface DateChoose
public boolean isChangeEventsOn()
public void setChangeEventsOn(boolean changeEventsOn)
public void selectNothing()
DateChoose
selectNothing
in interface DateChoose
public void addSelectionChangedListener(SelectionChangedListener listener)
DateChoose
addSelectionChangedListener
in interface DateChoose
public void removeSelectionChangedListener(SelectionChangedListener listener)
DateChoose
removeSelectionChangedListener
in interface DateChoose
public void fireSelectionChange()
DateChoose
fireSelectionChange
in interface DateChoose
public void addCommitListener(CommitListener listener)
DateChoose
addCommitListener
in interface DateChoose
public void removeCommitListener(CommitListener listener)
DateChoose
removeCommitListener
in interface DateChoose
public void addCursorMoveListener(CursorMoveListener listener)
DateChoose
addCursorMoveListener
in interface DateChoose
public void removeCursorMoveListener(CursorMoveListener listener)
DateChoose
removeCursorMoveListener
in interface DateChoose
protected void fireCursorMove()
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
DateChoose
addPropertyChangeListener
in interface DateChoose
public 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 |