org.apache.fop.render.rtf.rtflib.rtfdoc

Class RtfSpaceSplitter


public class RtfSpaceSplitter
extends java.lang.Object

This class splits block attributes into space-before attribute, space-after attribute and common attributes.

Constructor Summary

RtfSpaceSplitter(RtfAttributes attrs, int previousSpace)
Create RtfSpaceSplitter with given RtfAttributes.

Method Summary

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(String key)
Remove attributes with name key from commonAttributes and return it as int.
void
stopUpdatingSpaceBefore()
Stops updating candidates for space-before attribute.

Constructor Details

RtfSpaceSplitter

public RtfSpaceSplitter(RtfAttributes attrs,
                        int previousSpace)
Create RtfSpaceSplitter with given RtfAttributes.
Parameters:
attrs - RtfAttributes for splitting
previousSpace - integer, representing accumulated spacing

Method Details

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)

getCommonAttributes

public RtfAttributes getCommonAttributes()
Returns:
attributes, applicable to whole block.

getSpaceBefore

public int getSpaceBefore()
Returns:
space-before value.

isAfterCadidateSet

public boolean isAfterCadidateSet()
Returns:
true, if candidate for space-after is set.

isBeforeCadidateSet

public boolean isBeforeCadidateSet()
Returns:
true, if candidate for space-before is set.

setSpaceAfterCandidate

public void setSpaceAfterCandidate(RtfAttributes candidate)
Sets a candidate for space-after property.
Parameters:
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.
Parameters:
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.
Parameters:
key - attributes name to extract
Returns:
integer, representing value of extracted attributes

stopUpdatingSpaceBefore

public void stopUpdatingSpaceBefore()
Stops updating candidates for space-before attribute.

Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.