|
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.GridPrint
The GridPrint
is comparable to the legendary GridBagLayout
. It allows to add an arbitrary
number of Print
objects to a grid. The widths of the columns and the heights of the rows
must not all be equal, and a cell can span multiple columns. The span of multiple rows and
more complex layouts are solved by boxing GridPrint
objects.
GridPrintConstraints
define the properties of each cell. hGap and vGap are the usual horizontal
and vertical gaps between the cells. Because all cells are occupied with Print
objects, a pagebreak
can also occur in the middle of a row i.e. not only between the rows.
Constructor Summary | |
GridPrint()
Constructs a new GridPrint with a hGap and a vGap of 0. |
|
GridPrint(int hgap,
int vgap)
Constructs a new GridPrint with the given hGap and vGap. |
Method Summary | |
void |
add(Print print)
Adds a new Print to the list of prints using the constraints GridPrintConstraints.DEFAULT . |
void |
add(Print print,
GridPrintConstraints constraints)
Adds a new Print to the list of prints using the given constraints. |
int |
getHgap()
Returns the horizontal gap that is placed between the cells in x-direction. |
java.awt.Dimension |
getPreferredSize(java.awt.Graphics g)
Returns the preferred size of the Print . |
PrintIterator |
getPrintIterator()
Factory method, that produces a PrintIerator . |
int |
getVgap()
Returns the vertical gap that is placed between the cells in y-direction. |
void |
setClipCells(boolean clipCells)
Specifies, whether all cells shoud be clipped. |
void |
setHgap(int hgap)
Sets the horizontal gap that is placed between the cells in x-direction. |
void |
setVgap(int vgap)
Sets the vertical gap that is placed between the cells in y-direction. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GridPrint()
GridPrint
with a hGap and a vGap of 0.
public GridPrint(int hgap, int vgap)
GridPrint
with the given hGap and vGap.
hgap
- The horizontal gap that is placed between the cells in x-direction.vgap
- The vertical gap that is placed between the cells in y-direction.Method Detail |
public void add(Print print)
Print
to the list of prints using the constraints GridPrintConstraints.DEFAULT
.
print
- The print to be added.public void add(Print print, GridPrintConstraints constraints)
Print
to the list of prints using the given constraints.
print
- The print to be added.constraints
- The constraints associated with the print.public int getHgap()
public void setHgap(int hgap)
hgap
- The horizontal gap that is placed between the cells in x-direction.public int getVgap()
public void setVgap(int vgap)
vgap
- The vertical gap that is placed between the cells in y-direction.public void setClipCells(boolean clipCells)
clipCells
- Specify false
to avoid the clipping of all cells. The default is set to true
.public java.awt.Dimension getPreferredSize(java.awt.Graphics g)
Print
Print
.
getPreferredSize
in interface Print
g
- The relevant Graphics
object. It can be used to calculate the widths of strings.
Print
.public PrintIterator getPrintIterator()
Print
PrintIerator
. The PrintIterator
is used like an enumeration to generate all Print
s.
getPrintIterator
in interface Print
PrintIterator
that is able to iterate over the Print
.
|
ReportCat 1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |