All Methods
zio package

context

zio
Class ZRow


java.lang.Object

  extended byzio.ZObject

      extended byzio.ZSlice

          extended byzio.ZRow


public class ZRow
extends ZSlice

A ZRow is a horizontal slice of a part of a window. A ZRow is almost identical to a ZCol. One can be obtained from the other by transposing the vertical and horizontal directions. Both are ZObjects. A ZRow will stretch in a horizontal direction when the user expands a window. If none of the ZObjects in a column expands horizontally, the expansion will happen in the spaces around the ZObjects; otherwise it happens in those ZObjects. (Those which can expand horizontally.) If any nonexpanding component ZObject is too short for the others, it will be centered vertically within the column It you don't like this, you can get position that ZObject upwards or downwards by putting a ZCol around it. and using atTop() or atBottom().

By default, ZRow will not expand vertically even if component object is capable of vertical expansion. Think of this default state as "half locked". Horizontal expansion will happen even if none of the component ZObjects expands horizontally. Vertical expansion will not happen even if some of the component objects expand vertically. From this half-locked, state you can use the unlock() suffix to unlock expansion vertically or the lock() suffix to lock expansion horizontally. The lock suffix overrides the unlock suffix.

Version:
Jul 22, 2005
Author:
copyright 2005 by J Adrian Zimmer
Licensed under the Open Software License version 2.1
See Also:
about slices

Constructor Summary
ZRow(ZObject gu)
          Create a ZRow with a single ZObject.
ZRow(ZObject[] gs)
          Create a ZRow with multiple objects given in an array.
ZRow(ZObject gu1, ZObject gu2)
          Create a ZRow with two ZObjects.
ZRow(ZObject gu1, ZObject gu2, ZObject gu3)
          Create a ZRow with three ZObjects.
ZRow(ZObject gu1, ZObject gu2, ZObject gu3, ZObject gu4)
          Create a ZRow with four ZObjects.
 
Method Summary
 ZRow atLeft()
          Suffix that forces leftmost component ZObject to appear at the left of the row without any intervening space.
 ZRow atRight()
          Suffix that forces rightmost component ZObject to appear at the right of the row without any intervening space.
 ZRow background(java.awt.Color c)
          Suffix that determines the background color of the row.
 ZRow debug(java.lang.String debugId)
          Suffix that creates debug output.
 ZRow foreground(java.awt.Color c)
          Suffix that sets the foreground color of the row.
 ZRow framed(int margin)
          Suffix that creates an etched frame around the ZRow.
 ZRow grid()
          Suffix that creates a grid, or two dimensional array, of ZObjects.
 ZRow lock()
          Causes row to be unexpandable in any direction.
 ZRow space(int space)
          Suffix that sets minimum spacing.
 ZRow unframed(int margin)
          Suffix that creates the margin used with a frame without creating the frame.
 ZRow uniform()
          This suffix causes all component ZObjects to be the same size.
 ZRow unlock()
          Suffix that permits row to expand vertically.
 
Methods inherited from class zio.ZObject
getSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZRow


public ZRow(ZObject[] gs)
Create a ZRow with multiple objects given in an array. The objects of ZRow will appear from left to right in the order gs[0], gs[1], ... .

Parameters:
gs - an array of those ZObjects which will appear in the row

ZRow


public ZRow(ZObject gu)
Create a ZRow with a single ZObject.

Parameters:
gu - the object to appear in the row

ZRow


public ZRow(ZObject gu1,
            ZObject gu2)
Create a ZRow with two ZObjects.

Parameters:
gu1 - the leftmost object to appear in the row
gu2 - the rightmost object to appear in the row

ZRow


public ZRow(ZObject gu1,
            ZObject gu2,
            ZObject gu3)
Create a ZRow with three ZObjects.

Parameters:
gu1 - the leftmost object to appear in the row
gu2 - the middle object to appear in the row
gu3 - the rightmost object to appear in the row

ZRow


public ZRow(ZObject gu1,
            ZObject gu2,
            ZObject gu3,
            ZObject gu4)
Create a ZRow with four ZObjects.

Parameters:
gu1 - the leftmost object to appear in the row
gu2 - the left middle object to appear in the row
gu3 - the right middle object to appear in the row
gu4 - the rightmost object to appear in the row
Method Detail

debug


public final ZRow debug(java.lang.String debugId)
Suffix that creates debug output.


framed


public ZRow framed(int margin)
Suffix that creates an etched frame around the ZRow. This margin overrides any other spacing on the sides of the slice. Do not use with unframed() suffix.

Parameters:
margin - size of margin between the slice and the frame

unframed


public ZRow unframed(int margin)
Suffix that creates the margin used with a frame without creating the frame. This margin overrides any other spacing on the sides of the slice. Do not use with framed() suffix.

Parameters:
margin - size of margin around the slice

atLeft


public final ZRow atLeft()
Suffix that forces leftmost component ZObject to appear at the left of the row without any intervening space.


atRight


public final ZRow atRight()
Suffix that forces rightmost component ZObject to appear at the right of the row without any intervening space.


space


public final ZRow space(int space)
Suffix that sets minimum spacing. This suffix sets a minimum number of pixels for the width of a space. If not present, this minimum number is calculated with a complex formula.

This minimum always applies to space between component ZObjects. It applies to space at left and right only if no framed(), unframed(), atLeft(), or atRight() suffix has been used.


uniform


public final ZRow uniform()
This suffix causes all component ZObjects to be the same size. No component object can be a slice. The calculated size will be the smallest that can accommodate the minimum size of all objects. Causes expandH() and expandV() to be ignored.


unlock


public final ZRow unlock()
Suffix that permits row to expand vertically. There is no spacing or padding to make vertical expansion work so it won't happen unless one of the contained ZObjects already expands vertically.


lock


public final ZRow lock()
Causes row to be unexpandable in any direction. Causes the unlock() suffix to be ignored.


background


public final ZRow background(java.awt.Color c)
Suffix that determines the background color of the row. The background color will be seen in the spaces and will be inherited by the contained ZObjects.

Parameters:
c - the desired color

foreground


public final ZRow foreground(java.awt.Color c)
Suffix that sets the foreground color of the row. The foreground color will be inherited by the contained ZObjects.


grid


public ZRow grid()
Suffix that creates a grid, or two dimensional array, of ZObjects. ZObjects in any one row are forced to have the same height and ZObjects in any one column are forced to have the same width.

To make the grid, you must populate this ZRow only with ZCols and each column must have the same number of ZObjects.

The only suffixes that work with grid() are foreground(), background(), space(), framed(), unframed() and debug(). The only suffix that will work on any the ZCols that define the columns of this grid is debug(). Suffixes work as normal on the ZObjects in the grid.

NOT YET IMPLEMENTED.


author
context