/** * Creates a new TextElement without any additional filtering. * * @param name the name of the new element * @param bounds the bounds of the new element * @param paint the text color of this text element * @param alignment the horizontal text alignment. * @param valign the vertical alignment. * @param font the font for this element * @param nullString the text used when the value of this element is null * @param field the field in the datamodel to retrieve values from * @return a report element for displaying <code>String</code> objects. * @throws NullPointerException if bounds, name or function are null * @throws IllegalArgumentException if the given alignment is invalid * @deprecated Use a more fine-grained approach to define this element by using the * element-factory directly. */ public static Element createStringElement( final String name, final Rectangle2D bounds, final Color paint, final ElementAlignment alignment, final ElementAlignment valign, final FontDefinition font, final String nullString, final String field) { final TextFieldElementFactory factory = new TextFieldElementFactory(); factory.setX(new Float(bounds.getX())); factory.setY(new Float(bounds.getY())); factory.setMinimumWidth(new Float(bounds.getWidth())); factory.setMinimumHeight(new Float(bounds.getHeight())); factory.setName(name); factory.setColor(paint); factory.setHorizontalAlignment(alignment); factory.setVerticalAlignment(valign); if (font != null) { factory.setFontName(font.getFontName()); factory.setFontSize(new Integer(font.getFontSize())); factory.setBold(ElementFactory.getBooleanValue(font.isBold())); factory.setItalic(ElementFactory.getBooleanValue(font.isItalic())); factory.setEncoding(font.getFontEncoding(null)); factory.setUnderline(ElementFactory.getBooleanValue(font.isUnderline())); factory.setStrikethrough(ElementFactory.getBooleanValue(font.isStrikeThrough())); factory.setEmbedFont(ElementFactory.getBooleanValue(font.isEmbeddedFont())); } factory.setFieldname(field); factory.setNullString(nullString); return factory.createElement(); }