All Methods
zio package

context

zio
Class ZCol


java.lang.Object

  extended byzio.ZObject

      extended byzio.ZSlice

          extended byzio.ZCol


public class ZCol
extends ZSlice

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

By default, ZCol will not expand horizontally even if some object within it is capable of horizontal expansion. Think of this default state as "half locked". Vertical expansion will happen even if none of the component ZObjects expands vertically. Horizontal expansion will not happen even if some of the component objects expand horizontally. From this half-locked, state you can use the unlock() suffix to unlock expansion horizontally or the lock() suffix to lock expansion vertically. 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
ZCol(ZObject gu)
          Create a ZCol with a single ZObject.
ZCol(ZObject[] gs)
          Create a ZCol with multiple objects given in an array.
ZCol(ZObject gu1, ZObject gu2)
          Create a ZCol with two ZObjects.
ZCol(ZObject gu1, ZObject gu2, ZObject gu3)
          Create a ZCol with three ZObjects.
ZCol(ZObject gu1, ZObject gu2, ZObject gu3, ZObject gu4)
          Create a ZCol with four ZObjects.
 
Method Summary
 ZCol atBottom()
          Suffix that forces bottom component ZObject to appear at bottom of column without any intervening space.
 ZCol atTop()
          Suffix that forces top component ZObject to appear at top of column without intervening space.
 ZCol background(java.awt.Color c)
          Suffix that determines the background color of the column.
 ZCol debug(java.lang.String debugId)
          Suffix that creates debug output.
 ZCol foreground(java.awt.Color c)
          Suffix that sets the foreground color of the column.
 ZCol framed(int margin)
          Suffix that creates an etched frame around the ZCol.
 ZCol grid()
          Suffix that creates a grid, or two dimensional array, of ZObjects.
 ZCol lock()
          Causes column to be unexpandable in any direction.
 ZCol space(int space)
          Suffix that sets minimum spacing.
 ZCol unframed(int margin)
          Suffix that creates the margin used with a frame without creating the frame.
 ZCol uniform()
          This suffix causes all component ZObjects to be the same size.
 ZCol unlock()
          Suffix that permits column to expand horizontally.
 
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

ZCol


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

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

ZCol


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

Parameters:
gu - the object to appear in the column

ZCol


public ZCol(ZObject gu1,
            ZObject gu2)
Create a ZCol with two ZObjects. The parameters are listed left to right in the top to bottom order of the column.

Parameters:
gu1 - the topmost ZObject
gu2 - the bottommost ZObject

ZCol


public ZCol(ZObject gu1,
            ZObject gu2,
            ZObject gu3)
Create a ZCol with three ZObjects. The parameters are listed left to right in the top to bottom order of the column.

Parameters:
gu1 - the topmost ZObject
gu2 - the middle ZObject
gu3 - the bottommost ZObject

ZCol


public ZCol(ZObject gu1,
            ZObject gu2,
            ZObject gu3,
            ZObject gu4)
Create a ZCol with four ZObjects. The parameters are listed left to right in the top to bottom order of the column.

Parameters:
gu1 - the topmost ZObject
gu2 - the top middle ZObject
gu3 - the bottom middle ZObject
gu4 - the bottommost ZObject
Method Detail

debug


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


atTop


public final ZCol atTop()
Suffix that forces top component ZObject to appear at top of column without intervening space.


atBottom


public final ZCol atBottom()
Suffix that forces bottom component ZObject to appear at bottom of column without any intervening space.


unlock


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

If any other ZObject is too narrow for the expanded column, it will be aligned in the center of the column. You can get around that by putting such an object in a ZRow and using atLeft() or atRight().


lock


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


background


public final ZCol background(java.awt.Color c)
Suffix that determines the background color of the column. 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 ZCol foreground(java.awt.Color c)
Suffix that sets the foreground color of the column. The foreground color will be inherited by the contained ZObjects.


space


public final ZCol space(int space)
Suffix that sets minimum spacing. This suffix sets a minimum number of pixels for the height 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 top and bottom only if no framed(), unframed(), atTop(), or atBottom() suffix has been used.


uniform


public final ZCol 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.


framed


public ZCol framed(int margin)
Suffix that creates an etched frame around the ZCol. 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 ZCol 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

grid


public ZCol 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 ZCol only with ZRowss and each row 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 ZRows that define the rows of this grid is debug(). Suffixes work as normal on the ZObjects in the grid.

NOT YET IMPLEMENTED.


author
context