Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.gopas.rt.model
Class BOListEvent  view BOListEvent download BOListEvent.java

java.lang.Object
  extended byjava.util.EventObject
      extended byjava.beans.PropertyChangeEvent
          extended bycom.gopas.rt.model.BOListEvent
All Implemented Interfaces:
java.io.Serializable

public class BOListEvent
extends java.beans.PropertyChangeEvent

BOListEvent is used to notify listeners that a BOList has changed. The model event describes changes to a BOList Depending on the parameters used in the constructors, the BOListEvent can be used to specify the following types of changes:

 BOListEvent(source);              //  The data, ie. all rows changed 
 BOListEvent(source, HEADER_ROW);  //  Structure change
 BOListEvent(source, 1);           //  Row 1 changed
 BOListEvent(source, 3, 6);        //  Rows 3 to 6 inclusive changed
 BOListEvent(source, 2, 2, 6);     //  Cell at (2, 6) changed
 BOListEvent(source, 3, 6, INSERT); // Rows (3, 6) were inserted
 BOListEvent(source, 3, 6, DELETE); // Rows (3, 6) were deleted
 
It is possible to use other combinations of the parameters, not all of them are meaningful. By subclassing, you can add other information, for example: whether the event WILL happen or DID happen. This makes the specification of rows in DELETE events more useful but has not been included in the swing package as the JTable only needs post-event notification.


Field Summary
static int DELETE
          Identifies the removal of rows.
protected  int firstRow
           
static int HEADER_ROW
          Identifies the header row.
static int INSERT
          Identifies the addtion of new rows.
protected  int lastRow
           
protected  java.lang.Object[] removedObjects
           
protected  BOList srcList
           
protected  int type
           
static int UPDATE
          Identifies a change to existing data.
 
Fields inherited from class java.beans.PropertyChangeEvent
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
BOListEvent(java.lang.Object source, java.lang.String propName, BOList psrcList)
          All row data in the table has changed, listeners should discard any state that was based on the rows and requery the TableModel to get the new row count and all the appropriate values.
BOListEvent(java.lang.Object source, java.lang.String propName, BOList psrcList, int row)
          This row of data has been updated.
BOListEvent(java.lang.Object source, java.lang.String propName, BOList psrcList, int firstRow, int lastRow)
          The data in rows [firstRow, lastRow] have been updated.
BOListEvent(java.lang.Object source, java.lang.String propName, BOList psrcList, int pfirstRow, int plastRow, int ptype)
          The cells from (firstRow) to (lastRow) have been changed.
BOListEvent(java.lang.Object source, java.lang.String propName, BOList psrcList, int pfirstRow, int plastRow, java.lang.Object[] premovedArr)
          The cells from (firstRow) to (lastRow) have been deleted.
 
Method Summary
 int getFirstRow()
          Returns the first row that changed.
 int getLastRow()
          Returns the last row that changed.
 java.lang.Object[] getRemovedObjects()
          Returns the removed objects.
 BOList getSrcList()
          Returns the List in which the event occurred.
 int getType()
          Returns the type of event - one of: INSERT, UPDATE and DELETE.
 java.lang.String toString()
          Converts the event to a String.
 
Methods inherited from class java.beans.PropertyChangeEvent
getNewValue, getOldValue, getPropagationId, getPropertyName, setPropagationId
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INSERT

public static final int INSERT
Identifies the addtion of new rows.

See Also:
Constant Field Values

UPDATE

public static final int UPDATE
Identifies a change to existing data.

See Also:
Constant Field Values

DELETE

public static final int DELETE
Identifies the removal of rows.

See Also:
Constant Field Values

HEADER_ROW

public static final int HEADER_ROW
Identifies the header row.

See Also:
Constant Field Values

srcList

protected final BOList srcList

type

protected final int type

firstRow

protected final int firstRow

lastRow

protected final int lastRow

removedObjects

protected final java.lang.Object[] removedObjects
Constructor Detail

BOListEvent

public BOListEvent(java.lang.Object source,
                   java.lang.String propName,
                   BOList psrcList)
All row data in the table has changed, listeners should discard any state that was based on the rows and requery the TableModel to get the new row count and all the appropriate values. The JTable will repaint the entire visible region on recieving this event, querying the model for the cell values that are visble. The structure of the table ie, the column names, types and order have not changed. (Using Integer.MAX_VALUE instead of getRowCount() in case rows were deleted.


BOListEvent

public BOListEvent(java.lang.Object source,
                   java.lang.String propName,
                   BOList psrcList,
                   int row)
This row of data has been updated. To denote the arrival of a completely new table with a different structure use HEADER_ROW as the value for the row.


BOListEvent

public BOListEvent(java.lang.Object source,
                   java.lang.String propName,
                   BOList psrcList,
                   int firstRow,
                   int lastRow)
The data in rows [firstRow, lastRow] have been updated.


BOListEvent

public BOListEvent(java.lang.Object source,
                   java.lang.String propName,
                   BOList psrcList,
                   int pfirstRow,
                   int plastRow,
                   int ptype)
The cells from (firstRow) to (lastRow) have been changed.

The type should be one of: INSERT, UPDATE and DELETE.


BOListEvent

public BOListEvent(java.lang.Object source,
                   java.lang.String propName,
                   BOList psrcList,
                   int pfirstRow,
                   int plastRow,
                   java.lang.Object[] premovedArr)
The cells from (firstRow) to (lastRow) have been deleted.

The type should be: DELETE.

Method Detail

getFirstRow

public int getFirstRow()
Returns the first row that changed. HEADER_ROW means the meta data, ie. names, types and order of the columns.


getLastRow

public int getLastRow()
Returns the last row that changed.


getType

public int getType()
Returns the type of event - one of: INSERT, UPDATE and DELETE.


getSrcList

public BOList getSrcList()
Returns the List in which the event occurred.


getRemovedObjects

public java.lang.Object[] getRemovedObjects()
Returns the removed objects.


toString

public java.lang.String toString()
Description copied from class: java.util.EventObject
Converts the event to a String. The format is not specified, but by observation, the JDK uses: getClass().getName() + "[source=" + source + "]";.