|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.jaret.util.ui.timebars.model.AbstractTimeBarModel
public abstract class AbstractTimeBarModel
An abstract implementation of the TimeBarModel interface. The storage of the rows has to be added. Care has to be taken to register with the rows via the TimeBarRowListener interface. If this is ommited changes in the rows will not autmatic propagate to the TimeBarModelListeners registered with the model. The implementation must also care about the min/max fields and set them.
| Field Summary | |
|---|---|
protected java.util.List<TimeBarModelListener> |
_listenerList
List of model listeners. |
protected de.jaret.util.date.JaretDate |
_maxDate
Maximum date of the complete model. |
protected de.jaret.util.date.JaretDate |
_minDate
Minimum date of the complete model. |
| Constructor Summary | |
|---|---|
AbstractTimeBarModel()
|
|
| Method Summary | |
|---|---|
void |
addTimeBarModelListener(TimeBarModelListener tbml)
Add a listener to listen for changes in the model. |
void |
elementAdded(TimeBarRow row,
de.jaret.util.date.Interval element)
A new element was added to the row. |
void |
elementChanged(TimeBarRow row,
de.jaret.util.date.Interval element)
An element in the row has changed. |
void |
elementRemoved(TimeBarRow row,
de.jaret.util.date.Interval element)
An element was removed from the row. |
protected void |
fireElementAdded(TimeBarRow row,
de.jaret.util.date.Interval element)
Inform listeners about a new element in a specific row. |
protected void |
fireElementChanged(TimeBarRow row,
de.jaret.util.date.Interval element)
Inform listeners about a changed element in a specific row. |
protected void |
fireElementRemoved(TimeBarRow row,
de.jaret.util.date.Interval element)
Inform listeners about a removed element in a specific row. |
protected void |
fireHeaderChanged(TimeBarRow row,
TimeBarRowHeader header)
Inform listeners about a changed header. |
protected void |
fireModelDataChanged()
Inform listeners about unspecific or multiple changes in the model. |
protected void |
fireRowAdded(TimeBarRow row)
Inform listeners about a new row. |
protected void |
fireRowDataChanged(TimeBarRow row)
Inform listeners about a changed row. |
protected void |
fireRowRemoved(TimeBarRow row)
Inform listeners about a removed row. |
de.jaret.util.date.JaretDate |
getMaxDate()
Retrieve tha latesr dat ein the model. |
de.jaret.util.date.JaretDate |
getMinDate()
Retrieve the earliest date in the model. |
TimeBarRow |
getRowForInterval(de.jaret.util.date.Interval interval)
Retrieve the TimeBarRow for a given interval. |
void |
headerChanged(TimeBarRow row,
TimeBarRowHeader newHeader)
The header of the row has changed. |
void |
remTimeBarModelListener(TimeBarModelListener tbml)
Removes a previously added listener. |
void |
rowDataChanged(TimeBarRow row)
Unspecific or multiple change of row data. |
protected void |
updateMinMax()
Update the min/max date of the model. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface de.jaret.util.ui.timebars.model.TimeBarModel |
|---|
getRow, getRowCount |
| Field Detail |
|---|
protected de.jaret.util.date.JaretDate _minDate
protected de.jaret.util.date.JaretDate _maxDate
protected java.util.List<TimeBarModelListener> _listenerList
| Constructor Detail |
|---|
public AbstractTimeBarModel()
| Method Detail |
|---|
public de.jaret.util.date.JaretDate getMinDate()
getMinDate in interface TimeBarModelpublic de.jaret.util.date.JaretDate getMaxDate()
getMaxDate in interface TimeBarModelpublic TimeBarRow getRowForInterval(de.jaret.util.date.Interval interval)
getRowForInterval in interface TimeBarModelinterval - interval to gt the row for.
null if no row could be determined.public void addTimeBarModelListener(TimeBarModelListener tbml)
addTimeBarModelListener in interface TimeBarModeltbml - TimeBarModelListener for watching the modelpublic void remTimeBarModelListener(TimeBarModelListener tbml)
remTimeBarModelListener in interface TimeBarModeltbml - TimeBarModelListener to be removedprotected void fireModelDataChanged()
protected void fireRowAdded(TimeBarRow row)
row - new rowprotected void fireRowRemoved(TimeBarRow row)
row - removed rowprotected void fireRowDataChanged(TimeBarRow row)
row - changed row
protected void fireHeaderChanged(TimeBarRow row,
TimeBarRowHeader header)
row - rowheader - header
protected void fireElementChanged(TimeBarRow row,
de.jaret.util.date.Interval element)
row - row of the elementelement - changed element
protected void fireElementAdded(TimeBarRow row,
de.jaret.util.date.Interval element)
row - row of the elementelement - new element
protected void fireElementRemoved(TimeBarRow row,
de.jaret.util.date.Interval element)
row - row of the elementelement - removed element
public void elementAdded(TimeBarRow row,
de.jaret.util.date.Interval element)
elementAdded in interface TimeBarRowListenerrow - the changed rowelement - the new interval in the row
public void elementRemoved(TimeBarRow row,
de.jaret.util.date.Interval element)
elementRemoved in interface TimeBarRowListenerrow - the changed rowelement - the removed element
public void elementChanged(TimeBarRow row,
de.jaret.util.date.Interval element)
elementChanged in interface TimeBarRowListenerrow - the row of the changed elementelement - the changed interval
public void headerChanged(TimeBarRow row,
TimeBarRowHeader newHeader)
headerChanged in interface TimeBarRowListenerrow - the row containing the header.newHeader - the new or updated header objectpublic void rowDataChanged(TimeBarRow row)
rowDataChanged in interface TimeBarRowListenerrow - the changed rowprotected void updateMinMax()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||