/** * Returns, whether the page layout manager should perform a pagebreak before this page is printed. This will have no * effect on empty pages or if the band is no root-level band. * * @return true, if to force a pagebreak before this band is printed, false otherwise */ public boolean isPagebreakBeforePrint() { return getStyle().getBooleanStyleProperty( BandStyleKeys.PAGEBREAK_BEFORE ); }
private void configureBand( final javax.swing.text.Element textElement, final Band band ) { if ( "paragraph".equals( textElement.getName() ) || "section".equals( textElement.getName() ) ) { band.getStyle().setStyleProperty( BandStyleKeys.LAYOUT, "block" ); band.getStyle().setStyleProperty( ElementStyleKeys.MIN_WIDTH, new Float( -100 ) ); } else { band.getStyle().setStyleProperty( BandStyleKeys.LAYOUT, "inline" ); } } }
/** * Defines, whether the page layout manager should perform a pagebreak before this page is printed. This will have no * effect on empty pages or if the band is no root-level band. * * @param pagebreakAfterPrint * set to true, if to force a pagebreak before this band is printed, false otherwise */ public void setPagebreakAfterPrint( final boolean pagebreakAfterPrint ) { getStyle().setBooleanStyleProperty( BandStyleKeys.PAGEBREAK_AFTER, pagebreakAfterPrint ); notifyNodePropertiesChanged(); }
/** * Returns the created band or the band that has been specified for configuration. * * @return the band. */ public Element createElement() { applyElementName( band ); applyStyle( band.getStyle() ); return band; } }
/** * Defines, whether the page layout manager should perform a pagebreak before this page is printed. This will have no * effect on empty pages or if the band is no root-level band. * * @param pagebreakBeforePrint * set to true, if to force a pagebreak before this band is printed, false otherwise */ public void setPagebreakBeforePrint( final boolean pagebreakBeforePrint ) { getStyle().setBooleanStyleProperty( BandStyleKeys.PAGEBREAK_BEFORE, pagebreakBeforePrint ); notifyNodePropertiesChanged(); }
public static Band createTable( final TableLayout tableLayout ) { final Band b = new Band(); b.getStyle().setStyleProperty( BandStyleKeys.LAYOUT, BandStyleKeys.LAYOUT_TABLE ); b.getStyle().setStyleProperty( ElementStyleKeys.INVISIBLE_CONSUMES_SPACE, true ); b.getStyle().setStyleProperty( BandStyleKeys.TABLE_LAYOUT, tableLayout ); final StyleResolver resolver = new SimpleStyleResolver(); final ResolverStyleSheet resolverTarget = new ResolverStyleSheet(); resolver.resolve( b, resolverTarget ); b.setComputedStyle( new SimpleStyleSheet( resolverTarget ) ); return b; }
private void handleHeight( final PropertyAttributes attr ) throws ParseException { final String height = attr.getValue( getUri(), RootLevelBandReadHandler.HEIGHT_ATTRIBUTE ); if ( height != null ) { final float heightValue = ParserUtil.parseFloat( height, "Height is invalid.", getLocator() ); getBand().getStyle().setStyleProperty( ElementStyleKeys.MIN_HEIGHT, new Float( heightValue ) ); } }
public static Band createRow( final Element... boxes ) { final Band tableRow = new Band(); tableRow.getStyle().setStyleProperty( BandStyleKeys.LAYOUT, BandStyleKeys.LAYOUT_TABLE_ROW ); tableRow.getStyle().setStyleProperty( ElementStyleKeys.MIN_WIDTH, 100f ); tableRow.getStyle().setStyleProperty( ElementStyleKeys.MIN_HEIGHT, 200f ); for ( int i = 0; i < boxes.length; i++ ) { tableRow.addElement( boxes[i] ); } return tableRow; }
private void handleFixedPosition( final PropertyAttributes attr ) throws SAXException { final String fixedPos = attr.getValue( getUri(), RootLevelBandReadHandler.FIXED_POSITION_ATTRIBUTE ); if ( fixedPos != null ) { final float fixedPosValue = ParserUtil.parseFloat( fixedPos, "FixedPosition is invalid!", getLocator() ); getBand().getStyle().setStyleProperty( BandStyleKeys.FIXED_POSITION, new Float( fixedPosValue ) ); } }
private void handlePagebreakAttr( final PropertyAttributes attr ) throws SAXException { final String ownPageAttr = attr.getValue( getUri(), "pagebreak" ); if ( ownPageAttr != null ) { GroupFooterReadHandler.logger.warn( "The 'pagebreak' attribute of the <group-footer> tag is deprecated. " + "Use the 'pagebreak-after' attribute instead." ); final Boolean ownPage = ParserUtil.parseBoolean( ownPageAttr, getLocator() ); getBand().getStyle().setStyleProperty( BandStyleKeys.PAGEBREAK_AFTER, ownPage ); } } }
private void handlePagebreakAttr( final PropertyAttributes attr ) throws SAXException { final String ownPageAttr = attr.getValue( getUri(), "pagebreak" ); if ( ownPageAttr != null ) { GroupHeaderReadHandler.logger.warn( "The 'pagebreak' attribute of the <group-header> tag is deprecated. " + "Use the 'pagebreak-before' attribute instead." ); final Boolean ownPage = ParserUtil.parseBoolean( ownPageAttr, getLocator() ); getBand().getStyle().setStyleProperty( BandStyleKeys.PAGEBREAK_BEFORE, ownPage ); } } }
public static Band createCell( final float width, final float height, final int rowSpan, final int colSpan ) { final Band tableCell = new Band(); tableCell.getStyle().setStyleProperty( BandStyleKeys.LAYOUT, BandStyleKeys.LAYOUT_TABLE_CELL ); tableCell.getStyle().setStyleProperty( ElementStyleKeys.MIN_WIDTH, width ); tableCell.getStyle().setStyleProperty( ElementStyleKeys.MIN_HEIGHT, height ); tableCell.setAttribute( AttributeNames.Table.NAMESPACE, AttributeNames.Table.ROWSPAN, rowSpan ); tableCell.setAttribute( AttributeNames.Table.NAMESPACE, AttributeNames.Table.COLSPAN, colSpan ); return tableCell; } }
public static Band createCell( final Element dataItem, final int rowSpan, final int colSpan ) { final Band tableCell = new Band(); tableCell.getStyle().setStyleProperty( BandStyleKeys.LAYOUT, BandStyleKeys.LAYOUT_TABLE_CELL ); tableCell.getStyle().setStyleProperty( ElementStyleKeys.MIN_WIDTH, 150f ); tableCell.getStyle().setStyleProperty( ElementStyleKeys.MIN_HEIGHT, 200f ); tableCell.setAttribute( AttributeNames.Table.NAMESPACE, AttributeNames.Table.ROWSPAN, rowSpan ); tableCell.setAttribute( AttributeNames.Table.NAMESPACE, AttributeNames.Table.COLSPAN, colSpan ); tableCell.addElement( dataItem ); return tableCell; }
private void handleRepeat( final PropertyAttributes attr ) throws SAXException { final String repeat = attr.getValue( getUri(), "repeat" ); final Boolean repeatVal = ParserUtil.parseBoolean( repeat, getLocator() ); getBand().getStyle().setStyleProperty( BandStyleKeys.REPEAT_HEADER, repeatVal ); }
private void handleOnLastPage( final PropertyAttributes attr ) throws SAXException { final String breakBeforeAttr = attr.getValue( getUri(), PageBandReadHandler.ON_LAST_PAGE_ATTR ); final Boolean breakBefore = ParserUtil.parseBoolean( breakBeforeAttr, getLocator() ); getBand().getStyle().setStyleProperty( BandStyleKeys.DISPLAY_ON_LASTPAGE, breakBefore ); } }
private void handleBreakBefore( final PropertyAttributes attr ) throws SAXException { final String breakBeforeAttr = attr.getValue( getUri(), RootLevelBandReadHandler.PAGEBREAK_BEFORE_ATTR ); final Boolean breakBefore = ParserUtil.parseBoolean( breakBeforeAttr, getLocator() ); getBand().getStyle().setStyleProperty( BandStyleKeys.PAGEBREAK_BEFORE, breakBefore ); }
private void handleBreakAfter( final PropertyAttributes attr ) throws SAXException { final String breakAfterAttr = attr.getValue( getUri(), RootLevelBandReadHandler.PAGEBREAK_AFTER_ATTRIBUTE ); if ( breakAfterAttr != null ) { final Boolean breakAfter = ParserUtil.parseBoolean( breakAfterAttr, getLocator() ); getBand().getStyle().setStyleProperty( BandStyleKeys.PAGEBREAK_AFTER, breakAfter ); } }
private void handleSticky( final PropertyAttributes attr ) throws SAXException { final String repeat = attr.getValue( getUri(), "sticky" ); final Boolean repeatVal = ParserUtil.parseBoolean( repeat, getLocator() ); getBand().getStyle().setStyleProperty( BandStyleKeys.STICKY, repeatVal ); }
private void handleSticky( final PropertyAttributes attr ) throws SAXException { final String repeat = attr.getValue( getUri(), "sticky" ); final Boolean repeatVal = ParserUtil.parseBoolean( repeat, getLocator() ); getBand().getStyle().setStyleProperty( BandStyleKeys.STICKY, repeatVal ); }
public static Band createAutoBox( final Element... boxes ) { final Band tableRow = new Band(); tableRow.getStyle().setStyleProperty( BandStyleKeys.LAYOUT, BandStyleKeys.LAYOUT_AUTO ); for ( int i = 0; i < boxes.length; i++ ) { tableRow.addElement( boxes[i] ); } return tableRow; }