java.io.Serializable
public class CTM
extends java.lang.Object
implements java.io.Serializable
Modifier | Constructor | Description |
---|---|---|
|
CTM() |
Create the identity matrix
|
|
CTM(double x,
double y) |
Initialize a CTM to the identity matrix with a translation
specified by x and y
|
|
CTM(double a,
double b,
double c,
double d,
double e,
double f) |
Initialize a CTM from the passed arguments.
|
|
CTM(java.awt.geom.AffineTransform at) |
Initialize a CTM with the values of an AffineTransform.
|
protected |
CTM(CTM ctm) |
Initialize a CTM with the values of another CTM.
|
Modifier and Type | Method | Description |
---|---|---|
static CTM |
getCTMandRelDims(int absRefOrient,
WritingMode writingMode,
java.awt.geom.Rectangle2D absVPrect,
FODimension reldims) |
Construct a coordinate transformation matrix (CTM).
|
static CTM |
getWMctm(WritingMode wm,
int ipd,
int bpd) |
Return a CTM which will transform coordinates for a particular writing-mode
into normalized first quandrant coordinates.
|
CTM |
multiply(CTM premult) |
Multiply new passed CTM with this one and generate a new result CTM.
|
CTM |
rotate(double angle) |
Rotate this CTM by "angle" radians and return a new result CTM.
|
CTM |
scale(double x,
double y) |
Scale this CTM by the passed x and y values and return a new result CTM.
|
java.awt.geom.AffineTransform |
toAffineTransform() |
Returns this CTM as an AffineTransform object.
|
double[] |
toArray() |
Get an array containing the values of this transform.
|
java.lang.String |
toString() |
Get string for this transform.
|
java.awt.geom.Rectangle2D |
transform(java.awt.geom.Rectangle2D inRect) |
Transform a rectangle by the CTM to produce a rectangle in the transformed
coordinate system.
|
CTM |
translate(double x,
double y) |
Translate this CTM by the passed x and y values and return a new result CTM.
|
public CTM()
public CTM(double a, double b, double c, double d, double e, double f)
a
- the x scaleb
- the x shearc
- the y sheard
- the y scalee
- the x shiftf
- the y shiftpublic CTM(double x, double y)
x
- the x shifty
- the y shift.protected CTM(CTM ctm)
ctm
- another CTMpublic CTM(java.awt.geom.AffineTransform at)
at
- the transformation matrixpublic static CTM getWMctm(WritingMode wm, int ipd, int bpd)
wm
- A writing mode constant from fo.properties.WritingMode, ie.
one of LR_TB, RL_TB, TB_RL, TB_LR.ipd
- The inline-progression dimension of the reference area whose
CTM is being set..bpd
- The block-progression dimension of the reference area whose
CTM is being set.public CTM multiply(CTM premult)
premult
- The CTM to multiply with this one. The new one will be
the first multiplicand.public CTM rotate(double angle)
angle
- The angle in radians. Positive angles are measured counter-
clockwise.public CTM translate(double x, double y)
x
- The amount to translate along the x axis.y
- The amount to translate along the y axis.public CTM scale(double x, double y)
x
- The amount to scale along the x axis.y
- The amount to scale along the y axis.public java.awt.geom.Rectangle2D transform(java.awt.geom.Rectangle2D inRect)
inRect
- The rectangle in the original coordinate systempublic java.lang.String toString()
toString
in class java.lang.Object
public double[] toArray()
public java.awt.geom.AffineTransform toAffineTransform()
public static CTM getCTMandRelDims(int absRefOrient, WritingMode writingMode, java.awt.geom.Rectangle2D absVPrect, FODimension reldims)
absRefOrient
- absolute reference orientationwritingMode
- the writing modeabsVPrect
- absolute viewpoint rectanglereldims
- relative dimensionsCopyright 1999-2016 The Apache Software Foundation. All Rights Reserved.