Class ColumnPrint
java.lang.Object
org.eclipse.nebula.paperclips.core.ColumnPrint
- All Implemented Interfaces:
Print
public class ColumnPrint extends java.lang.Object implements Print
A wrapper Print which splits its child print into multiple columns.
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).
-
Field Summary
Fields Modifier and Type Field Description (package private) int
columns
(package private) boolean
compressed
(package private) int
spacing
(package private) Print
target
-
Constructor Summary
Constructors Constructor Description ColumnPrint(Print target, int columns, int spacing)
Constructs a ColumnPrint with the given target, number of columns, and column spacing (expressed in points). 72 points = 1".ColumnPrint(Print target, int columns, int spacing, boolean compressed)
Constructs a ColumnPrint with the given target, column count, column spacing, and compression. -
Method Summary
Modifier and Type Method 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. 72 points = 1".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.
-
Field Details
-
target
-
columns
final int columns -
spacing
final int spacing -
compressed
boolean compressed
-
-
Constructor Details
-
ColumnPrint
Constructs a ColumnPrint with the given target, number of columns, and column spacing (expressed in points). 72 points = 1".- Parameters:
target
- the print which will be split into columns.columns
- the number of columns to displayspacing
- the spacing between each column.
-
ColumnPrint
Constructs a ColumnPrint with the given target, column count, column spacing, and compression.- Parameters:
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 be
-
-
Method Details
-
hashCode
public int hashCode()- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equals
in classjava.lang.Object
-
getTarget
Returns the target print being split into columns.- Returns:
- the target print being split into columns.
-
getColumnCount
public int getColumnCount()Returns the number of columns per page.- Returns:
- the number of columns per page.
-
getColumnSpacing
public int getColumnSpacing()Returns the spacing between columns, in points. 72 points = 1".- Returns:
- the spacing between columns, in points.
-
isCompressed
public boolean isCompressed()Returns whether the columns are compressed to the smallest possible height on the last page.- Returns:
- whether the columns are compressed to the smallest possible height on the last page.
-
setCompressed
public void setCompressed(boolean compressed)Sets whether the columns are compressed to the smallest possible height on the last page.- Parameters:
compressed
- whether to compress the columns.
-
iterator
public PrintIterator iterator(org.eclipse.swt.graphics.Device device, org.eclipse.swt.graphics.GC gc)Description copied from interface:Print
Returns a PrintIterator for laying out the contents of this Print. The iterator uses a snapshot of the print at the time this method is invoked, so subsequent changes to the Print will not affect the output of the iterator.
-