Simple Machine

util
Class CompoundModel

java.lang.Object
  extended by java.util.Observable
      extended by util.AbstractDataModel
          extended by util.CompoundModel
All Implemented Interfaces:
Observer, DataModel

public class CompoundModel
extends AbstractDataModel
implements Observer

Join two Data Models into a single model. Model A's columns come first in the new model followed by model B's. The order of models matters for delete and insert; model A's delete/insert is performed before model B's.


Constructor Summary
CompoundModel(DataModel aModelA, DataModel aModelB)
           
 
Method Summary
 boolean canDeleteRow(int row)
           
 boolean canInsertRow(int row)
           
 boolean deleteRow(int row)
           
 Class getColumnClass(int columnIndex)
           
 int getColumnCount()
           
 String getColumnName(int columnIndex)
           
 int getRowCount()
           
 Object getValueAt(int rowIndex, int columnIndex)
           
 boolean insertRow(int row)
           
 boolean isCellEditable(int rowIndex, int columnIndex)
           
 void setValueAt(Object aValue, int rowIndex, int columnIndex)
           
 void update(Observable o, Object arg)
           
 
Methods inherited from class util.AbstractDataModel
addUndoableEditListener, setValueAt, setValueAtByUser, setValueAtByUser, tellObservers, tellObservers
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface util.DataModel
addObserver
 

Constructor Detail

CompoundModel

public CompoundModel(DataModel aModelA,
                     DataModel aModelB)
Method Detail

insertRow

public boolean insertRow(int row)
Specified by:
insertRow in interface DataModel
Overrides:
insertRow in class AbstractDataModel

deleteRow

public boolean deleteRow(int row)
Specified by:
deleteRow in interface DataModel
Overrides:
deleteRow in class AbstractDataModel

canInsertRow

public boolean canInsertRow(int row)
Specified by:
canInsertRow in interface DataModel
Overrides:
canInsertRow in class AbstractDataModel

canDeleteRow

public boolean canDeleteRow(int row)
Specified by:
canDeleteRow in interface DataModel
Overrides:
canDeleteRow in class AbstractDataModel

update

public void update(Observable o,
                   Object arg)
Specified by:
update in interface Observer

getColumnClass

public Class getColumnClass(int columnIndex)
Specified by:
getColumnClass in interface DataModel
Overrides:
getColumnClass in class AbstractDataModel

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface DataModel
Overrides:
getColumnCount in class AbstractDataModel

getColumnName

public String getColumnName(int columnIndex)
Specified by:
getColumnName in interface DataModel
Overrides:
getColumnName in class AbstractDataModel

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface DataModel
Overrides:
getRowCount in class AbstractDataModel

getValueAt

public Object getValueAt(int rowIndex,
                         int columnIndex)
Specified by:
getValueAt in interface DataModel
Overrides:
getValueAt in class AbstractDataModel

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int columnIndex)
Specified by:
isCellEditable in interface DataModel
Overrides:
isCellEditable in class AbstractDataModel

setValueAt

public void setValueAt(Object aValue,
                       int rowIndex,
                       int columnIndex)
Specified by:
setValueAt in interface DataModel
Overrides:
setValueAt in class AbstractDataModel

Simple Machine

Copyright © 2010, 2011 Mike Feeley. All Rights Reserved.