Package org.apache.fop.fo

Examples of org.apache.fop.fo.PropertyList


        Number d = args[0].getNumber();
        if (d == null) {
            throw new PropertyException("Non numeric operand to "
                    + "proportional-column-width() function.");
        }
        PropertyList pList = pInfo.getPropertyList();
        if (!"fo:table-column".equals(pList.getFObj().getName())) {
            throw new PropertyException("proportional-column-width() function "
                    + "may only be used on fo:table-column.");
        }

        Table t = (Table) pList.getParentFObj();
        if (t.isAutoLayout()) {
            throw new PropertyException("proportional-column-width() function "
                    + "may only be used when fo:table has "
                    + "table-layout=\"fixed\".");
        }
View Full Code Here


     * Bind should be overridden to correctly configure the CommonAccessibility property
     * @throws Exception -
     */
    @Test
    public void bindMustSetRoleAndSourceDoc() throws Exception {
        final PropertyList mockPList = mockPropertyList();
        final FONode parent = FONodeMocks.mockFONode();
        for (Class<? extends CommonAccessibilityHolder> clazz : IMPLEMENTATIONS) {
            Constructor<? extends CommonAccessibilityHolder> constructor
                    = clazz.getConstructor(FONode.class);
            CommonAccessibilityHolder sut = constructor.newInstance(parent);
View Full Code Here

                    sut.getCommonAccessibility().getSourceDocument());
        }
    }

    private PropertyList mockPropertyList() throws PropertyException {
        final PropertyList mockPList = PropertyListMocks.mockPropertyList();
        PropertyListMocks.mockTableProperties(mockPList);
        PropertyListMocks.mockCommonBorderPaddingBackgroundProps(mockPList);
        mockRoleProperty(mockPList);
        mockSourceDocProperty(mockPList);
        return mockPList;
View Full Code Here

    }

    private TableColumn createImplicitColumn(int colNumber)
                    throws FOPException {
        TableColumn implicitColumn = new TableColumn(this, true);
        PropertyList pList = new StaticPropertyList(
                                implicitColumn, this.propList);
        implicitColumn.bind(pList);
        implicitColumn.setColumnWidth(new TableColLength(1.0, implicitColumn));
        implicitColumn.setColumnNumber(colNumber);
        if (!isSeparateBorderModel()) {
View Full Code Here

        g.bind(mockPropertyList());
        assertEquals(altText, g.getAltText());
    }

    private PropertyList mockPropertyList() throws PropertyException {
        PropertyList mockPropertyList = PropertyListMocks.mockPropertyList();
        Property mockAltText = mock(Property.class);
        when(mockAltText.getString()).thenReturn(altText);
        when(mockPropertyList.get(Constants.PR_X_ALT_TEXT)).thenReturn(mockAltText);
        return mockPropertyList;
    }
View Full Code Here

     *
     * @return a mock property list
     */
    public static PropertyList mockPropertyList() {
        try {
            final PropertyList mockPList = mock(PropertyList.class);
            final Property mockGenericProperty = PropertyMocks.mockGenericProperty();
            when(mockPList.get(anyInt())).thenReturn(mockGenericProperty);
            return mockPList;
        } catch (PropertyException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

    }

    private RepeatablePageMasterAlternatives createRepeatablePageMasterAlternatives(
            ConditionalPageMasterReference cpmr, Property maximumRepeats) throws Exception {

        PropertyList pList = mock(PropertyList.class);

        when(pList.get(anyInt())).thenReturn(maximumRepeats);

        PageSequenceMaster parent = mock(PageSequenceMaster.class);
        when(parent.getName()).thenReturn("fo:page-sequence-master");

        RepeatablePageMasterAlternatives sut = new RepeatablePageMasterAlternatives(parent);
View Full Code Here

        if (child != null) {
            FONode newChild = child.clone(newParent, true);
            if (child instanceof FObj) {
                Marker.MarkerPropertyList pList;
                PropertyList newPropertyList = createPropertyListFor(
                            (FObj) newChild, parentPropertyList);

                pList = marker.getPropertyListFor(child);
                newChild.processNode(
                        child.getLocalName(),
View Full Code Here

        Number d = args[0].getNumber();
        if (d == null) {
            throw new PropertyException("Non numeric operand to "
                    + "proportional-column-width() function.");
        }
        PropertyList pList = pInfo.getPropertyList();
        if (!"fo:table-column".equals(pList.getFObj().getName())) {
            throw new PropertyException("proportional-column-width() function "
                    + "may only be used on fo:table-column.");
        }

        Table t = (Table) pList.getParentFObj();
        if (t.isAutoLayout()) {
            throw new PropertyException("proportional-column-width() function "
                    + "may only be used when fo:table has "
                    + "table-layout=\"fixed\".");
        }
View Full Code Here

    public Property eval(Property[] args, PropertyInfo pInfo) throws PropertyException {
        Numeric distance
            = pInfo.getPropertyList()
              .get(Constants.PR_PROVISIONAL_DISTANCE_BETWEEN_STARTS).getNumeric();

        PropertyList pList = pInfo.getPropertyList();
        while (pList != null && !(pList.getFObj() instanceof ListItem)) {
            pList = pList.getParentPropertyList();
        }
        if (pList == null) {
            throw new PropertyException("body-start() called from outside an fo:list-item");
        }

        Numeric startIndent = pList.get(Constants.PR_START_INDENT).getNumeric();

        return (Property) NumericOp.addition(distance, startIndent);
    }
View Full Code Here

TOP

Related Classes of org.apache.fop.fo.PropertyList

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.