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

java.lang.Object
  extended by de.jaret.util.ui.timebars.model.AbstractTimeBarModel
      extended by de.jaret.util.ui.timebars.model.DefaultTimeBarModel
All Implemented Interfaces:
TimeBarModel, TimeBarRowListener

public class DefaultTimeBarModel
extends AbstractTimeBarModel

A default implementation of the TimeBarModel interface. Extends the AbstractTimeBarModel.

Version:
$Id: DefaultTimeBarModel.java 886 2009-10-08 22:08:27Z kliem $
Author:
Peter Kliem

Field Summary
protected  java.util.List<TimeBarRow> _rows
          list of the rows.
 
Fields inherited from class de.jaret.util.ui.timebars.model.AbstractTimeBarModel
_listenerList, _maxDate, _minDate
 
Constructor Summary
DefaultTimeBarModel()
           
 
Method Summary
 void addRow(int index, TimeBarRow row)
          Add a row.
 void addRow(TimeBarRow row)
          Add a row.
 int getIndexForRow(TimeBarRow row)
          Retrieve the model index of a given row.
 TimeBarRow getRow(int row)
          Return the row for the given index.
 int getRowCount()
          Get the number of rows in the model.
 void remRow(TimeBarRow row)
          Remove a row from the model.
 
Methods inherited from class de.jaret.util.ui.timebars.model.AbstractTimeBarModel
addTimeBarModelListener, elementAdded, elementChanged, elementRemoved, fireElementAdded, fireElementChanged, fireElementRemoved, fireHeaderChanged, fireModelDataChanged, fireRowAdded, fireRowDataChanged, fireRowRemoved, getMaxDate, getMinDate, getRowForInterval, headerChanged, remTimeBarModelListener, rowDataChanged, updateMinMax
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_rows

protected java.util.List<TimeBarRow> _rows
list of the rows.

Constructor Detail

DefaultTimeBarModel

public DefaultTimeBarModel()
Method Detail

getRow

public TimeBarRow getRow(int row)
Return the row for the given index.

Parameters:
row - index of the row
Returns:
the row for the given index

getRowCount

public int getRowCount()
Get the number of rows in the model.

Returns:
number of rows

addRow

public void addRow(TimeBarRow row)
Add a row.

Parameters:
row - row to add.

addRow

public void addRow(int index,
                   TimeBarRow row)
Add a row.

Parameters:
index - index the row should be inserted. -1 marks append to the end.
row - row to add.

remRow

public void remRow(TimeBarRow row)
Remove a row from the model.

Parameters:
row - row to remove

getIndexForRow

public int getIndexForRow(TimeBarRow row)
Retrieve the model index of a given row.

Parameters:
row - row to check
Returns:
index or -1


Copyright © 2012. All Rights Reserved.