Package org.apache.fop.fo.flow

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


    /** @return true, if element <code>node</code> has border. */
    private static boolean hasBorder(FONode node) {
        while (node != null) {
            CommonBorderPaddingBackground commonBorderPaddingBackground = null;
            if (node instanceof Block) {
                Block block = (Block) node;
                commonBorderPaddingBackground = block.getCommonBorderPaddingBackground();
            } else if (node instanceof BlockContainer) {
                BlockContainer container = (BlockContainer) node;
                commonBorderPaddingBackground = container.getCommonBorderPaddingBackground();
            }

View Full Code Here


    /** @return true, if element <code>node</code> has border. */
    private static boolean hasBorder(FONode node) {
        while (node != null) {
            CommonBorderPaddingBackground commonBorderPaddingBackground = null;
            if (node instanceof Block) {
                Block block = (Block) node;
                commonBorderPaddingBackground = block.getCommonBorderPaddingBackground();
            } else if (node instanceof BlockContainer) {
                BlockContainer container = (BlockContainer) node;
                commonBorderPaddingBackground = container.getCommonBorderPaddingBackground();
            }

View Full Code Here

     * @param nextChild the node that will be added to the list
     *                  after firstTextNode
     */
    public void handleWhiteSpace(FObjMixed fo, FONode firstTextNode, FONode nextChild) {
       
        Block currentBlock = null;
        int foId = fo.getNameId();
       
        if (foId == Constants.FO_BLOCK) {
            currentBlock = (Block) fo;
            if (nestedBlockStack.isEmpty() || fo != nestedBlockStack.peek()) {
                if (nextChild != null) {
                    /* if already in a block, push the current block
                     * onto the stack of nested blocks
                     */
                    nestedBlockStack.push(currentBlock);
                }
            } else {
                if (nextChild == null) {
                    nestedBlockStack.pop();
                }
            }
        } else if (foId == Constants.FO_RETRIEVE_MARKER) {
            /* look for the nearest block ancestor, if any */
            FONode ancestor = fo;
            do {
                ancestor = ancestor.getParent();
            } while (ancestor.getNameId() != Constants.FO_BLOCK
                    && ancestor.getNameId() != Constants.FO_STATIC_CONTENT);
           
            if (ancestor.getNameId() == Constants.FO_BLOCK) {
                currentBlock = (Block) ancestor;
            }
        } else if (!nestedBlockStack.isEmpty()) {
            currentBlock = (Block) nestedBlockStack.peek();
        }
       
        if (currentBlock != null) {
            linefeedTreatment = currentBlock.getLinefeedTreatment();
            whiteSpaceCollapse = currentBlock.getWhitespaceCollapse();
            whiteSpaceTreatment = currentBlock.getWhitespaceTreatment();
        } else {
            linefeedTreatment = Constants.EN_TREAT_AS_SPACE;
            whiteSpaceCollapse = Constants.EN_TRUE;
            whiteSpaceTreatment = Constants.EN_IGNORE_IF_SURROUNDING_LINEFEED;
        }
View Full Code Here

    /** @return true, if element <code>node</code> has border. */
    private static boolean hasBorder(FONode node) {
        while (node != null) {
            CommonBorderPaddingBackground commonBorderPaddingBackground = null;
            if (node instanceof Block) {
                Block block = (Block) node;
                commonBorderPaddingBackground = block.getCommonBorderPaddingBackground();
            } else if (node instanceof BlockContainer) {
                BlockContainer container = (BlockContainer) node;
                commonBorderPaddingBackground = container.getCommonBorderPaddingBackground();
            }

View Full Code Here

    /** @return true, if element <code>node</code> has border. */
    private static boolean hasBorder(FONode node) {
        while (node != null) {
            CommonBorderPaddingBackground commonBorderPaddingBackground = null;
            if (node instanceof Block) {
                Block block = (Block) node;
                commonBorderPaddingBackground = block.getCommonBorderPaddingBackground();
            } else if (node instanceof BlockContainer) {
                BlockContainer container = (BlockContainer) node;
                commonBorderPaddingBackground = container.getCommonBorderPaddingBackground();
            }

View Full Code Here

     */
    public void handleWhiteSpace(FObjMixed fo,
                                 FONode firstTextNode,
                                 FONode nextChild) {

        Block currentBlock = null;
        int foId = fo.getNameId();

        /* set the current block */
        switch (foId) {
            case Constants.FO_BLOCK:
                currentBlock = (Block) fo;
                if (nestedBlockStack.empty() || fo != nestedBlockStack.peek()) {
                    if (nextChild != null) {
                        /* if already in a block, push the current block
                         * onto the stack of nested blocks
                         */
                        nestedBlockStack.push(currentBlock);
                    }
                } else {
                    if (nextChild == null) {
                        nestedBlockStack.pop();
                    }
                }
                break;

            case Constants.FO_RETRIEVE_MARKER:
                /* look for the nearest block ancestor, if any */
                FONode ancestor = fo;
                do {
                    ancestor = ancestor.getParent();
                } while (ancestor.getNameId() != Constants.FO_BLOCK
                        && ancestor.getNameId() != Constants.FO_STATIC_CONTENT);

                if (ancestor.getNameId() == Constants.FO_BLOCK) {
                    currentBlock = (Block) ancestor;
                    nestedBlockStack.push(currentBlock);
                }
                break;

            default:
                if (!nestedBlockStack.empty()) {
                    currentBlock = (Block) nestedBlockStack.peek();
                }
        }

        if (currentBlock != null) {
            linefeedTreatment = currentBlock.getLinefeedTreatment();
            whiteSpaceCollapse = currentBlock.getWhitespaceCollapse();
            whiteSpaceTreatment = currentBlock.getWhitespaceTreatment();
        } else {
            linefeedTreatment = Constants.EN_TREAT_AS_SPACE;
            whiteSpaceCollapse = Constants.EN_TRUE;
            whiteSpaceTreatment = Constants.EN_IGNORE_IF_SURROUNDING_LINEFEED;
        }
View Full Code Here

    /** @return true, if element <code>node</code> has border. */
    private static boolean hasBorder(FONode node) {
        while (node != null) {
            CommonBorderPaddingBackground commonBorderPaddingBackground = null;
            if (node instanceof Block) {
                Block block = (Block) node;
                commonBorderPaddingBackground = block.getCommonBorderPaddingBackground();
            } else if (node instanceof BlockContainer) {
                BlockContainer container = (BlockContainer) node;
                commonBorderPaddingBackground = container.getCommonBorderPaddingBackground();
            }

View Full Code Here

     */
    public void handleWhiteSpace(FObjMixed fo,
                                 FONode firstTextNode,
                                 FONode nextChild) {

        Block currentBlock = null;
        int foId = fo.getNameId();

        /* set the current block */
        switch (foId) {
            case Constants.FO_BLOCK:
                currentBlock = (Block) fo;
                if (nestedBlockStack.empty() || fo != nestedBlockStack.peek()) {
                    if (nextChild != null) {
                        /* if already in a block, push the current block
                         * onto the stack of nested blocks
                         */
                        nestedBlockStack.push(currentBlock);
                    }
                } else {
                    if (nextChild == null) {
                        nestedBlockStack.pop();
                    }
                }
                break;

            case Constants.FO_RETRIEVE_MARKER:
                /* look for the nearest block ancestor, if any */
                FONode ancestor = fo;
                do {
                    ancestor = ancestor.getParent();
                } while (ancestor.getNameId() != Constants.FO_BLOCK
                        && ancestor.getNameId() != Constants.FO_STATIC_CONTENT);

                if (ancestor.getNameId() == Constants.FO_BLOCK) {
                    currentBlock = (Block) ancestor;
                    nestedBlockStack.push(currentBlock);
                }
                break;

            default:
                if (!nestedBlockStack.empty()) {
                    currentBlock = (Block) nestedBlockStack.peek();
                }
        }

        if (currentBlock != null) {
            linefeedTreatment = currentBlock.getLinefeedTreatment();
            whiteSpaceCollapse = currentBlock.getWhitespaceCollapse();
            whiteSpaceTreatment = currentBlock.getWhitespaceTreatment();
        } else {
            linefeedTreatment = Constants.EN_TREAT_AS_SPACE;
            whiteSpaceCollapse = Constants.EN_TRUE;
            whiteSpaceTreatment = Constants.EN_IGNORE_IF_SURROUNDING_LINEFEED;
        }
View Full Code Here

    /** @return true, if element <code>node</code> has border. */
    private static boolean hasBorder(FONode node) {
        while (node != null) {
            CommonBorderPaddingBackground commonBorderPaddingBackground = null;
            if (node instanceof Block) {
                Block block = (Block) node;
                commonBorderPaddingBackground = block.getCommonBorderPaddingBackground();
            } else if (node instanceof BlockContainer) {
                BlockContainer container = (BlockContainer) node;
                commonBorderPaddingBackground = container.getCommonBorderPaddingBackground();
            }

View Full Code Here

    /** @return true, if element <code>node</code> has border. */
    private static boolean hasBorder(FONode node) {
        while (node != null) {
            CommonBorderPaddingBackground commonBorderPaddingBackground = null;
            if (node instanceof Block) {
                Block block = (Block) node;
                commonBorderPaddingBackground = block.getCommonBorderPaddingBackground();
            } else if (node instanceof BlockContainer) {
                BlockContainer container = (BlockContainer) node;
                commonBorderPaddingBackground = container.getCommonBorderPaddingBackground();
            }

View Full Code Here

TOP

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

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.