Java Reference
In-Depth Information
Next, let's add some instance variables as shown in Listing 5.19.
Listing 5.19
Grid Layout Variables
/** Specifies the default alignment to use */
public var defaultAlignment = Alignment.CENTER;
/** indicates the number of columns to use,
* if this is zero or less and rows is greater than 0,
* then the number of columns will be calculated
* based on the number of nodes and the number of rows
*/
public var cols : Integer = 1;
/** indicates the number of rows to use,
* if this is zero or less and cols is greater than 0,
* then the number of rows will be calculated
* based on the number
* of nodes and the number of columns
*/
public var rows : Integer;
// spacing from left and right margin
public var horizontalMargin = 0.0;
// spacing from top and bottom margin
public var verticalMargin = 0.0;
/** spacing between columns */
public var horizontalSpacing = 2.0 ;
/** spacing between rows */
public var verticalSpacing = 2.0;
/** the horizontal alignments, one for each column,
* if the size of this sequence
* is less than the number of columns,
* then the default alignment will be used
* for the remaining columns
*/
public var horizontalAlignments : Alignment[];
/** the vertical alignments, one for each row,
* if the size of this sequence
* is less than the number of rows,
* then the default alignment
* will be used for the remaining rows
*/
public var verticalAlignments : Alignment[];
 
Search WWH ::




Custom Search