de.jaret.util.ui.timebars.model
Class AddingTimeBarRowModel

java.lang.Object
  extended by de.jaret.util.ui.timebars.model.AbstractTimeBarRowModel
      extended by de.jaret.util.ui.timebars.model.AddingTimeBarRowModel
All Implemented Interfaces:
TimeBarRow, TimeBarRowListener, java.beans.PropertyChangeListener, java.util.EventListener
Direct Known Subclasses:
AddingTimeBarNode

public class AddingTimeBarRowModel
extends AbstractTimeBarRowModel
implements TimeBarRowListener

Timebar row model that adds up (merges) all intervals added.

Version:
$Id: AddingTimeBarRowModel.java 592 2007-10-14 22:02:30Z olk $
Author:
Peter Kliem

Nested Class Summary
 class AddingTimeBarRowModel.MergedInterval
          Simple extension of the basic interval implementation to make it read-only on the standard setters.
 
Field Summary
protected  java.util.List<de.jaret.util.date.Interval> _intervals
          intervals in this row (the one added up merged interval, actually).
protected  AddingTimeBarRowModel.MergedInterval _mergedInterval
          the merged interval.
protected  java.util.List<TimeBarRow> _rows
          rows beeing "add up".
 
Fields inherited from class de.jaret.util.ui.timebars.model.AbstractTimeBarRowModel
_header, _listenerList, _maxDate, _minDate
 
Constructor Summary
AddingTimeBarRowModel(TimeBarRowHeader header)
          Create an adding row model.
 
Method Summary
 void addRow(TimeBarRow row)
          Add a row.
protected  void checkBounds()
          Check the bounds of the merged interval against all added rows.
protected  void checkMergedInterval()
          Check existence of merged interval and create one if necessary.
 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.
 java.util.List<de.jaret.util.date.Interval> getIntervals()
          Provide the full ordered list of intervals.
 void headerChanged(TimeBarRow row, TimeBarRowHeader newHeader)
          The header of the row has changed.
 void remRow(TimeBarRow row)
          Remove a row from the list of rows adding up.
 void rowDataChanged(TimeBarRow row)
          Unspecific or multiple change of row data.
 
Methods inherited from class de.jaret.util.ui.timebars.model.AbstractTimeBarRowModel
addTimeBarRowListener, fireElementAdded, fireElementChanged, fireElementRemoved, fireHeaderChanged, fireRowDataChanged, getIntervals, getIntervals, getMaxDate, getMinDate, getRowHeader, propertyChange, remTimeBarRowListener, setRowHeader, updateMinMax
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_intervals

protected java.util.List<de.jaret.util.date.Interval> _intervals
intervals in this row (the one added up merged interval, actually).


_mergedInterval

protected AddingTimeBarRowModel.MergedInterval _mergedInterval
the merged interval.


_rows

protected java.util.List<TimeBarRow> _rows
rows beeing "add up".

Constructor Detail

AddingTimeBarRowModel

public AddingTimeBarRowModel(TimeBarRowHeader header)
Create an adding row model.

Parameters:
header - the headr of the row
Method Detail

getIntervals

public java.util.List<de.jaret.util.date.Interval> getIntervals()
Provide the full ordered list of intervals. Remains abstract and has to implemented.

Specified by:
getIntervals in interface TimeBarRow
Specified by:
getIntervals in class AbstractTimeBarRowModel
Returns:
an ordered List of Intervals

addRow

public void addRow(TimeBarRow row)
Add a row.

Parameters:
row - row to add

remRow

public void remRow(TimeBarRow row)
Remove a row from the list of rows adding up.

Parameters:
row - row to remove

checkMergedInterval

protected void checkMergedInterval()
Check existence of merged interval and create one if necessary.


rowDataChanged

public void rowDataChanged(TimeBarRow row)
Unspecific or multiple change of row data. This method should not be used without the need for signalling an unspecific data change. Check whether the bounds are still correct.

Specified by:
rowDataChanged in interface TimeBarRowListener
Parameters:
row - the changed row

elementAdded

public void elementAdded(TimeBarRow row,
                         de.jaret.util.date.Interval element)
A new element was added to the row. Check whether the bounds are still correct.

Specified by:
elementAdded in interface TimeBarRowListener
Parameters:
row - the changed row
element - the new interval in the row

elementRemoved

public void elementRemoved(TimeBarRow row,
                           de.jaret.util.date.Interval element)
An element was removed from the row. Check whether the bounds are still correct.

Specified by:
elementRemoved in interface TimeBarRowListener
Parameters:
row - the changed row
element - the removed element

elementChanged

public void elementChanged(TimeBarRow row,
                           de.jaret.util.date.Interval element)
An element in the row has changed. Check whether the bounds are still correct.

Specified by:
elementChanged in interface TimeBarRowListener
Parameters:
row - the row of the changed element
element - the changed interval

checkBounds

protected void checkBounds()
Check the bounds of the merged interval against all added rows.


headerChanged

public void headerChanged(TimeBarRow row,
                          TimeBarRowHeader newHeader)
The header of the row has changed. Do nothing!

Specified by:
headerChanged in interface TimeBarRowListener
Parameters:
row - the row containing the header.
newHeader - the new or updated header object


Copyright © 2012. All Rights Reserved.