JIDE 3.5.15

com.jidesoft.gantt
Class GanttModelEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.jidesoft.gantt.GanttModelEvent
All Implemented Interfaces:
Serializable

public class GanttModelEvent
extends EventObject

GanttModelEvent is used to notify listeners that a gantt model has changed. The model event describes changes to a GanttModel and all references to rows are in the co-ordinate system of the model. Depending on the parameters used in the constructors, the GanttModelEvent can be used to specify the following types of changes:

 GanttModelEvent(source);              //  The data, ie. all rows changed
 GanttModelEvent(source, 1);           //  Row 1 changed
 GanttModelEvent(source, RANGE);       //  The range of the GanttModel has changed
 GanttModelEvent(source, 3, 6);        //  Rows 3 to 6 inclusive changed
 GanttModelEvent(source, 3, 6, INSERT); // Rows (3, 6) were inserted
 GanttModelEvent(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.

See Also:
Serialized Form

Field Summary
protected  int _firstRow
           
protected  int _lastRow
           
protected  int _subEntryIndex
           
protected  int _type
           
static int DELETE
           
static int INSERT
           
static int RANGE
          Identifies the Range of the GanttModel if returned by getFirstRow() or getLastRow().
static int UPDATE
           
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
GanttModelEvent(GanttModel<?,?> source)
          All row data in the table has changed, listeners should discard any state that was based on the rows and requery the GanttModel to get the new row count and all the appropriate values.
GanttModelEvent(GanttModel<?,?> source, int row)
          This row of data has been updated.
GanttModelEvent(GanttModel<?,?> source, int firstRow, int lastRow)
          The rows in rows [firstRow, lastRow] have been updated.
GanttModelEvent(GanttModel<?,?> source, int firstRow, int lastRow, int type)
          The rows from firstRow to lastRow have been changed.
GanttModelEvent(GanttModel<?,?> source, int firstRow, int lastRow, int subEntryIndex, int type)
          The rows from firstRow to lastRow have been changed.
GanttModelEvent(Object source)
           
 
Method Summary
 int getColumn()
          Deprecated. replaced by getSubEntryIndex()
 int getFirstRow()
          Returns the first row that changed.
 int getLastRow()
          Returns the last row that changed.
 int getSubEntryIndex()
          Returns the sub entry index of event.
 int getType()
          Returns the type of event - one of: INSERT, UPDATE and DELETE.
 String toString()
           
 
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

UPDATE

public static final int UPDATE
See Also:
Constant Field Values

INSERT

public static final int INSERT
See Also:
Constant Field Values

DELETE

public static final int DELETE
See Also:
Constant Field Values

RANGE

public static final int RANGE
Identifies the Range of the GanttModel if returned by getFirstRow() or getLastRow().

See Also:
Constant Field Values

_type

protected int _type

_firstRow

protected int _firstRow

_lastRow

protected int _lastRow

_subEntryIndex

protected int _subEntryIndex
Constructor Detail

GanttModelEvent

public GanttModelEvent(Object source)

GanttModelEvent

public GanttModelEvent(GanttModel<?,?> source)
All row data in the table has changed, listeners should discard any state that was based on the rows and requery the GanttModel to get the new row count and all the appropriate values. The JTable will repaint the entire visible region on receiving this event, querying the model for the cell values that are visible. The structure of the table ie, the column names, types and order have not changed.

Parameters:
source - the source of the GanttModelEvent.

GanttModelEvent

public GanttModelEvent(GanttModel<?,?> source,
                       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. When the JTable receives this event and its autoCreateColumnsFromModel flag is set it discards any TableColumns that it had and reallocates default ones in the order they appear in the model. This is the same as calling setModel(GanttModel) on the JTable.

Parameters:
source - the source of the GanttModelEvent.
row - the row.

GanttModelEvent

public GanttModelEvent(GanttModel<?,?> source,
                       int firstRow,
                       int lastRow)
The rows in rows [firstRow, lastRow] have been updated.

Parameters:
source - the source of the GanttModelEvent.
firstRow - the first row of the event.
lastRow - the last row of the event.

GanttModelEvent

public GanttModelEvent(GanttModel<?,?> source,
                       int firstRow,
                       int lastRow,
                       int type)
The rows from firstRow to lastRow have been changed. The change could be inserted, deleted or updated.

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

Parameters:
source - the source of the GanttModelEvent.
firstRow - the first row of the event.
lastRow - the last row of the event.
type - the type of the event.

GanttModelEvent

public GanttModelEvent(GanttModel<?,?> source,
                       int firstRow,
                       int lastRow,
                       int subEntryIndex,
                       int type)
The rows from firstRow to lastRow have been changed. The change could be inserted, deleted or updated.

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

Parameters:
source - the source of the GanttModelEvent.
firstRow - the first row of the event.
lastRow - the last row of the event.
subEntryIndex - the sub entry index of the event. -1 if it is not an event related to sub entry.
type - the type of the event.
Method Detail

getFirstRow

public int getFirstRow()
Returns the first row that changed. If the value return is RANGE then the range of the model has changed.

Returns:
the first row that changed.

getLastRow

public int getLastRow()
Returns the last row that changed. If the value return is RANGE then the range of the model has changed.

Returns:
the last row that changed.

getType

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

Returns:
the type of the event.

getColumn

@Deprecated
public int getColumn()
Deprecated. replaced by getSubEntryIndex()

Returns the sub entry index of event.

Returns:
the sub entry index. -1 if it is not an event related to sub entry.

getSubEntryIndex

public int getSubEntryIndex()
Returns the sub entry index of event.

Returns:
the sub entry index. -1 if it is not an event related to sub entry.

toString

public String toString()
Overrides:
toString in class EventObject

JIDE 3.5.15