Chapter Contents

Previous

Next
SAS/AF Software: Class Dictionary

Using the Row/Column Data Vector Class


Calling Methods of the Row/Column Data Vector Class

The Row/Column Data Vector class contains information about one column or one row. The viewers request information about rows or columns by calling the _getRowInfo or _getColumnInfo methods of the model one row or column at a time. Likewise, the viewers set information about rows or columns by calling the _setRowInfo or _setColumnInfo methods of the model one row or column at a time.

The caller of the model's _getRowInfo, _getColumnInfo, _setRowInfo, or _setColumnInfo method is responsible for creating the instance of the Row/Column Data Vector passed as an argument to these methods. Therefore, if you are overriding the model methods listed above, you need not create your own instance of the Row/Column Data Vector class; one will be passed to you because it has already been created. However, if you are calling any of these methods of the model directly or if your own viewer class is calling any of these methods on the model, you are responsible for creating your own instance of the Row/Column Data Vector class.

If you are making your own instance of a Row/Column Data Vector class, you must set up the row/column data vector with information about to which row or column method calls the Row/Column Data Vector class refers. After making an instance of the Row/Column Data Vector class, you should call the _setCoordinates method to tell the row/column data vector which row or column the instance is concerned with. If the Row/Column Data Vector you create is passed to the _getRowInfo or _setRowInfo method, the information set on the _setCoordinates method call is interpreted as the current row. If the row/column data vector you create is passed to the _getColumnInfo or _setColumnInfo method, the information set on the _setCoordinates method call is interpreted as the current column.

Example

In the following example, a row/column data vector is created and set up with initial values. The rcdvecid can then be sent to a model on a _setColumnInfo call.
 Note about code
rcdvecid = instance(loadclass('sashelp.fsp.
                    rcdvec'));
 Note about code
collst = makelist();
rc = insertn(collst, 2, -1);
call send(collst, '_setCoordinates', collst);
 Note about code
call send(rcdvecid, '_setColor', 'green');
 Note about code
call send(rcdvecid, '_setHjust', 'center');

Note that some of the Row/Column Data Vector methods set or return values that are only applicable for either the form editor or the table editor. By default, it is assumed that the instance of the Row/Column Data Vector class you create can be used by either a form editor or a table editor, and you are free to call any methods of the Row/Column Data Vector class. However, if you know when you make your row/column data vector that it will only be used for either a form editor or a table editor, the Row/Column Data Vector class can do error checking for you by program halting when you call a method that is not supported by the viewer you are using. For more information, see _init in this class.

Where Methods Can be Used

The following table shows which methods of the Row/Column Data Vector class can be used with the Form Editor class, and which can be used with the Table Editor class. The table also shows which methods can be used for columns and which can be used for rows. Those methods that are only useful for columns should not be used in a data vector in the _getRowInfo or _setRowInfo methods. Those methods that are only useful for rows should not be used in a data vector in the _getColumnInfo or _setColumnInfo methods.

Where Methods Can be Used
Method Name Used in Form Editor? Used in Table Editor? Only Useful for Columns Only Useful for Rows
_getAlignment No Yes No No
_getAlignmentChar No Yes Yes No
_getAlignJust No Yes Yes No
_getBackgroundColor Yes Yes No No
_getBackgroundPattern No Yes No No
_getBorderColor No Yes No No
_getBorderStyle No Yes No No
_getBorderWidth No Yes No No
_getClassName Yes No No No
_getClassProperties Yes No No No
_getColor Yes Yes No No
_getCoordinates Yes Yes No No
_getDecimals No Yes Yes No
_getDimension No Yes No No
_getEndOfData Yes Yes No No
_getFont Yes Yes No No
_getFormat Yes No No No
_getFormatLength Yes Yes No No
_getHidden Yes No No No
_getHjust Yes Yes No No
_getInformat Yes No No No
_getInherit Yes No No No
_getLightSource No Yes No No
_getMargin No Yes No No
_getMeasuring No Yes No No
_getName Yes No No No
_getNameJust No Yes No Yes
_getPrinting No Yes No No
_getProtect Yes Yes No No
_getRepresentation Yes No No No
_getResizing No Yes No No
_getReverse No Yes No No
_getSoftEndOfData No Yes No No
_getText No Yes No No
_getType Yes No Yes No
_getVjust No Yes No No
_getWrapping No Yes No No
_init Yes Yes No No
_setAlignment No Yes No No
_setAlignmentChar No Yes Yes No
_setAlignJust No Yes Yes No
_setBackgroundColor Yes Yes No No
_setBackgroundPattern No Yes No No
_setBorderColor No Yes No No
_setBorderStyle No Yes No No
_setBorderWidth No Yes No No
_setClassName Yes No No No
_setClassProperties Yes No No No
_setColor Yes Yes No No
_setCoordinates Yes Yes No No
_setDecimals No Yes Yes No
_setDimension No Yes No No
_setEndOfData Yes Yes No No
_setFont Yes Yes No No
_setFormat Yes No No No
_setFormatLength Yes Yes No No
_setHidden Yes No No No
_setHjust Yes Yes No No
_setInformat Yes No No No
_setInherit Yes No No No
_setLightSource No Yes No No
_setMargin No Yes No No
_setMeasuring No Yes No No
_setNameJust No Yes No Yes
_setPrinting No Yes No No
_setProtect Yes Yes No No
_setRepresentation Yes No No No
_setResizing No Yes No No
_setReverse No Yes No No
_setSoftEndOfData No Yes No No
_setText No Yes No No
_setVjust No Yes No No
_setWrapping No Yes No No


Using the Row/Column Data Vector Class with a Form Editor

You need to make special considerations when using the Row/Column Data Vector class with a form editor. When a form editor displays its data, it calls the _getRowInfo method to query information from the model about the number of rows to display. Then it calls _getColumnInfo for each column in the displayed row to query information from the model about the columns to display. Not all of the items in the Row/Column Data Vector class that you can set on a column-by-column basis make sense to be set for each row in a form display. For example, colors can be set for each column on a call to _getColumnInfo. But colors set for a row on a call to _getRowInfo are used by the table editor but are not used by the form editor. The form editor checks all possible items on the return from the call to the model's _getColumnInfo method, but it only checks the end-of-data items set by the _setEndOfData and _setSoftEndOfData on the return from the call to the model's _getRowInfo method.

If you are overriding the model's _getRowInfo method, consider that any items that you set with the exception of the _setEndOfData and _setSoftEndOfData methods are not honored by the form editor.


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.