ReportCat 1.1

li.netcat.print.util
Class GridPrint

java.lang.Object
  extended byli.netcat.print.util.GridPrint
All Implemented Interfaces:
Print

public class GridPrint
extends java.lang.Object
implements Print

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.

Author:
Arthur Marxer

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

GridPrint

public GridPrint()
Constructs a new GridPrint with a hGap and a vGap of 0.


GridPrint

public GridPrint(int hgap,
                 int vgap)
Constructs a new GridPrint with the given hGap and vGap.

Parameters:
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

add

public void add(Print print)
Adds a new Print to the list of prints using the constraints GridPrintConstraints.DEFAULT.

Parameters:
print - The print to be added.

add

public void add(Print print,
                GridPrintConstraints constraints)
Adds a new Print to the list of prints using the given constraints.

Parameters:
print - The print to be added.
constraints - The constraints associated with the print.

getHgap

public int getHgap()
Returns the horizontal gap that is placed between the cells in x-direction.

Returns:
The horizontal gap that is placed between the cells in x-direction.

setHgap

public void setHgap(int hgap)
Sets the horizontal gap that is placed between the cells in x-direction.

Parameters:
hgap - The horizontal gap that is placed between the cells in x-direction.

getVgap

public int getVgap()
Returns the vertical gap that is placed between the cells in y-direction.

Returns:
The vertical gap that is placed between the cells in y-direction.

setVgap

public void setVgap(int vgap)
Sets the vertical gap that is placed between the cells in y-direction.

Parameters:
vgap - The vertical gap that is placed between the cells in y-direction.

setClipCells

public void setClipCells(boolean clipCells)
Specifies, whether all cells shoud be clipped.

Parameters:
clipCells - Specify false to avoid the clipping of all cells. The default is set to true.

getPreferredSize

public java.awt.Dimension getPreferredSize(java.awt.Graphics g)
Description copied from interface: Print
Returns the preferred size of the Print.

Specified by:
getPreferredSize in interface Print
Parameters:
g - The relevant Graphics object. It can be used to calculate the widths of strings.
Returns:
The preferred size of the Print.

getPrintIterator

public PrintIterator getPrintIterator()
Description copied from interface: Print
Factory method, that produces a PrintIerator. The PrintIterator is used like an enumeration to generate all Prints.

Specified by:
getPrintIterator in interface Print
Returns:
An instance of a PrintIterator that is able to iterate over the Print.

ReportCat 1.1

Copyright © 2003 - 2005 NetCat Inc.. All rights reserved. Feedback

Print,Printing,Printer,Java,Java Print,SDK,Java Printing,Printing Java,Print Java,Library,Java Library,Print Library,Report,Reports,Java Report,Java Programming,Java Output,Layout,Page,API,Preview,Print Preview,Content,A4,Free,Output,Header,Footer,Download,Package,Jar,Evaluation, Print,Printing,Printer,Java,Java Print,SDK,Java Printing,Printing Java,Print Java,Library,Java Library,Print Library,Report,Reports,Java Report,Java Programming,Java Output,Layout,Page,API,Preview,Print Preview,Content,A4,Free,Output,Header,Footer,Download,Package,Jar,Evaluation, Print,Printing,Printer,Java,Java Print,SDK,Java Printing,Printing Java,Print Java,Library,Java Library,Print Library,Report,Reports,Java Report,Java Programming,Java Output,Layout,Page,API,Preview,Print Preview,Content,A4,Free,Output,Header,Footer,Download,Package,Jar,Evaluation