public static Element createHorizontalLine( final float y ) { final HorizontalLineElementFactory ef = new HorizontalLineElementFactory(); ef.setX( new Float( 0 ) ); ef.setMinimumWidth( new Float( -100 ) ); ef.setY( new Float( y ) ); ef.setMinimumHeight( new Float( 0 ) ); ef.setShouldDraw( Boolean.TRUE ); ef.setScale( Boolean.TRUE ); return ef.createElement(); }
} else if ( y1 == y2 ) { final HorizontalLineElementFactory elementFactory = new HorizontalLineElementFactory(); elementFactory.setName( name ); elementFactory.setColor( c ); elementFactory.setStroke( stroke ); elementFactory.setX( new Float( bounds.getX() ) ); elementFactory.setY( new Float( bounds.getY() ) ); elementFactory.setMinimumWidth( new Float( bounds.getWidth() ) ); elementFactory.setMinimumHeight( new Float( bounds.getHeight() ) ); elementFactory.setScale( Boolean.TRUE ); elementFactory.setKeepAspectRatio( Boolean.FALSE ); elementFactory.setShouldDraw( Boolean.TRUE ); element = elementFactory.createElement(); } else {
protected void startParsing( final PropertyAttributes atts ) throws SAXException { super.startParsing( atts ); factory.setName( atts.getValue( getUri(), "name" ) ); factory.setScale( Boolean.TRUE ); factory.setKeepAspectRatio( Boolean.FALSE ); factory.setShouldFill( Boolean.FALSE ); factory.setShouldDraw( Boolean.TRUE ); factory.setStroke( ReportParserUtil.parseStroke( atts.getValue( getUri(), "stroke" ), 1 ) ); } }
public HorizontalLineElementReadHandler() { factory = new HorizontalLineElementFactory(); }
/** * Creates a new drawable field element based on the defined properties. * * @return the generated elements * @throws IllegalStateException * if the field name is not set. * @see ElementFactory#createElement() */ public Element createElement() { final Element element = new Element(); applyElementName( element ); applyStyle( element.getStyle() ); element.setElementType( new HorizontalLineType() ); return element; }
public static Element createHorizontalLine( final float y, final Color color, final Stroke stroke ) { final Element element = createHorizontalLine( y ); element.getStyle().setStyleProperty( ElementStyleKeys.PAINT, color ); element.getStyle().setStyleProperty( ElementStyleKeys.STROKE, stroke ); return element; }
final Color c = ReportParserUtil.parseColor( atts.getValue( getUri(), LineReadHandler.COLOR_ATT ) ); final HorizontalLineElementFactory elementFactory = new HorizontalLineElementFactory(); elementFactory.setName( name ); elementFactory.setColor( c ); elementFactory.setStroke( stroke ); elementFactory.setX( new Float( 0 ) ); elementFactory.setY( new Float( y2 ) ); elementFactory.setMinimumWidth( new Float( -100 ) ); elementFactory.setMinimumHeight( new Float( 0 ) ); elementFactory.setShouldDraw( Boolean.TRUE ); element = elementFactory.createElement(); return;