| java.lang.Object net.xoetrope.xui.helper.Measurer
Measurer | public class Measurer (Code) | | A helper class to assist in positioning rows and columns of
components within a container. The containers width is divided into columns
and the height is divided into rows. Each cell is padded on either side.
No attempt is made to constrain the measurements. Therefore if an attempt is
made to call nextX or nextY more times than there are rows or columns
respectively then dimensions beyond the bounds on the container will be
returned.
Copyright: Copyright (c) Xoetrope Ltd., 1998-2003
License: see license.txt
version: $Revision: 1.22 $ |
Constructor Summary | |
public | Measurer(Container cont, int rows, int cols, int horzPadding, int vertPadding) Constructs a new Measurer. |
Measurer | public Measurer(Container cont, int rows, int cols, int horzPadding, int vertPadding)(Code) | | Constructs a new Measurer.
Parameters: cont - the container to be dividied Parameters: rows - the number of rows into which the container's height is divided Parameters: cols - the number of columns into which the container's width is divided Parameters: horzPadding - the amount of padding on the left and right of the cell Parameters: vertPadding - the amount of padding on the top and bottom of the cell |
getCellHeight | public int getCellHeight()(Code) | | Get the cell width including padding
the cell height |
getCellWidth | public int getCellWidth()(Code) | | Get the cell width including padding
the cell width |
getHeight | public int getHeight()(Code) | | Get the cell content's height (the cell height less the padding)
the cell height |
getNextX | public int getNextX()(Code) | | Get the left hand coordinate. The coordinate includes the cell padding
the new coordinate |
getNextY | public int getNextY()(Code) | | Get the top coordinate. The coordinate includes the cell padding
the new coordinate |
getRemainingHeight | public int getRemainingHeight()(Code) | | Get the remaining height available for a component, taking account of the
required padding
the remaining height |
getRemainingWidth | public int getRemainingWidth()(Code) | | Get the remaining width available for a component, taking account of the
required padding
the remaining width |
getWidth | public int getWidth()(Code) | | Get the cell width including padding (the cell width less the padding)
the cell width |
|
|