|
AdventNet Web NMS 4 API Specification | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.util.EventObject
|
+--javax.swing.event.TableModelEvent
|
+--com.adventnet.nms.client.NmsClientTableModelEvent
NmsClientTableModelEvent class serves as the Event object which encapsulates the various neccessary details of an update in the client table model (NmsClientTableModel). The NmsClientTableModel being a listener to the corresponding table model on the server receives the events from the server in the form of NmsTableModelEvent and converts them into NmsClientTableModelEvent before forwarding it to its listeners. The only thing the client side code needs to worry about is the NmsClientTableModelEvent and it doesn't need to do anything about NmsTableModelEvent.
Note that NmsClientTableModelEvent extends javax.swing.event.TableModelEvent so that when the NmsClientTableModel is directly being used as the model for javax.swing.JTable, the JTable could understand the updates. When the implementation instance of NmsClientTableModel, returned on creation of custom view using the ClientAPI's ( for example ClientEventAPI ) method createCustomView, is set as the model for a JTable instance, the JTable registers as a TableModelListener with the NmsClientTableModel instance. So, updates to the JTable in the form of events (NmsClientTableModelEvent) are fired to the JTable as and when they are received from the server.
For example, lets assume the following...
(i) Say the custom view you create results in some 100 objects matching the
criteria.
(ii) And say your iterator is currently in the view range of some 80 to 99 (totally
20, both inclusive ) with the increment value (window size) set to 50.
(iii) Then say five new objects with indices 100 to 104 get added.
Now the update received in the form of NmsClientTableModelEvent would have the
values of its fields as follows.
properties -- Vector of five elements. Each element being a java.util.Properties
object. The contents of the Properties object depends on the setting
of getAllProperties and displayFields of NmsClientTableModel.
rowIndexesOfServerTableModel -- [100,101,102,103,104]
rowIndexesOfClientTableModel -- [20,21,22,23,24]
totalRowCount -- 105.
startIndex -- 80.
endIndex -- 104.
enableNext, enablePrev, enableTop, enableBottom -- corresponding boolean values
to indicate their states.
type -- TableModelEvent.INSERT
firstRow -- 20
lastRow -- 24
column -- TableModelEvent.ALL_COLUMNS
The update mechanism is the same as that of javax.swing.event.TableModelEvent. The value
of type would be TableModelEvent.INSERT when some objects get added, TableModelEvent.DELETE
when some objects get deleted and TableModelEvent.UPDATE when an update of the objects happen.
The startIndex, endIndex, etc will have their values set accordingly.
TableModelEvent, Serialized Form| Field Summary | |
protected boolean |
enableBottom
This boolean indicates whether you could do a successful subsequent getBottom operation. |
protected boolean |
enableNext
This boolean indicates whether you could do a successful subsequent getNext operation. |
protected boolean |
enablePrev
This boolean indicates whether you could do a successful subsequent getPrevious operation. |
protected boolean |
enableTop
This boolean indicates whether you could do a successful subsequent getTop operation. |
protected int |
endIndex
The endIndex value after this update. |
protected java.util.Vector |
properties
The vector of java.util.Properties of the objects for which the update event is received. |
protected int[] |
rowIndexesOfClientTableModel
Holds rowids of affected rows as per client table model. |
protected int[] |
rowIndexesOfServerTableModel
Holds actual rowids of affected rows as per server table model. |
protected int |
startIndex
The startIndex value after this update. |
static int |
STATE_CHANGE
The type of this event can take this value when the received event doesn't carry any data and is just indicating a change in the state variables like totalRowCount, enableNext, enablePrev, enableTop, enableBottom. |
protected int |
totalRowCount
The totalRowCount value after this update. |
| Fields inherited from class javax.swing.event.TableModelEvent |
ALL_COLUMNS, column, DELETE, firstRow, HEADER_ROW, INSERT, lastRow, type, UPDATE |
| Fields inherited from class java.util.EventObject |
source |
| Constructor Summary | |
NmsClientTableModelEvent(javax.swing.table.TableModel source,
com.adventnet.nms.client.NmsTableModelEvent evt,
boolean showlatest)
Constructor which gets all the values from the NmsTableModelEvent received from the server remote table model. |
|
| Method Summary | |
int |
getEndIndex()
Gets the endIndex value after this update. |
java.util.Vector |
getProperties()
Gets the vector of Properties associated with this event. |
int[] |
getRowIndexesOfClientTableModel()
Returns an array of int, which contains rowids of affected rows with respect to client table model corresponding to actual rowids of server table model. |
int[] |
getRowIndexesOfServerTableModel()
Returns an array of int, which contains actual rowids of affected rows as per the server table model. |
int |
getStartIndex()
Gets the startIndex value after this update. |
int |
getTotalRowCount()
Gets the totalRowCount. |
boolean |
isBottomEnabled()
This boolean indicates whether you could do a successful subsequent getBottom operation after this update. |
boolean |
isNextEnabled()
This boolean indicates whether you could do a successful subsequent getNext operation after this update. |
boolean |
isPreviousEnabled()
This boolean indicates whether you could do a successful subsequent getPrevious operation after this update. |
boolean |
isTopEnabled()
This boolean indicates whether you could do a successful subsequent getTop operation after this update. |
| Methods inherited from class javax.swing.event.TableModelEvent |
getColumn, getFirstRow, getLastRow, getType |
| 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 |
protected java.util.Vector properties
protected int[] rowIndexesOfServerTableModel
protected int[] rowIndexesOfClientTableModel
protected int totalRowCount
protected int startIndex
protected int endIndex
protected boolean enableNext
protected boolean enablePrev
protected boolean enableTop
protected boolean enableBottom
public static final int STATE_CHANGE
| Constructor Detail |
public NmsClientTableModelEvent(javax.swing.table.TableModel source,
com.adventnet.nms.client.NmsTableModelEvent evt,
boolean showlatest)
| Method Detail |
public java.util.Vector getProperties()
public int[] getRowIndexesOfClientTableModel()
public int[] getRowIndexesOfServerTableModel()
public int getTotalRowCount()
public int getStartIndex()
public int getEndIndex()
public boolean isNextEnabled()
public boolean isPreviousEnabled()
public boolean isTopEnabled()
public boolean isBottomEnabled()
|
AdventNet Web NMS 4 API Specification | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||