|
ReportCat 1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectli.netcat.print.util.GridPrintConstraints
This immutable class defines the constraints that are associated with each cell in a GridPrint
.
It defines
Field Summary | |
static int |
COL_WIDTH_PREFERRED
This constant defines the column width to be the preferred width of the print. |
static int |
COL_WIDTH_RELATIVE
This constant defines the column width to be relative, i.e. the widths of the columns are distributed according to their weights. |
static GridPrintConstraints |
DEFAULT
The default constraints object with a horizontal alignment of left, a colSpan of REMAINDER ,
a weight of 1.0f and a relative columnWidth. |
static int |
REMAINDER
The REMAINDER is a colSpan value that fills all remaining columns. |
Constructor Summary | |
GridPrintConstraints(int hAlign,
int colSpan,
float colWeight,
int colWidth)
Constructs a new GridPrintConstraints object using the given values. |
Method Summary | |
GridPrintConstraints |
colSpan(int colSpan)
Returns a clone of the target with a modified colSpan value. |
GridPrintConstraints |
colWeight(float colWeight)
Returns a clone of the target with a modified colWeight value. |
GridPrintConstraints |
colWidth(int colWidth)
Returns a clone of the target with a modified colWidth value. |
GridPrintConstraints |
colWidthPreferred()
Returns a clone of the target that defines the width of the column to be the preffered width of the cell associated with that constraint. |
GridPrintConstraints |
colWidthRelative()
Returns a clone of the target that defines the width of the column to be relative according to it's weight. |
int |
getColSpan()
Returns the column span. |
float |
getColWeight()
Returns the weight of a column. |
int |
getColWidth()
Returns the columnWidth of a cell. |
int |
getHAlign()
Returns the horizontal alignment of the cell, one of LEFT , RIGHT or CENTER (see PrintConstants). |
GridPrintConstraints |
hAlign(int hAlign)
Returns a clone of the target with a modified hAlign value. |
GridPrintConstraints |
hAlignCenter()
Returns a clone of the target with a hAlign value of CENTER . |
GridPrintConstraints |
hAlignLeft()
Returns a clone of the target with a hAlign value of LEFT . |
GridPrintConstraints |
hAlignRight()
Returns a clone of the target with a hAlign value of RIGHT . |
boolean |
isRemainder()
Returns true if columnSpan is REMAINDER . |
GridPrintConstraints |
remainder()
Returns a clone of the target with a colSpan value of REMAINDER . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final GridPrintConstraints DEFAULT
REMAINDER
,
a weight of 1.0f and a relative columnWidth.
public static final int REMAINDER
REMAINDER
is a colSpan value that fills all remaining columns.
public static final int COL_WIDTH_RELATIVE
public static final int COL_WIDTH_PREFERRED
Constructor Detail |
public GridPrintConstraints(int hAlign, int colSpan, float colWeight, int colWidth)
GridPrintConstraints
object using the given values. Please notice the DEFAULT
static variable and the clone methods for an easy to read construction of GridPrintConstraints
, e.g.
GridPrint gp = ...; Print p = ...; GridPrintConstraints c = GridPrintConstraints.DEFAULT; gp.add(p, c.colSpan(1).colWeight(2.0f));
hAlign
- The horizontal alignment of the cell, one of LEFT
, RIGHT
or CENTER
(see PrintConstants
).colSpan
- The columnSpan of a cell. It must be a positive value or REMAINDER
.colWeight
- The weight of a column. The default value is 1.0f. It is used for the relative distribution of the width to all columns. It must be >= 1.0f.colWidth
- The columnWidth can be specified to define an absolute width of a column. This parameter must be >= 0 or COL_WIDTH_RELATIVE
or COL_WIDTH_PREFERRED
.Method Detail |
public final int getColSpan()
REMAINDER
.public final boolean isRemainder()
REMAINDER
.
REMAINDER
.public final int getHAlign()
LEFT
, RIGHT
or CENTER
(see PrintConstants).
public final float getColWeight()
public final int getColWidth()
COL_WIDTH_RELATIVE
or COL_WIDTH_PREFERRED
.
COL_WIDTH_RELATIVE
or COL_WIDTH_PREFERRED
.public GridPrintConstraints colSpan(int colSpan)
colSpan
- The columnSpan of a cell. It must be a positive value or REMAINDER
.
public GridPrintConstraints remainder()
REMAINDER
.
REMAINDER
.public GridPrintConstraints hAlign(int hAlign)
hAlign
- The horizontal alignment of the cell, one of LEFT
, RIGHT
or CENTER
(see PrintConstants
).
public GridPrintConstraints hAlignRight()
RIGHT
.
RIGHT
.public GridPrintConstraints hAlignCenter()
CENTER
.
CENTER
.public GridPrintConstraints hAlignLeft()
LEFT
.
LEFT
.public GridPrintConstraints colWeight(float colWeight)
colWeight
- The weight of a column. It is used for the relative distribution of the width to all columns. It must be >= 1.0f.
public GridPrintConstraints colWidth(int colWidth)
colWidth
- The columnWidth can be specified to define an absolute width of a column.
This parameter must be >= 0 or COL_WIDTH_RELATIVE
or COL_WIDTH_PREFERRED
.
public GridPrintConstraints colWidthPreferred()
COL_WIDTH_PREFERRED
.public GridPrintConstraints colWidthRelative()
COL_WIDTH_RELATIVE
.
|
ReportCat 1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |