com.eliad.model
Class SpanModelEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--com.eliad.model.SpanModelEvent

public class SpanModelEvent
extends java.util.EventObject

Events corresponding to changes in a SpanModel

Version:
1.0 00/04/08
Author:
Patrick Mérissert-Coffinières
See Also:
Serialized Form

Field Summary
static int COLUMNS_DELETED
          A continuous set of columns was deleted from the model
static int COLUMNS_INSERTED
          A continuous set of columns was added to the model
static int MODEL_CHANGED
          The entire model was changed
static int ROWS_DELETED
          A continuous set of rows was deleted from the model
static int ROWS_INSERTED
          A continuous set of rows was added to the model
static int SPAN_ADDED
          A span was added
static int SPAN_REMOVED
          A span was removed
static int SPAN_UPDATED
          A span was modified
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
SpanModelEvent(SpanModel source, int type, int anchorRow, int anchorColumn, int oldRowCount, int oldColumnCount, int newRowCount, int newColumnCount)
          Constructs a new event for a change to a SpanModel
 
Method Summary
 int getAnchorColumn()
          Returns the anchor (left) column of the span
 int getAnchorRow()
          Returns the anchor (top) row of the span event
 int getNewColumnCount()
          Valid for SPAN_UPDATED, SPAN_ADDED, COLUMNS_INSERTED.
 int getNewRowCount()
          Valid for SPAN_UPDATED, SPAN_ADDED, ROWS_INSERTED.
 int getOldColumnCount()
          Valid for SPAN_UPDATED, SPAN_REMOVED, COLUMNS_DELETED.
 int getOldRowCount()
          Valid for SPAN_UPDATED, SPAN_REMOVED, ROWS_DELETED.
 int getType()
          Returns the type of the event, one of: MODEL_CHANGED SPAN_UPDATED SPAN_ADDED SPAN_REMOVED ROWS_INSERTED ROWS_DELETED COLUMNS_INSERTED COLUMNS_DELETED
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MODEL_CHANGED

public static final int MODEL_CHANGED
The entire model was changed

SPAN_UPDATED

public static final int SPAN_UPDATED
A span was modified

SPAN_ADDED

public static final int SPAN_ADDED
A span was added

SPAN_REMOVED

public static final int SPAN_REMOVED
A span was removed

ROWS_INSERTED

public static final int ROWS_INSERTED
A continuous set of rows was added to the model

ROWS_DELETED

public static final int ROWS_DELETED
A continuous set of rows was deleted from the model

COLUMNS_INSERTED

public static final int COLUMNS_INSERTED
A continuous set of columns was added to the model

COLUMNS_DELETED

public static final int COLUMNS_DELETED
A continuous set of columns was deleted from the model
Constructor Detail

SpanModelEvent

public SpanModelEvent(SpanModel source,
                      int type,
                      int anchorRow,
                      int anchorColumn,
                      int oldRowCount,
                      int oldColumnCount,
                      int newRowCount,
                      int newColumnCount)
Constructs a new event for a change to a SpanModel
Parameters:
source - The SpanModel that was changed
anchorRow - The top row of the cell where a span was created, updated, or deleted, or the first row of a rows insertion or removal.
anchorColumn - The leftmost column of the cell where a span was created, updated, or deleted or the first column of a columns insertion or removal.
oldRowCount - The dimension of the former span, 1 if none, or the number of deleted rows, or 0 for rows insertion
oldColumnCount - The dimension of the former span, 1 if none or the number of deleted columns, or 0 for columns insertion
newRowCount - The dimension of the new span, 1 if none, or the number of inserted rows, 0 for rows removal.
newColumnCount - The dimension of the new span, 1 if none or the number of inserted columns, 0 for columns removal.
Method Detail

getType

public int getType()
Returns the type of the event, one of:

getAnchorRow

public int getAnchorRow()
Returns the anchor (top) row of the span event
Returns:
The top row of the cell where a span was created, updated, or removed or the first row of a rows insertion or removal.

getAnchorColumn

public int getAnchorColumn()
Returns the anchor (left) column of the span
Returns:
The leftmost column of the cell where a span was created, updated, or deleted or the first column of a columns insertion or removal.

getOldColumnCount

public int getOldColumnCount()
Valid for SPAN_UPDATED, SPAN_REMOVED, COLUMNS_DELETED.
Returns:
The dimension of the former span, 1 if none, or the number of deleted columns, or 0 for columns insertion

getOldRowCount

public int getOldRowCount()
Valid for SPAN_UPDATED, SPAN_REMOVED, ROWS_DELETED.
Returns:
The dimension of the former span, 1 if none, or the number of deleted rows, or 0 for rows insertion

getNewColumnCount

public int getNewColumnCount()
Valid for SPAN_UPDATED, SPAN_ADDED, COLUMNS_INSERTED.
Returns:
The dimension of the new span, 1 if none, or the number of inserted columns, 0 for columns removal.

getNewRowCount

public int getNewRowCount()
Valid for SPAN_UPDATED, SPAN_ADDED, ROWS_INSERTED.
Returns:
The dimension of the new span, 1 if none, or the number of inserted rows, 0 for rows removal.