public class ColumnPrint extends java.lang.Object implements Print
This class is horizontally greedy. Greedy prints take up all the available space on the page.
ColumnPrint attempts to use the minimum possible vertical space on the page if isCompressed() returns true (the default). This behavior can be disabled by calling setCompressed(false).
Modifier and Type | Field and Description |
---|---|
(package private) int |
columns |
(package private) boolean |
compressed |
(package private) int |
spacing |
(package private) Print |
target |
Constructor and Description |
---|
ColumnPrint(Print target,
int columns,
int spacing)
Constructs a ColumnPrint with the given target, number of columns, and
column spacing (expressed in points).
|
ColumnPrint(Print target,
int columns,
int spacing,
boolean compressed)
Constructs a ColumnPrint with the given target, column count, column
spacing, and compression.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
int |
getColumnCount()
Returns the number of columns per page.
|
int |
getColumnSpacing()
Returns the spacing between columns, in points.
|
Print |
getTarget()
Returns the target print being split into columns.
|
int |
hashCode() |
boolean |
isCompressed()
Returns whether the columns are compressed to the smallest possible
height on the last page.
|
PrintIterator |
iterator(org.eclipse.swt.graphics.Device device,
org.eclipse.swt.graphics.GC gc)
Returns a PrintIterator for laying out the contents of this Print.
|
void |
setCompressed(boolean compressed)
Sets whether the columns are compressed to the smallest possible height
on the last page.
|
final Print target
final int columns
final int spacing
boolean compressed
public ColumnPrint(Print target, int columns, int spacing)
target
- the print which will be split into columns.columns
- the number of columns to displayspacing
- the spacing between each column.public ColumnPrint(Print target, int columns, int spacing, boolean compressed)
target
- the print to display in columns.columns
- the number of columns to display.spacing
- the spacing between each column, expressed in points. 72
points = 1".compressed
- whether the columns on the final page are to bepublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public Print getTarget()
public int getColumnCount()
public int getColumnSpacing()
public boolean isCompressed()
public void setCompressed(boolean compressed)
compressed
- whether to compress the columns.public PrintIterator iterator(org.eclipse.swt.graphics.Device device, org.eclipse.swt.graphics.GC gc)
Print