Class RtfSpaceSplitter
- java.lang.Object
-
- org.apache.fop.render.rtf.rtflib.rtfdoc.RtfSpaceSplitter
-
public class RtfSpaceSplitter extends java.lang.Object
This class splits block attributes into space-before attribute, space-after attribute and common attributes.
-
-
Field Summary
Fields Modifier and Type Field Description private RtfAttributes
commonAttributes
Common attributes for all text.private int
spaceAfter
Space-after attributes of a block.private RtfAttributes
spaceAfterCandidate
Candidate for adding space-before.private int
spaceBefore
Space-before attributes of a block.private RtfAttributes
spaceBeforeCandidate
Candidate for adding space-before.private boolean
updatingSpaceBefore
Indicate that we can update candidate for space-before.
-
Constructor Summary
Constructors Constructor Description RtfSpaceSplitter(RtfAttributes attrs, int previousSpace)
Create RtfSpaceSplitter with given RtfAttributes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
flush()
Adds corresponding attributes to their candidates.RtfAttributes
getCommonAttributes()
int
getSpaceBefore()
boolean
isAfterCadidateSet()
boolean
isBeforeCadidateSet()
void
setSpaceAfterCandidate(RtfAttributes candidate)
Sets a candidate for space-after property.void
setSpaceBeforeCandidate(RtfAttributes candidate)
Sets a candidate for space-before property.int
split(java.lang.String key)
Remove attributes with namekey
fromcommonAttributes
and return it as int.void
stopUpdatingSpaceBefore()
Stops updating candidates for space-before attribute.
-
-
-
Field Detail
-
commonAttributes
private RtfAttributes commonAttributes
Common attributes for all text.
-
spaceBefore
private int spaceBefore
Space-before attributes of a block.
-
spaceAfter
private int spaceAfter
Space-after attributes of a block.
-
updatingSpaceBefore
private boolean updatingSpaceBefore
Indicate that we can update candidate for space-before.
-
spaceBeforeCandidate
private RtfAttributes spaceBeforeCandidate
Candidate for adding space-before.
-
spaceAfterCandidate
private RtfAttributes spaceAfterCandidate
Candidate for adding space-before.
-
-
Constructor Detail
-
RtfSpaceSplitter
public RtfSpaceSplitter(RtfAttributes attrs, int previousSpace)
Create RtfSpaceSplitter with given RtfAttributes.- Parameters:
attrs
- RtfAttributes for splittingpreviousSpace
- integer, representing accumulated spacing
-
-
Method Detail
-
split
public int split(java.lang.String key)
Remove attributes with namekey
fromcommonAttributes
and return it as int.- Parameters:
key
- attributes name to extract- Returns:
- integer, representing value of extracted attributes
-
getCommonAttributes
public RtfAttributes getCommonAttributes()
- Returns:
- attributes, applicable to whole block.
-
getSpaceBefore
public int getSpaceBefore()
- Returns:
- space-before value.
-
setSpaceBeforeCandidate
public void setSpaceBeforeCandidate(RtfAttributes candidate)
Sets a candidate for space-before property.- Parameters:
candidate
- instance ofRtfAttributes
, considered as a candidate for space-before adding
-
setSpaceAfterCandidate
public void setSpaceAfterCandidate(RtfAttributes candidate)
Sets a candidate for space-after property.- Parameters:
candidate
- instance ofRtfAttributes
, considered as a candidate for space-after adding
-
isBeforeCadidateSet
public boolean isBeforeCadidateSet()
- Returns:
- true, if candidate for space-before is set.
-
isAfterCadidateSet
public boolean isAfterCadidateSet()
- Returns:
- true, if candidate for space-after is set.
-
stopUpdatingSpaceBefore
public void stopUpdatingSpaceBefore()
Stops updating candidates for space-before attribute.
-
flush
public int flush()
Adds corresponding attributes to their candidates.- Returns:
- integer, representing value of space-before/space-after attributes, that can't be added anywhere (i.e. these attributes hasn't their candidates)
-
-