Oracle JEWT 4.2.10

oracle.bali.ewt.model
Class AbstractTwoDModel

java.lang.Object
  |
  +--oracle.bali.ewt.model.AbstractTwoDModel
All Implemented Interfaces:
TwoDModel
Direct Known Subclasses:
ArrayTwoDModel

public abstract class AbstractTwoDModel
extends java.lang.Object
implements TwoDModel

Abstract base class for TwoDModels that handles the adding and removing of ModelListeners and adds a convenience method fireModelEvent for subclasses to call to send TwoDModelEvents to registered listeners.

See Also:
fireModelEvent(int, int, int)

Constructor Summary
AbstractTwoDModel()
           
 
Method Summary
 void addModelListener(TwoDModelListener listener)
          Add a TwoDModelListener to this TwoDModel.
protected  void fireModelEvent(int eventID, int startIndex, int count)
          Method for subclasses to call to fire TwoDModelEvents.
protected  void fireModelEvent(int eventID, int startColumn, int columnCount, int startRow, int rowCount)
          Method for subclasses to call to fire TwoDModelEvents.
abstract  int getColumnCount()
          Returns the number of columns in this TwoDModel.
abstract  java.lang.Object getData(int columnIndex, int rowIndex)
          Return the data of the cell.
abstract  int getRowCount()
          Returns the number of rows in this TwoDModel.
 void removeModelListener(TwoDModelListener listener)
          Remove a TwoDModelListener from this TwoDModel.
abstract  void setData(int columnIndex, int rowIndex, java.lang.Object data)
          Set the cell data to the new value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTwoDModel

public AbstractTwoDModel()
Method Detail

getColumnCount

public abstract int getColumnCount()
Returns the number of columns in this TwoDModel.
Specified by:
getColumnCount in interface TwoDModel
Returns:
the number of columns in this TwoDModel.

getRowCount

public abstract int getRowCount()
Returns the number of rows in this TwoDModel.
Specified by:
getRowCount in interface TwoDModel
Returns:
the number of rows in this TwoDModel.

getData

public abstract java.lang.Object getData(int columnIndex,
                                         int rowIndex)
Return the data of the cell.

Specified by:
getData in interface TwoDModel
Parameters:
columnIndex - the column index of the cell
rowIndex - the row index of the cell

setData

public abstract void setData(int columnIndex,
                             int rowIndex,
                             java.lang.Object data)
Set the cell data to the new value.

Specified by:
setData in interface TwoDModel
Parameters:
columnIndex - the column index of the cell
rowIndex - the row index of the cell
data - the new data

addModelListener

public void addModelListener(TwoDModelListener listener)
Add a TwoDModelListener to this TwoDModel.

Specified by:
addModelListener in interface TwoDModel
Parameters:
listener - The listener to add

removeModelListener

public void removeModelListener(TwoDModelListener listener)
Remove a TwoDModelListener from this TwoDModel.

Specified by:
removeModelListener in interface TwoDModel
Parameters:
listener - The listener to remove

fireModelEvent

protected void fireModelEvent(int eventID,
                              int startIndex,
                              int count)
Method for subclasses to call to fire TwoDModelEvents.

Parameters:
eventID - ID of event to fire
startIndex - Starting index of items that this event applies to.
count - Number of columns or rows that this event applies to
Throws:
java.lang.IllegalArgumentException - thrown if an unknown event id or nonsensical arguments used.

Since:
EWT 3.1
See Also:
TwoDModelEvent

fireModelEvent

protected void fireModelEvent(int eventID,
                              int startColumn,
                              int columnCount,
                              int startRow,
                              int rowCount)
Method for subclasses to call to fire TwoDModelEvents.

Parameters:
eventID - ID of event to fire
startColumn - Starting column of items that this event applies to.
columnCount - Number of columns that this event applies to
startRow - Starting row that this evetn applies to
rowCount - Number of rows that this event applies to
Throws:
java.lang.IllegalArgumentException - thrown if an unknown event id or nonsensical arguments used.

Since:
EWT 3.1
See Also:
TwoDModelEvent

Oracle JEWT 4.2.10