org.apache.fop.render.rtf.rtflib.rtfdoc
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.
RtfSpaceSplitter
public RtfSpaceSplitter(RtfAttributes attrs,
int previousSpace)
Create RtfSpaceSplitter with given RtfAttributes.
attrs
- RtfAttributes for splittingpreviousSpace
- integer, representing accumulated spacing
flush
public int flush()
Adds corresponding attributes to their candidates.
- integer, representing value of space-before/space-after
attributes, that can't be added anywhere (i.e. these attributes
hasn't their candidates)
getCommonAttributes
public RtfAttributes getCommonAttributes()
- attributes, applicable to whole block.
getSpaceBefore
public int getSpaceBefore()
isAfterCadidateSet
public boolean isAfterCadidateSet()
- true, if candidate for space-after is set.
isBeforeCadidateSet
public boolean isBeforeCadidateSet()
- true, if candidate for space-before is set.
setSpaceAfterCandidate
public void setSpaceAfterCandidate(RtfAttributes candidate)
Sets a candidate for space-after property.
candidate
- instance of RtfAttributes
, considered as
a candidate for space-after adding
setSpaceBeforeCandidate
public void setSpaceBeforeCandidate(RtfAttributes candidate)
Sets a candidate for space-before property.
candidate
- instance of RtfAttributes
, considered as
a candidate for space-before adding
split
public int split(String key)
Remove attributes with name key
from
commonAttributes
and return it as int.
key
- attributes name to extract
- integer, representing value of extracted attributes
stopUpdatingSpaceBefore
public void stopUpdatingSpaceBefore()
Stops updating candidates for space-before attribute.
Copyright 1999-2007 The Apache Software Foundation. All Rights Reserved.