Package net.sf.paperclips
Class AlignPrint
java.lang.Object
net.sf.paperclips.AlignPrint
- All Implemented Interfaces:
Print
A wrapper print that aligns its target vertically and/or horizontally. An
AlignPrint is vertically greedy when the vertical alignment is SWT.CENTER or
SWT.BOTTOM, and horizontally greedy when the horizontal alignment is
SWT.CENTER and SWT.RIGHT.
- Author:
- Matthew Hall
-
Constructor Summary
ConstructorsConstructorDescriptionAlignPrint
(Print target, int hAlign, int vAlign) Constructs a new AlignPrint. -
Method Summary
Modifier and TypeMethodDescriptionboolean
org.eclipse.swt.graphics.Point
Returns a Point with the x and y fields set to the horizontal and vertical alignment, respectively.Returns the wrapped print being alignedint
hashCode()
iterator
(org.eclipse.swt.graphics.Device device, org.eclipse.swt.graphics.GC gc) Returns a PrintIterator for laying out the contents of this Print.
-
Constructor Details
-
AlignPrint
Constructs a new AlignPrint.- Parameters:
target
- the print being aligned.hAlign
- the horizontal alignment. One of SWT.LEFT, SWT.CENTER, SWT.RIGHT, or SWT.DEFAULT.vAlign
- the vertical alignment. One of SWT.TOP, SWT.CENTER, SWT.BOTTOM, or SWT.DEFAULT.
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
getTarget
Returns the wrapped print being aligned- Returns:
- the wrapped print being aligned
-
getAlignment
public org.eclipse.swt.graphics.Point getAlignment()Returns a Point with the x and y fields set to the horizontal and vertical alignment, respectively.- Returns:
- a Point with the x and y fields set to the horizontal and vertical alignment, respectively.
-
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.
-