*/
public Object createObject(Attributes atts)
{
JRXmlLoader xmlLoader = (JRXmlLoader)digester.peek(digester.getCount() - 1);
JRDesignElement element = (JRDesignElement)digester.peek();
element.setKey(atts.getValue(JRXmlConstants.ATTRIBUTE_key));
PositionTypeEnum positionType = PositionTypeEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_positionType));
if (positionType != null)
{
element.setPositionType(positionType);
}
StretchTypeEnum stretchType = StretchTypeEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_stretchType));
if (stretchType != null)
{
element.setStretchType(stretchType);
}
String isPrintRepeatedValues = atts.getValue(JRXmlConstants.ATTRIBUTE_isPrintRepeatedValues);
if (isPrintRepeatedValues != null && isPrintRepeatedValues.length() > 0)
{
element.setPrintRepeatedValues(Boolean.valueOf(isPrintRepeatedValues).booleanValue());
}
ModeEnum mode = ModeEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_mode));
if (mode != null)
{
element.setMode(mode);
}
String x = atts.getValue(JRXmlConstants.ATTRIBUTE_x);
if (x != null && x.length() > 0)
{
element.setX(Integer.parseInt(x));
}
String y = atts.getValue(JRXmlConstants.ATTRIBUTE_y);
if (y != null && y.length() > 0)
{
element.setY(Integer.parseInt(y));
}
String width = atts.getValue(JRXmlConstants.ATTRIBUTE_width);
if (width != null && width.length() > 0)
{
element.setWidth(Integer.parseInt(width));
}
String height = atts.getValue(JRXmlConstants.ATTRIBUTE_height);
if (height != null && height.length() > 0)
{
element.setHeight(Integer.parseInt(height));
}
String isRemoveLineWhenBlank = atts.getValue(JRXmlConstants.ATTRIBUTE_isRemoveLineWhenBlank);
if (isRemoveLineWhenBlank != null && isRemoveLineWhenBlank.length() > 0)
{
element.setRemoveLineWhenBlank(Boolean.valueOf(isRemoveLineWhenBlank).booleanValue());
}
String isPrintInFirstWholeBand = atts.getValue(JRXmlConstants.ATTRIBUTE_isPrintInFirstWholeBand);
if (isPrintInFirstWholeBand != null && isPrintInFirstWholeBand.length() > 0)
{
element.setPrintInFirstWholeBand(Boolean.valueOf(isPrintInFirstWholeBand).booleanValue());
}
String isPrintWhenDetailOverflows = atts.getValue(JRXmlConstants.ATTRIBUTE_isPrintWhenDetailOverflows);
if (isPrintWhenDetailOverflows != null && isPrintWhenDetailOverflows.length() > 0)
{
element.setPrintWhenDetailOverflows(Boolean.valueOf(isPrintWhenDetailOverflows).booleanValue());
}
String groupName = atts.getValue(JRXmlConstants.ATTRIBUTE_printWhenGroupChanges);
if (groupName != null)
{
JRDesignGroup group = new JRDesignGroup();
group.setName(groupName);
element.setPrintWhenGroupChanges(group);
xmlLoader.addGroupReprintedElement(element);
}
String forecolor = atts.getValue(JRXmlConstants.ATTRIBUTE_forecolor);
if (forecolor != null && forecolor.length() > 0)
{
element.setForecolor(JRColorUtil.getColor(forecolor, null));
}
String backcolor = atts.getValue(JRXmlConstants.ATTRIBUTE_backcolor);
if (backcolor != null && backcolor.length() > 0)
{
element.setBackcolor(JRColorUtil.getColor(backcolor, null));
}
String styleName = atts.getValue(JRXmlConstants.ATTRIBUTE_style);
if (styleName != null)
{
JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2);
Map stylesMap = jasperDesign.getStylesMap();
if (stylesMap.containsKey(styleName))
{
JRStyle style = (JRStyle) stylesMap.get(styleName);
element.setStyle(style);
}
else
{
element.setStyleNameReference(styleName);
}
}
return element;
}