Package org.apache.fop.render.rtf
Class TextAttributesConverter
- java.lang.Object
-
- org.apache.fop.render.rtf.TextAttributesConverter
-
final class TextAttributesConverter extends java.lang.Object
Converts FO properties to RtfAttributes.
This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch), Boris Poudérous (boris.pouderous@eads-telecom.com), Peter Herweg (pherweg@web.de), Normand Massé, Christopher Scott (scottc@westinghouse.com), and Roberto Marra (roberto@link-u.com).
-
-
Field Summary
Fields Modifier and Type Field Description private static org.apache.commons.logging.Log
log
-
Constructor Summary
Constructors Modifier Constructor Description private
TextAttributesConverter()
Constructor is private, because it's just a utility class.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static void
attrBackgroundColor(CommonBorderPaddingBackground bpb, RtfAttributes rtfAttr)
Reads background-color from bl and writes it to rtfAttr.private static void
attrBaseLineShift(Length baselineShift, RtfAttributes rtfAttr)
private static void
attrBlockBackgroundColor(CommonBorderPaddingBackground bpb, RtfAttributes rtfAttr)
Reads background-color for block frombpb
and writes it tortfAttr
.private static void
attrBlockMargin(CommonMarginBlock cmb, FOPRtfAttributes rtfAttr)
private static void
attrBlockTextAlign(int alignment, RtfAttributes rtfAttr)
private static void
attrBlockTextIndent(Length textIndent, FOPRtfAttributes rtfAttr)
private static void
attrBorder(CommonBorderPaddingBackground bpb, RtfAttributes rtfAttr, FONode fobj)
Adds border information frombpb
tortrAttr
.private static void
attrBreak(Block fobj, FOPRtfAttributes attrib)
private static void
attrFont(CommonFont font, FOPRtfAttributes rtfAttr)
private static void
attrFontColor(java.awt.Color colorType, RtfAttributes rtfAttr)
private static void
attrInlineBorder(CommonBorderPaddingBackground bpb, RtfAttributes rtfAttr)
Adds inline border information frombpb
tortrAttr
.private static void
attrTextDecoration(CommonTextDecoration textDecoration, RtfAttributes rtfAttr)
static RtfAttributes
convertAttributes(Block fobj)
Converts all known text FO properties to RtfAttributesstatic RtfAttributes
convertBlockContainerAttributes(BlockContainer fobj)
Converts all known text FO properties to RtfAttributesstatic RtfAttributes
convertCharacterAttributes(Inline fobj)
Converts all character related FO properties to RtfAttributes.static RtfAttributes
convertCharacterAttributes(PageNumber fobj)
Converts all character related FO properties to RtfAttributes.static RtfAttributes
convertCharacterAttributes(FOText fobj)
Converts all character related FO properties to RtfAttributes.static int
convertFOPColorToRTF(java.awt.Color fopColor)
Converts a FOP ColorType to the integer pointing into the RTF color tablestatic RtfAttributes
convertLeaderAttributes(Leader fobj, PercentBaseContext context)
Converts FO properties used by RtfLeader to RtfAttributes.private static int
convertMptToTwips(int mpt)
private static boolean
hasBorder(FONode node)
-
-
-
Method Detail
-
convertAttributes
public static RtfAttributes convertAttributes(Block fobj) throws FOPException
Converts all known text FO properties to RtfAttributes- Parameters:
fobj
- the FO for which the attributes are to be converted- Throws:
FOPException
-
attrBreak
private static void attrBreak(Block fobj, FOPRtfAttributes attrib)
-
convertBlockContainerAttributes
public static RtfAttributes convertBlockContainerAttributes(BlockContainer fobj) throws FOPException
Converts all known text FO properties to RtfAttributes- Parameters:
fobj
- FObj whose properties are to be converted- Throws:
FOPException
-
convertCharacterAttributes
public static RtfAttributes convertCharacterAttributes(FOText fobj) throws FOPException
Converts all character related FO properties to RtfAttributes.- Parameters:
fobj
- FObj whose properties are to be converted- Throws:
FOPException
-
convertCharacterAttributes
public static RtfAttributes convertCharacterAttributes(PageNumber fobj) throws FOPException
Converts all character related FO properties to RtfAttributes.- Parameters:
fobj
- FObj whose properties are to be converted- Throws:
FOPException
-
convertCharacterAttributes
public static RtfAttributes convertCharacterAttributes(Inline fobj) throws FOPException
Converts all character related FO properties to RtfAttributes.- Parameters:
fobj
- FObj whose properties are to be converted- Throws:
FOPException
-
convertLeaderAttributes
public static RtfAttributes convertLeaderAttributes(Leader fobj, PercentBaseContext context) throws FOPException
Converts FO properties used by RtfLeader to RtfAttributes.- Parameters:
fobj
- Leadercontext
- PercentBaseContext- Returns:
- RtfAttributes
- Throws:
FOPException
-
convertMptToTwips
private static int convertMptToTwips(int mpt)
-
attrFont
private static void attrFont(CommonFont font, FOPRtfAttributes rtfAttr)
-
attrFontColor
private static void attrFontColor(java.awt.Color colorType, RtfAttributes rtfAttr)
-
attrTextDecoration
private static void attrTextDecoration(CommonTextDecoration textDecoration, RtfAttributes rtfAttr)
-
attrBlockMargin
private static void attrBlockMargin(CommonMarginBlock cmb, FOPRtfAttributes rtfAttr)
-
attrBlockTextIndent
private static void attrBlockTextIndent(Length textIndent, FOPRtfAttributes rtfAttr)
-
attrBlockTextAlign
private static void attrBlockTextAlign(int alignment, RtfAttributes rtfAttr)
-
attrBlockBackgroundColor
private static void attrBlockBackgroundColor(CommonBorderPaddingBackground bpb, RtfAttributes rtfAttr)
Reads background-color for block frombpb
and writes it tortfAttr
.
-
attrBorder
private static void attrBorder(CommonBorderPaddingBackground bpb, RtfAttributes rtfAttr, FONode fobj)
Adds border information frombpb
tortrAttr
.
-
hasBorder
private static boolean hasBorder(FONode node)
- Returns:
- true, if element
node
has border.
-
attrInlineBorder
private static void attrInlineBorder(CommonBorderPaddingBackground bpb, RtfAttributes rtfAttr)
Adds inline border information frombpb
tortrAttr
.
-
attrBackgroundColor
private static void attrBackgroundColor(CommonBorderPaddingBackground bpb, RtfAttributes rtfAttr)
Reads background-color from bl and writes it to rtfAttr.- Parameters:
bpb
- the CommonBorderPaddingBackground from which the properties are readrtfAttr
- the RtfAttributes object the attributes are written to
-
attrBaseLineShift
private static void attrBaseLineShift(Length baselineShift, RtfAttributes rtfAttr)
-
convertFOPColorToRTF
public static int convertFOPColorToRTF(java.awt.Color fopColor)
Converts a FOP ColorType to the integer pointing into the RTF color table- Parameters:
fopColor
- the ColorType object to be converted- Returns:
- integer pointing into the RTF color table
-
-