Class RtfSpaceManager
- java.lang.Object
-
- org.apache.fop.render.rtf.rtflib.rtfdoc.RtfSpaceManager
-
public class RtfSpaceManager extends java.lang.Object
This class is responsible for saving space-before/space-after attributes history and adding spacing to established candidates (i.e. attributes) or accumulation spacing in case of candidate absence.
-
-
Field Summary
Fields Modifier and Type Field Description private int
accumulatedSpace
Keeps value of accumulated space in twips.private java.util.LinkedList
blockAttributes
Stack for saving rtf block-level attributes.private java.util.LinkedList
inlineAttributes
Stack for saving rtf inline-level attributes.
-
Constructor Summary
Constructors Constructor Description RtfSpaceManager()
Construct a newly allocatedRtfSpaceManager
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RtfAttributes
getLastInlineAttribute()
Peeks at inline-level attribute stack.void
popInlineAttributes()
Pops inline attributes from inline-level stack.void
popRtfSpaceSplitter()
Removes RtfSpaceSplitter from top of block-level stack.void
pushInlineAttributes(RtfAttributes attrs)
Pushes inline attributes to inline-level stack.RtfSpaceSplitter
pushRtfSpaceSplitter(RtfAttributes attrs)
Builds RtfSpaceSplitter onattrs
and adds it to the block-level stack.void
setCandidate(RtfAttributes attrs)
Set attributes as candidate for space attributes inheritance.void
stopUpdatingSpaceBefore()
Iterates block-level stack (i.e.
-
-
-
Field Detail
-
blockAttributes
private java.util.LinkedList blockAttributes
Stack for saving rtf block-level attributes.
-
inlineAttributes
private java.util.LinkedList inlineAttributes
Stack for saving rtf inline-level attributes.
-
accumulatedSpace
private int accumulatedSpace
Keeps value of accumulated space in twips. For example if block has nonzero space-before or space-after properties and has no plain text inside, then the next block should has increased value of space-before property.
-
-
Method Detail
-
stopUpdatingSpaceBefore
public void stopUpdatingSpaceBefore()
Iterates block-level stack (i.e. all open blocks) and stops updating candidate for adding space-before/space-after attribute in case of candidate presence.
-
setCandidate
public void setCandidate(RtfAttributes attrs)
Set attributes as candidate for space attributes inheritance.- Parameters:
attrs
- attributes to set
-
pushRtfSpaceSplitter
public RtfSpaceSplitter pushRtfSpaceSplitter(RtfAttributes attrs)
Builds RtfSpaceSplitter onattrs
and adds it to the block-level stack.- Parameters:
attrs
- RtfAttribute to add- Returns:
- instance of RtfSpaceSplitter
-
popRtfSpaceSplitter
public void popRtfSpaceSplitter()
Removes RtfSpaceSplitter from top of block-level stack.
-
pushInlineAttributes
public void pushInlineAttributes(RtfAttributes attrs)
Pushes inline attributes to inline-level stack.- Parameters:
attrs
- attributes to add
-
popInlineAttributes
public void popInlineAttributes()
Pops inline attributes from inline-level stack.
-
getLastInlineAttribute
public RtfAttributes getLastInlineAttribute()
Peeks at inline-level attribute stack.- Returns:
- RtfAttributes from top of inline-level stack
-
-