|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.jaret.util.ui.timebars.model.AbstractTimeBarRowModel
public abstract class AbstractTimeBarRowModel
An abstract base implementation of the TimeBarRow interface. The part to implement is the storage and retrieval of the intervals in the row. Care has to be taken to update the min/max date fields with the intervals. Implementations for some additional methods are given, but are not guaranteed to be optimal (in fact they are not!).
| Field Summary | |
|---|---|
protected TimeBarRowHeader |
_header
the row header of the row. |
protected java.util.List<TimeBarRowListener> |
_listenerList
the registered listeners. |
protected de.jaret.util.date.JaretDate |
_maxDate
the maximum date of all intervals. |
protected de.jaret.util.date.JaretDate |
_minDate
the minimum date of all intervals. |
| Constructor Summary | |
|---|---|
AbstractTimeBarRowModel()
Default constructor. |
|
AbstractTimeBarRowModel(TimeBarRowHeader header)
onstructor supplying a header. |
|
| Method Summary | |
|---|---|
void |
addTimeBarRowListener(TimeBarRowListener tbrl)
Register a TimeBarRowListener for listening to changes in the row. |
protected void |
fireElementAdded(de.jaret.util.date.Interval element)
Inform listeners that a new interval has been added. |
protected void |
fireElementChanged(de.jaret.util.date.Interval element)
Inform listeners that an element has changed. |
protected void |
fireElementRemoved(de.jaret.util.date.Interval element)
Inform listeners that an interval has been removed. |
protected void |
fireHeaderChanged()
Inform listeners about a chnage of the header. |
protected void |
fireRowDataChanged()
Inform listeners that all row data may have changed. |
abstract java.util.List<de.jaret.util.date.Interval> |
getIntervals()
Provide the full ordered list of intervals. |
java.util.List<de.jaret.util.date.Interval> |
getIntervals(de.jaret.util.date.JaretDate date)
Returns all intervals containing the given date. |
java.util.List<de.jaret.util.date.Interval> |
getIntervals(de.jaret.util.date.JaretDate beginDate,
de.jaret.util.date.JaretDate endDate)
Provide the intervals in beetween a given interval. |
de.jaret.util.date.JaretDate |
getMaxDate()
Return the ending date of the latest interval in the row. |
de.jaret.util.date.JaretDate |
getMinDate()
Return the beginning date of the earliest interval in the row. |
TimeBarRowHeader |
getRowHeader()
Return the row header. |
void |
propertyChange(java.beans.PropertyChangeEvent evt)
Handle property changes of the intervals in the row and of the header. |
void |
remTimeBarRowListener(TimeBarRowListener tbrl)
Remove a previously added TimeBarRowListener. |
void |
setRowHeader(TimeBarRowHeader header)
Set the row header. |
protected void |
updateMinMax()
Updates the minimum and the maximum dates that may be queried by users of the row. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected TimeBarRowHeader _header
protected de.jaret.util.date.JaretDate _minDate
protected de.jaret.util.date.JaretDate _maxDate
protected java.util.List<TimeBarRowListener> _listenerList
| Constructor Detail |
|---|
public AbstractTimeBarRowModel()
public AbstractTimeBarRowModel(TimeBarRowHeader header)
header - row header to be used| Method Detail |
|---|
public abstract java.util.List<de.jaret.util.date.Interval> getIntervals()
getIntervals in interface TimeBarRow
public java.util.List<de.jaret.util.date.Interval> getIntervals(de.jaret.util.date.JaretDate beginDate,
de.jaret.util.date.JaretDate endDate)
getIntervals in interface TimeBarRowbeginDate - first dateendDate - last date
public java.util.List<de.jaret.util.date.Interval> getIntervals(de.jaret.util.date.JaretDate date)
getIntervals in interface TimeBarRowdate - the date to be included in the intervals
public TimeBarRowHeader getRowHeader()
getRowHeader in interface TimeBarRowpublic void setRowHeader(TimeBarRowHeader header)
header - header to setpublic void addTimeBarRowListener(TimeBarRowListener tbrl)
TimeBarRowListener for listening to changes in the row.
addTimeBarRowListener in interface TimeBarRowtbrl - TimeBarRowListener to be addedpublic void remTimeBarRowListener(TimeBarRowListener tbrl)
remTimeBarRowListener in interface TimeBarRowtbrl - TimeBarRowListener to be removedprotected void fireRowDataChanged()
protected void fireElementAdded(de.jaret.util.date.Interval element)
element - added intervalprotected void fireElementRemoved(de.jaret.util.date.Interval element)
element - removed intervalprotected void fireElementChanged(de.jaret.util.date.Interval element)
element - changed intervalprotected void fireHeaderChanged()
public de.jaret.util.date.JaretDate getMaxDate()
TimeBarRownull if it contains no
intervals. If a row supplies a max date it must always supply a min date.
getMaxDate in interface TimeBarRowpublic de.jaret.util.date.JaretDate getMinDate()
TimeBarRownull if it contains
no intervals. If a row supplies a min date it must always supply a max value.
getMinDate in interface TimeBarRowpublic void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange in interface java.beans.PropertyChangeListenerevt - propChange event from the model elementsprotected void updateMinMax()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||