Package org.uguess.birt.report.engine.layout.wrapper

Examples of org.uguess.birt.report.engine.layout.wrapper.Frame


     * @param data
     * @return
     */
    protected Frame locateChildFrame(Frame parentFrame, Object data) {
        for (Iterator<Frame> itr = parentFrame.iterator(); itr.hasNext();) {
            Frame fr = itr.next();

            if (fr.getData() == data) {
                return fr;
            }

            Frame cfr = locateChildFrame(fr, data);
            if (cfr != null) {
                return cfr;
            }
        }

View Full Code Here


    }

    private void layoutChildren(List<Integer> xCuts, List<Integer> yCuts,
            Sheet sheet, Cell defaultCell, Frame parentElement,
            IStyle currentStyle, int xOffset, int yOffset) {
        Frame element = null;
        Coordinate coord = null;
        IStyle style = null;

        for (Iterator<Frame> it = parentElement.iterator(); it.hasNext();) {
            element = it.next();

            coord = getElementCoords(xCuts,
                    yCuts,
                    element,
                    xOffset,
                    yOffset,
                    sheet,
                    defaultCell);
            if (coord != null && element.getData() instanceof PageArea) {
                sheet.setRowBreak(coord.y2);
            }     
            if (coord == null) {
                continue;
            }

            style = StyleImpl.create(new IStyle[]{
                        element.getStyle(), currentStyle
                    });

            if (hasChildren(element)) {

                layoutChildren(xCuts,
                        yCuts,
                        sheet,
                        defaultCell,
                        element,
                        style,
                        xOffset,
                        yOffset);

                setParentsStyle(sheet, defaultCell, coord, style);
            } else {
                Cell cell = sheet.getCell(coord.y1, coord.x1, false);
                Object data = element.getData();
                if (coord.x1 == coord.x2 && coord.y1 == coord.y2) {
                    // A single cell case.
                    if (cell != defaultCell) {
                        logger.log(Level.WARNING, "[WARNING]:An existing single cell detected"); //$NON-NLS-1$
                    }
View Full Code Here

    public void startContainer(IContainerArea container) {
        buildFrame(container, true);
    }

    public void endContainer(IContainerArea containerArea) {
        Frame currentFrame = frameStack.pop();

        if (currentFrame.getData() instanceof PageArea) {
            exportFrame(currentFrame);
        }
    }
View Full Code Here

                PageArea pa = (PageArea) currentFrame.getData();
                IContainerArea body = pa.getBody();

                // locate body frame first
                Frame bodyFrame = locateChildFrame(currentFrame, body);

                if (bodyFrame instanceof AreaFrame) {
                    // adjust offsets
                    ((AreaFrame) bodyFrame).setXOffset(-bodyFrame.getLeft());
                    ((AreaFrame) bodyFrame).setYOffset(-bodyFrame.getTop());
                }

                if (exportSingleSheet) {
                    // aggregate only
                    if (singleContainer == null) {
                        singleContainer = new AggregateFrame();
                        singleContainer.setRight(bodyFrame.getRight() - bodyFrame.getLeft());
                        singleContainer.setBottom(bodyFrame.getBottom() - bodyFrame.getTop());
                    } else {
                        int yOff = singleContainer.getBottom();
                        singleContainer.setBottom(yOff + bodyFrame.getBottom() - bodyFrame.getTop());

                        if (bodyFrame instanceof AreaFrame) {
                            ((AreaFrame) bodyFrame).setYOffset(yOff + ((AreaFrame) bodyFrame).getYOffset());
                        }
                    }

                    singleContainer.addChild(bodyFrame);
                    if (bodyFrame instanceof AreaFrame) {
                        ((AreaFrame) bodyFrame).setParent(singleContainer);
                    }

                    if (DEBUG) {
                        logger.log(Level.INFO, "------------aggregate sheet[" //$NON-NLS-1$
                                + (currentPageIndex) + "] using " //$NON-NLS-1$
                                + (System.currentTimeMillis() - span) + " ms"); //$NON-NLS-1$
                    }
                } else if (aggregateOnFirstLevel) {
                    // aggregate only
                    singleContainer = multiPageContainer.get(AggregateFinder.get().getPageNum());
                    if (singleContainer == null) {
                        singleContainer = new AggregateFrame();
                        singleContainer.setRight(bodyFrame.getRight() - bodyFrame.getLeft());
                        singleContainer.setBottom(bodyFrame.getBottom() - bodyFrame.getTop());
                        multiPageContainer.put(new Integer(AggregateFinder.get().getPageNum()), singleContainer);
                    } else {
                        int yOff = singleContainer.getBottom();
                        singleContainer.setBottom(yOff + bodyFrame.getBottom() - bodyFrame.getTop());

                        if (bodyFrame instanceof AreaFrame) {
                            ((AreaFrame) bodyFrame).setYOffset(yOff + ((AreaFrame) bodyFrame).getYOffset());
                        }
                    }
View Full Code Here

            //clipStack.pop();
        }

        areaStack.pop();

        Frame currentFrame = frameStack.peek();

        IArea area = unWrap(currentFrame.getData());

        if (area != containerArea) {
            return;
        }
View Full Code Here

    }

    @Override
    protected Frame locateChildFrame(Frame parentFrame, Object data) {
        for (Iterator<Frame> itr = parentFrame.iterator(); itr.hasNext();) {
            Frame fr = itr.next();

            if (unWrap(fr.getData()) == data) {
                return fr;
            }

            Frame cfr = locateChildFrame(fr, data);
            if (cfr != null) {
                return cfr;
            }
        }
View Full Code Here

TOP

Related Classes of org.uguess.birt.report.engine.layout.wrapper.Frame

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.