Package net.sf.paperclips
Class RotatePrint
java.lang.Object
net.sf.paperclips.RotatePrint
- All Implemented Interfaces:
Print
A decorator print that rotates it's target by increments of 90 degrees.
Note: On Windows, this class depends on a bugfix available as of Eclipse build 3.2, release candidate 3 (2006-04-28). Prior to this release, using RotatePrint triggers the bug, causing the document to scale very large on paper. This bug only manifests itself on paper, not with on-screen viewing.
RotatePrints are horizontally and vertically greedy. Greedy prints take up all the available space on the page.
- Author:
- Matthew Hall
-
Constructor Summary
ConstructorsConstructorDescriptionRotatePrint(Print target) Constructs a RotatePrint that rotates it's target 90 degrees counter-clockwise.RotatePrint(Print target, int angle) Constructs a RotatePrint. -
Method Summary
Modifier and TypeMethodDescriptionbooleanintgetAngle()Returns the angle by which the target will be rotated (one of 0, 90, 180, or 270).Returns the print to be rotated.inthashCode()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
-
RotatePrint
Constructs a RotatePrint that rotates it's target 90 degrees counter-clockwise.- Parameters:
target- the print to rotate.
-
RotatePrint
Constructs a RotatePrint.- Parameters:
target- the print to rotate.angle- the angle by which the target will be rotated, expressed in degrees counter-clockwise. Positive values rotate counter-clockwise, and negative values rotate clockwise. Must be a multiple of 90.
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
getTarget
Returns the print to be rotated.- Returns:
- the print to be rotated.
-
getAngle
public int getAngle()Returns the angle by which the target will be rotated (one of 0, 90, 180, or 270).- Returns:
- the angle by which the target will be rotated.
-
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.
-