public class ScalePrint extends java.lang.Object implements Print
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 ScalePrint triggers the bug, causing the document to scale very large on paper. This bug manifests itself only on paper, not with on-screen viewing.
Modifier and Type | Field and Description |
---|---|
(package private) java.lang.Double |
scale |
(package private) Print |
target |
Constructor and Description |
---|
ScalePrint(Print target)
Constructs a ScalePrint which scales down it's target to print at it's
preferred size.
|
ScalePrint(Print target,
java.lang.Double scale)
Constructs a ScalePrint which scales it's target by the given factor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.Double |
getScale()
Returns the scale by which the target will be scaled, or null (indicating
automatic scale down to fit).
|
Print |
getTarget()
Returns the print being scaled.
|
int |
hashCode() |
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.
|
final Print target
final java.lang.Double scale
public ScalePrint(Print target)
target
- the print to scale down.public ScalePrint(Print target, java.lang.Double scale)
target
- scale
- the scale factor (must be >0). A value of 2.0 draws at double
the size, and a value of 0.5 draws at half the size. A null
value automatically scales down so the target is rendered at
it's preferred size.public 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 java.lang.Double getScale()
public PrintIterator iterator(org.eclipse.swt.graphics.Device device, org.eclipse.swt.graphics.GC gc)
Print