|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.levigo.jadice.document.Resolution
public class Resolution
A resolution specifies a point density in two dimensions (horizontal, vertical) relative to a certain measurement unit. Please note that this class is immutable, i.e. it is safe to pass around instances of it without cloning.
Field Summary | |
---|---|
static Resolution |
BASE_RESOLUTION
The jadice base resolution of 1/7200'th of an inch. |
static Resolution |
DPI72
72 DPI (the same resolution as POINTS but with a different base unit). |
static Resolution |
DPI96
96 DPI. |
static Resolution |
POINTS
Points: 1/72'th of an inch (72 DPI). |
Constructor Summary | |
---|---|
Resolution()
Create the default base resolution. |
|
Resolution(Dimension2D d,
Unit u)
|
|
Resolution(float r)
Create a uniform resolution (one being identical in both horizontally and vertically) based on a unit of dots per inch. |
|
Resolution(float horizontal,
float vertical)
Create a new resolution using dots per inch. |
|
Resolution(float w,
float h,
Unit u)
|
Method Summary | |
---|---|
protected void |
assertComponentsValid()
|
Resolution |
clone()
|
Resolution |
convertTo(Unit u)
|
AffineTransform |
createBaseTransform(Dimension2D size)
Create an AffineTransform scaling the unit square with this resolution to the given
size at base units. |
AffineTransform |
createTransform(Dimension2D size,
Unit u)
Create an AffineTransform scaling the unit square with this resolution to the given
size at the given resolution. |
AffineTransform |
createTransform(Resolution r)
|
boolean |
equals(Object obj)
|
float |
getMax()
Return the maximum of the two resolution components. |
float |
getMin()
Return the minimum of the two resolution components. |
Dimension2D |
getSize(Dimension2D size)
Return the physical size of a grid of the given size with this resolution. |
Dimension2D |
getSize(Dimension2D size,
Unit u)
Return the physical size of a grid of the given size with this resolution. |
Unit |
getUnit()
|
float |
getX()
Return the horizontal resolution. |
float |
getY()
Return the vertical resolution. |
int |
hashCode()
|
boolean |
isHomogenous()
Return whether the resolution is homogeneous, i.e. |
AffineTransform |
scale(AffineTransform t,
Resolution r)
Augment the given transform so that it scale the unit square with this resolution to the given target resolution. |
Dimension |
toDimension()
Deprecated. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Resolution BASE_RESOLUTION
public static final Resolution POINTS
public static final Resolution DPI72
POINTS
but with a different base unit).
public static final Resolution DPI96
Constructor Detail |
---|
public Resolution()
Document.BASE_RESOLUTION
public Resolution(float horizontal, float vertical)
horizontal
- vertical
- Unit.Inch
public Resolution(float w, float h, Unit u)
public Resolution(Dimension2D d, Unit u)
public Resolution(float r)
r
- Method Detail |
---|
protected void assertComponentsValid()
public Resolution clone()
clone
in class Object
public String toString()
toString
in class Object
@Deprecated public Dimension toDimension()
public Unit getUnit()
public Resolution convertTo(Unit u)
public Dimension2D getSize(Dimension2D size)
size
-
NullPointerException
- if the given size parameter is null
public Dimension2D getSize(Dimension2D size, Unit u)
size
-
public float getX()
public float getY()
public float getMax()
public float getMin()
public boolean isHomogenous()
true
if both components are equal.public AffineTransform createBaseTransform(Dimension2D size)
AffineTransform
scaling the unit square with this resolution to the given
size at base units.
size
-
AffineTransform
Document.BASE_RESOLUTION
public AffineTransform createTransform(Resolution r)
public AffineTransform createTransform(Dimension2D size, Unit u)
AffineTransform
scaling the unit square with this resolution to the given
size at the given resolution.
size
- u
-
AffineTransform
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public AffineTransform scale(AffineTransform t, Resolution r)
AffineTransform
is modified in place.
t
- the transform to augmentr
- the target resolution
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |