com.droplets.api.event
Class TableModelEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--com.droplets.api.event.TableModelEvent
All Implemented Interfaces:
java.io.Serializable

public class TableModelEvent
extends java.util.EventObject

An event sent from TableModel to its listeners. Three types of data events are currently supported: row insertion, row deletion and data change. The latter event pertains to the case when the size of the data model has not changed.

See Also:
Serialized Form

Field Summary
static int DATA_CHANGED
          Returned from getEventType() of a data changed event.
static int ROWS_DELETED
          Returned from getEventType() of a row deletion event.
static int ROWS_INSERTED
          Returned from getEventType() of a row insertion event.
 
Fields inherited from class java.util.EventObject
source
 
Method Summary
 int getColumn()
          Gets the starting column.
 int getColumnCount()
          Gets the column count.
 int getEventType()
          Gets the type of the event.
 CellRectangle getRectangle()
          Get the rectangular area pertaining to the change in the form of a CellRectangle.
 int getRow()
          Gets the starting row.
 int getRowCount()
          Gets the row count.
 TableModel getSourceTableModel()
          Gets the source TableModel.
static TableModelEvent NewDataChangedEvent(TableModel source, CellRectangle area)
          Create and return a data-changed event in the given rectangle.
static TableModelEvent NewRowsDeletedEvent(TableModel source, int row, int rowCount)
          Create and return a row-delete event with the given source and range of rows.
static TableModelEvent NewRowsInsertedEvent(TableModel source, int row, int rowCount)
          Create and return a row-insert event with the given source and range of rows.
 
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

ROWS_INSERTED

public static final int ROWS_INSERTED
Returned from getEventType() of a row insertion event.

ROWS_DELETED

public static final int ROWS_DELETED
Returned from getEventType() of a row deletion event.

DATA_CHANGED

public static final int DATA_CHANGED
Returned from getEventType() of a data changed event.
Method Detail

NewRowsInsertedEvent

public static TableModelEvent NewRowsInsertedEvent(TableModel source,
                                                   int row,
                                                   int rowCount)
Create and return a row-insert event with the given source and range of rows.
Parameters:
source - the TableModel from which the event originated.
row - the index of the first inserted row after the insert.
rowCount - number of rows inserted.

NewRowsDeletedEvent

public static TableModelEvent NewRowsDeletedEvent(TableModel source,
                                                  int row,
                                                  int rowCount)
Create and return a row-delete event with the given source and range of rows.
Parameters:
source - the TableModel from which the event originated.
row - the index of the first deleted row.
rowCount - number of rows deleted.

NewDataChangedEvent

public static TableModelEvent NewDataChangedEvent(TableModel source,
                                                  CellRectangle area)
Create and return a data-changed event in the given rectangle.
Parameters:
source - the TableModel from which the event originated.
area - the rectangle which encloses all cells which have changed.

getEventType

public int getEventType()
Gets the type of the event.

getRow

public int getRow()
Gets the starting row.

getRowCount

public int getRowCount()
Gets the row count.

getColumn

public int getColumn()
Gets the starting column.

getColumnCount

public int getColumnCount()
Gets the column count.

getSourceTableModel

public TableModel getSourceTableModel()
Gets the source TableModel.

getRectangle

public CellRectangle getRectangle()
Get the rectangular area pertaining to the change in the form of a CellRectangle.


Copyright © Droplets, 2001. All Rights Reserved.