Package org.apache.fop.render.txt
Class TXTState
java.lang.Object
org.apache.fop.render.txt.TXTState
This keeps information about the current state when writing to txt, i.e.
manages coordinate transformation matrices for getting absolute coordinates.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate CTM
Current result coordinate transformation matrix.private LinkedList
Keeps all coordinate transformation matrices during rendering. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
Recalculate current result coordinate transformation matrix.void
pop()
Pop the coordinate transformation matrix from the stack and reevaluateresultCTM
.void
Push the current coordinate transformation matrix onto the stack and reevaluateresultCTM
.Modifies coordinate transformation matrix in such a way, so x-shift and y-shift will be transformed in text positions.transformPoint
(int x, int y) Transforms point (x, y) usingresultCTM
.transformPoint
(Point p, CTM ctm) Transformspoint
usingctm
.private void
updateResultCTM
(CTM ctm) Updates result coordinate transformation matrix (i.e.
-
Field Details
-
stackCTM
Keeps all coordinate transformation matrices during rendering. -
resultCTM
Current result coordinate transformation matrix. It's product of all matrices in order, saved instackCTM
.
-
-
Constructor Details
-
TXTState
public TXTState()Constructs a newly allocatedTXTState
object.
-
-
Method Details
-
updateResultCTM
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
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
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
Transformspoint
usingctm
.- Parameters:
p
- Pointctm
- CTM- Returns:
- transformed Point
-
transformPoint
Transforms point (x, y) usingresultCTM
.- Parameters:
x
- x-coordinatey
- y-coordinate- Returns:
- transformed Point
-
getResultCTM
- Returns:
- current result coordinate transformation matrix
-