Package org.apache.fop.fo.flow

Examples of org.apache.fop.fo.flow.TableBody


     * @param painter
     */
    private void iterateAndPaintPositions(Iterator iterator, RowPainter painter) {
        List lst = new java.util.ArrayList();
        boolean firstPos = false;
        TableBody body = null;
        while (iterator.hasNext()) {
            Position pos = (Position)iterator.next();
            if (pos instanceof TableContentPosition) {
                TableContentPosition tcpos = (TableContentPosition)pos;
                lst.add(tcpos);
View Full Code Here


     */
    private EffRow buildGridRow(List cells, TableRow rowFO) {
        EffRow row = new EffRow(this.fetchIndex, tablePart);
        List gridUnits = row.getGridUnits();

        TableBody bodyFO = null;

        //Create all row-spanned grid units based on information from the previous row
        int colnum = 1;
        GridUnit[] horzSpan = null// Grid units horizontally spanned by a single cell
        if (pendingRowSpans > 0) {
View Full Code Here

                || fo.getNameId() == Constants.FO_TABLE_COLUMN) {
            if (fo.getNameId() == Constants.FO_TABLE_CELL
                    && fo.getParent().getNameId() != Constants.FO_TABLE_ROW
                    && (propertyList.get(Constants.PR_STARTS_ROW).getEnum()
                            == Constants.EN_TRUE)) {
                TableBody parent = (TableBody) fo.getParent();
                if (!parent.previousCellEndedRow()) {
                    parent.resetColumnIndex();
                }
            }
        }
        return NumberProperty.getInstance(
                ((TableFObj) fo.getParent()).getCurrentColumnIndex());
View Full Code Here

   
    private void iterateAndPaintPositions(Iterator iterator, RowPainter painter) {
        List lst = new java.util.ArrayList();
        boolean firstPos = false;
        boolean lastPos = false;
        TableBody body = null;
        while (iterator.hasNext()) {
            Position pos = (Position)iterator.next();
            if (pos instanceof TableContentPosition) {
                TableContentPosition tcpos = (TableContentPosition)pos;
                lst.add(tcpos);
                GridUnitPart part = (GridUnitPart)tcpos.gridUnitParts.get(0);
                if (body == null) {
                    body = part.pgu.getBody();
                }
                if (tcpos.getFlag(TableContentPosition.FIRST_IN_ROWGROUP)
                        && tcpos.row.getFlag(EffRow.FIRST_IN_PART)) {
                    firstPos = true;

                }
                if (tcpos.getFlag(TableContentPosition.LAST_IN_ROWGROUP)
                        && tcpos.row.getFlag(EffRow.LAST_IN_PART)) {
                    lastPos = true;
                    getTableLM().getCurrentPV().addMarkers(body.getMarkers(),
                            true, firstPos, lastPos);
                    int size = lst.size();
                    for (int i = 0; i < size; i++) {
                        painter.handleTableContentPosition((TableContentPosition)lst.get(i));
                    }
                    getTableLM().getCurrentPV().addMarkers(body.getMarkers(),
                            false, firstPos, lastPos);
                    //reset
                    firstPos = false;
                    lastPos = false;
                    body = null;
                    lst.clear();
                }
            } else {
                if (log.isDebugEnabled()) {
                    log.debug("Ignoring position: " + pos);
                }
            }
        }
        if (body != null) {
            getTableLM().getCurrentPV().addMarkers(body.getMarkers(),
                    true, firstPos, lastPos);
            int size = lst.size();
            for (int i = 0; i < size; i++) {
                painter.handleTableContentPosition((TableContentPosition)lst.get(i));
            }
            getTableLM().getCurrentPV().addMarkers(body.getMarkers(),
                    false, firstPos, lastPos);
        }
    }
View Full Code Here

        if (vertical && otherCell != null) {
            otherRow = otherGridUnit.getRow();
        }
       
        //get bodies
        TableBody currentBody = currentGridUnit.getBody();
        TableBody otherBody = null;
        if (otherRow != null) {
            otherBody = otherGridUnit.getBody();
        }

        //get columns
        TableColumn currentColumn = currentGridUnit.getColumn();
        TableColumn otherColumn = null;
        if (otherGridUnit != null) {
            otherColumn = otherGridUnit.getColumn();
        }
       
        //TODO get column groups
       
        //Get table
        Table table = currentGridUnit.getTable();
       
        //----------------------------------------------------------------------
        //We're creating two arrays containing the applicable BorderInfos for
        //each cell in question.
        //0 = cell, 1 = row, 2 = row group (body), 3 = column,
        //4 = col group (spanned column, see 6.7.3), 5 = table

        BorderInfo[] current = new BorderInfo[6];
        BorderInfo[] other = new BorderInfo[6];
        //cell
        current[0] = currentGridUnit.getOriginalBorderInfoForCell(side);
        if (otherGridUnit != null) {
            other[0] = otherGridUnit.getOriginalBorderInfoForCell(otherSide);
        }
        if ((currentRow != null)
                && (side == BEFORE
                    || side == AFTER
                    || (currentGridUnit.getFlag(GridUnit.IN_FIRST_COLUMN) && side == START)
                    || (currentGridUnit.getFlag(GridUnit.IN_LAST_COLUMN) && side == END))) {
            //row
            current[1] = currentRow.getCommonBorderPaddingBackground().getBorderInfo(side);
        }
        if (otherRow != null) {
            //row
            other[1] = otherRow.getCommonBorderPaddingBackground().getBorderInfo(otherSide);
        }
        if (currentBody != null
                && ((side == BEFORE && currentGridUnit.getFlag(GridUnit.FIRST_IN_PART))
                || (side == AFTER && currentGridUnit.getFlag(GridUnit.LAST_IN_PART))
                || (currentGridUnit.getFlag(GridUnit.IN_FIRST_COLUMN) && side == START)
                || (currentGridUnit.getFlag(GridUnit.IN_LAST_COLUMN) && side == END))) {
            //row group (=body, table-header or table-footer)
            current[2] = currentBody.getCommonBorderPaddingBackground().getBorderInfo(side);
        }
        if (otherGridUnit != null
                && otherBody != null
                && ((otherSide == BEFORE && otherGridUnit.getFlag(GridUnit.FIRST_IN_PART))
                    || (otherSide == AFTER && otherGridUnit.getFlag(GridUnit.LAST_IN_PART)))) {
            //row group (=body, table-header or table-footer)
            other[2] = otherBody.getCommonBorderPaddingBackground().getBorderInfo(otherSide);
        }
        if ((side == BEFORE && otherGridUnit == null)
                || (side == AFTER && otherGridUnit == null)
                || (side == START)
                || (side == END)) {
View Full Code Here

     */
    private EffRow buildGridRow(List cells, TableRow rowFO) {
        EffRow row = new EffRow(this.fetchIndex, tablePart);
        List gridUnits = row.getGridUnits();

        TableBody bodyFO = null;

        //Create all row-spanned grid units based on information from the previous row
        int colnum = 1;
        GridUnit[] horzSpan = null// Grid units horizontally spanned by a single cell
        if (pendingRowSpans > 0) {
View Full Code Here

   
    private void iterateAndPaintPositions(Iterator iterator, RowPainter painter) {
        List lst = new java.util.ArrayList();
        boolean firstPos = false;
        boolean lastPos = false;
        TableBody body = null;
        while (iterator.hasNext()) {
            Position pos = (Position)iterator.next();
            if (pos instanceof TableContentPosition) {
                TableContentPosition tcpos = (TableContentPosition)pos;
                lst.add(tcpos);
                GridUnitPart part = (GridUnitPart)tcpos.gridUnitParts.get(0);
                if (body == null) {
                    body = part.pgu.getBody();
                }
                if (tcpos.getFlag(TableContentPosition.FIRST_IN_ROWGROUP)
                        && tcpos.row.getFlag(EffRow.FIRST_IN_BODY)) {
                    firstPos = true;

                }
                if (tcpos.getFlag(TableContentPosition.LAST_IN_ROWGROUP)
                        && tcpos.row.getFlag(EffRow.LAST_IN_BODY)) {
                    lastPos = true;
                    getTableLM().getCurrentPV().addMarkers(body.getMarkers(),
                            true, firstPos, lastPos);
                    int size = lst.size();
                    for (int i = 0; i < size; i++) {
                        painter.handleTableContentPosition((TableContentPosition)lst.get(i));
                    }
                    getTableLM().getCurrentPV().addMarkers(body.getMarkers(),
                            false, firstPos, lastPos);
                    //reset
                    firstPos = false;
                    lastPos = false;
                    body = null;
                    lst.clear();
                }
            } else {
                if (log.isDebugEnabled()) {
                    log.debug("Ignoring position: " + pos);
                }
            }
        }
        if (body != null) {
            getTableLM().getCurrentPV().addMarkers(body.getMarkers(),
                    true, firstPos, lastPos);
            int size = lst.size();
            for (int i = 0; i < size; i++) {
                painter.handleTableContentPosition((TableContentPosition)lst.get(i));
            }
            getTableLM().getCurrentPV().addMarkers(body.getMarkers(),
                    false, firstPos, lastPos);
        }
    }
View Full Code Here

        if (vertical && otherCell != null) {
            otherRow = otherGridUnit.getRow();
        }
       
        //get bodies
        TableBody currentBody = currentGridUnit.getBody();
        TableBody otherBody = null;
        if (otherRow != null) {
            otherBody = otherGridUnit.getBody();
        }

        //get columns
        TableColumn currentColumn = currentGridUnit.getColumn();
        TableColumn otherColumn = null;
        if (otherGridUnit != null) {
            otherColumn = otherGridUnit.getColumn();
        }
       
        //TODO get column groups
       
        //Get table
        Table table = currentGridUnit.getTable();
       
        //----------------------------------------------------------------------
        //We're creating two arrays containing the applicable BorderInfos for
        //each cell in question.
        //0 = cell, 1 = row, 2 = row group (body), 3 = column,
        //4 = col group (spanned column, see 6.7.3), 5 = table

        BorderInfo[] current = new BorderInfo[6];
        BorderInfo[] other = new BorderInfo[6];
        //cell
        current[0] = currentGridUnit.getOriginalBorderInfoForCell(side);
        if (otherGridUnit != null) {
            other[0] = otherGridUnit.getOriginalBorderInfoForCell(otherSide);
        }
        if ((currentRow != null)
                && (side == BEFORE
                    || side == AFTER
                    || (currentGridUnit.getFlag(GridUnit.IN_FIRST_COLUMN) && side == START)
                    || (currentGridUnit.getFlag(GridUnit.IN_LAST_COLUMN) && side == END))) {
            //row
            current[1] = currentRow.getCommonBorderPaddingBackground().getBorderInfo(side);
        }
        if (otherRow != null) {
            //row
            other[1] = otherRow.getCommonBorderPaddingBackground().getBorderInfo(otherSide);
        }
        if (currentBody != null
                && ((side == BEFORE && currentGridUnit.getFlag(GridUnit.FIRST_IN_BODY))
                || (side == AFTER && currentGridUnit.getFlag(GridUnit.LAST_IN_BODY))
                || (currentGridUnit.getFlag(GridUnit.IN_FIRST_COLUMN) && side == START)
                || (currentGridUnit.getFlag(GridUnit.IN_LAST_COLUMN) && side == END))) {
            //row group (=body, table-header or table-footer)
            current[2] = currentBody.getCommonBorderPaddingBackground().getBorderInfo(side);
        }
        if (otherGridUnit != null
                && otherBody != null
                && ((otherSide == BEFORE && otherGridUnit.getFlag(GridUnit.FIRST_IN_BODY))
                    || (otherSide == AFTER && otherGridUnit.getFlag(GridUnit.LAST_IN_BODY)))) {
            //row group (=body, table-header or table-footer)
            other[2] = otherBody.getCommonBorderPaddingBackground().getBorderInfo(otherSide);
        }
        if ((side == BEFORE && otherGridUnit == null)
                || (side == AFTER && otherGridUnit == null)
                || (side == START)
                || (side == END)) {
View Full Code Here

   
    private EffRow buildGridRow(List cells, TableRow rowFO) {
        EffRow row = new EffRow(this.currentRowIndex, type);
        List gridUnits = row.getGridUnits();
       
        TableBody bodyFO = null;
       
        //Create all row-spanned grid units based on information from the last row
        int colnum = 1;
        GridUnit[] horzSpan = null;
        if (pendingRowSpans > 0) {
View Full Code Here

   
    private void iterateAndPaintPositions(Iterator iterator, RowPainter painter) {
        List lst = new java.util.ArrayList();
        boolean firstPos = false;
        boolean lastPos = false;
        TableBody body = null;
        while (iterator.hasNext()) {
            Position pos = (Position)iterator.next();
            if (pos instanceof TableContentPosition) {
                TableContentPosition tcpos = (TableContentPosition)pos;
                lst.add(tcpos);
                GridUnitPart part = (GridUnitPart)tcpos.gridUnitParts.get(0);
                if (body == null) {
                    body = part.pgu.getBody();
                }
                if (tcpos.getFlag(TableContentPosition.FIRST_IN_ROWGROUP)
                        && tcpos.row.getFlag(EffRow.FIRST_IN_BODY)) {
                    firstPos = true;

                }
                if (tcpos.getFlag(TableContentPosition.LAST_IN_ROWGROUP)
                        && tcpos.row.getFlag(EffRow.LAST_IN_BODY)) {
                    lastPos = true;
                    getTableLM().getCurrentPV().addMarkers(body.getMarkers(),
                            true, firstPos, lastPos);
                    int size = lst.size();
                    for (int i = 0; i < size; i++) {
                        painter.handleTableContentPosition((TableContentPosition)lst.get(i));
                    }
                    getTableLM().getCurrentPV().addMarkers(body.getMarkers(),
                            false, firstPos, lastPos);
                    //reset
                    firstPos = false;
                    lastPos = false;
                    body = null;
                    lst.clear();
                }
            } else {
                if (log.isDebugEnabled()) {
                    log.debug("Ignoring position: " + pos);
                }
            }
        }
        if (body != null) {
            getTableLM().getCurrentPV().addMarkers(body.getMarkers(),
                    true, firstPos, lastPos);
            int size = lst.size();
            for (int i = 0; i < size; i++) {
                painter.handleTableContentPosition((TableContentPosition)lst.get(i));
            }
            getTableLM().getCurrentPV().addMarkers(body.getMarkers(),
                    false, firstPos, lastPos);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.fop.fo.flow.TableBody

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.