Class AlignPrint
- java.lang.Object
-
- org.eclipse.nebula.paperclips.core.AlignPrint
-
- All Implemented Interfaces:
Print
public class AlignPrint extends java.lang.Object implements 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.
-
-
Field Summary
Fields Modifier and Type Field Description private static intDEFAULT_HORIZONTAL_ALIGNprivate static intDEFAULT_VERTICAL_ALIGN(package private) inthAlign(package private) Printtarget(package private) intvAlign
-
Constructor Summary
Constructors Constructor Description AlignPrint(Print target, int hAlign, int vAlign)Constructs a new AlignPrint.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static intcheckHAlign(int hAlign)private static intcheckVAlign(int vAlign)booleanequals(java.lang.Object obj)org.eclipse.swt.graphics.PointgetAlignment()Returns a Point with the x and y fields set to the horizontal and vertical alignment, respectively.PrintgetTarget()Returns the wrapped print being alignedinthashCode()PrintIteratoriterator(org.eclipse.swt.graphics.Device device, org.eclipse.swt.graphics.GC gc)Returns a PrintIterator for laying out the contents of this Print.
-
-
-
Field Detail
-
DEFAULT_HORIZONTAL_ALIGN
private static final int DEFAULT_HORIZONTAL_ALIGN
- See Also:
- Constant Field Values
-
DEFAULT_VERTICAL_ALIGN
private static final int DEFAULT_VERTICAL_ALIGN
- See Also:
- Constant Field Values
-
target
final Print target
-
hAlign
final int hAlign
-
vAlign
final int vAlign
-
-
Constructor Detail
-
AlignPrint
public AlignPrint(Print target, int hAlign, int vAlign)
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 Detail
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
getTarget
public Print 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.
-
checkHAlign
private static int checkHAlign(int hAlign)
-
checkVAlign
private static int checkVAlign(int vAlign)
-
iterator
public PrintIterator iterator(org.eclipse.swt.graphics.Device device, org.eclipse.swt.graphics.GC gc)
Description copied from interface:PrintReturns 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.
-
-