/**
*
*/
public Object createObject(Attributes atts)
{
JRDesignTextElement textElement = (JRDesignTextElement)digester.peek();
HorizontalAlignEnum horizontalAlignment = HorizontalAlignEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_textAlignment));
if (horizontalAlignment != null)
{
textElement.setHorizontalAlignment(horizontalAlignment);
}
VerticalAlignEnum verticalAlignment = VerticalAlignEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_verticalAlignment));
if (verticalAlignment != null)
{
textElement.setVerticalAlignment(verticalAlignment);
}
RotationEnum rotation = RotationEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_rotation));
if (rotation != null)
{
textElement.setRotation(rotation);
}
LineSpacingEnum lineSpacing = LineSpacingEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_lineSpacing));
if (lineSpacing != null)
{
if (log.isWarnEnabled())
{
log.warn("The 'lineSpacing' attribute is deprecated. Use the <paragraph> tag instead.");
}
textElement.getParagraph().setLineSpacing(lineSpacing);
}
textElement.setMarkup(atts.getValue(JRXmlConstants.ATTRIBUTE_markup));
String isStyledText = atts.getValue(JRXmlConstants.ATTRIBUTE_isStyledText);
if (isStyledText != null && isStyledText.length() > 0)
{
if (log.isWarnEnabled())
{
log.warn("The 'isStyledText' attribute is deprecated. Use the 'markup' attribute instead.");
}
textElement.setMarkup(Boolean.valueOf(isStyledText) ? JRCommonText.MARKUP_STYLED_TEXT : JRCommonText.MARKUP_NONE);
}
return textElement;
}