Package org.apache.fop.render.txt
Class TXTState
- java.lang.Object
-
- org.apache.fop.render.txt.TXTState
-
public class TXTState extends java.lang.ObjectThis keeps information about the current state when writing to txt, i.e. manages coordinate transformation matrices for getting absolute coordinates.
-
-
Constructor Summary
Constructors Constructor Description TXTState()Constructs a newly allocatedTXTStateobject.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcalcResultCTM()Recalculate current result coordinate transformation matrix.CTMgetResultCTM()voidpop()Pop the coordinate transformation matrix from the stack and reevaluateresultCTM.voidpush(CTM ctm)Push the current coordinate transformation matrix onto the stack and reevaluateresultCTM.CTMrefineCTM(CTM ctm)Modifies coordinate transformation matrix in such a way, so x-shift and y-shift will be transformed in text positions.java.awt.PointtransformPoint(int x, int y)Transforms point (x, y) usingresultCTM.java.awt.PointtransformPoint(java.awt.Point p, CTM ctm)Transformspointusingctm.private voidupdateResultCTM(CTM ctm)Updates result coordinate transformation matrix (i.e.
-
-
-
Field Detail
-
stackCTM
private java.util.LinkedList stackCTM
Keeps all coordinate transformation matrices during rendering.
-
resultCTM
private CTM resultCTM
Current result coordinate transformation matrix. It's product of all matrices in order, saved instackCTM.
-
-
Method Detail
-
updateResultCTM
private void updateResultCTM(CTM ctm)
Updates result coordinate transformation matrix (i.e.resultCTM), multipliing it by given matrix.- Parameters:
ctm- CTM
-
calcResultCTM
private void calcResultCTM()
Recalculate current result coordinate transformation matrix.
-
push
public void push(CTM ctm)
Push the current coordinate transformation matrix onto the stack and reevaluateresultCTM.- Parameters:
ctm- instance of CTM
-
pop
public void pop()
Pop the coordinate transformation matrix from the stack and reevaluateresultCTM.
-
refineCTM
public CTM refineCTM(CTM ctm)
Modifies coordinate transformation matrix in such a way, so x-shift and y-shift will be transformed in text positions.- Parameters:
ctm- CTM to modify- Returns:
- instance of CTM
-
transformPoint
public java.awt.Point transformPoint(java.awt.Point p, CTM ctm)Transformspointusingctm.- Parameters:
p- Pointctm- CTM- Returns:
- transformed Point
-
transformPoint
public java.awt.Point transformPoint(int x, int y)Transforms point (x, y) usingresultCTM.- Parameters:
x- x-coordinatey- y-coordinate- Returns:
- transformed Point
-
getResultCTM
public CTM getResultCTM()
- Returns:
- current result coordinate transformation matrix
-
-