Package org.foray.fotree.value

Examples of org.foray.fotree.value.DtLengthBPIPDirection


        if (pv.canEvalKeyword()) {
            return new PdBorderSeparation(pv);
        }
        if (pv.canEvalLength()) {
            /* There is only one length. */
            final DtLengthBPIPDirection bpip = new DtLengthBPIPDirection(pv,
                    pv);
            return new PdBorderSeparation(bpip);
        }

        /* The only other valid option is that there are two lengths. */
        final StringTokenizer st = new StringTokenizer(value);
        if (st.countTokens() != 2) {
            throw unexpectedValue(value, fobj);
        }

        final PropertyValue token1 = standardParse(fobj, st.nextToken());
        final PropertyValue token2 = standardParse(fobj, st.nextToken());
        if (token1.canEvalLength()
                && token2.canEvalLength()) {
            final DtLengthBPIPDirection bpip = new DtLengthBPIPDirection(token1,
                    token2);
            return new PdBorderSeparation(bpip);
        }
        throw unexpectedValue(value, fobj);
    }
View Full Code Here


            return pv;
        }
        if (pv.canEvalLength()) {
            /* Wrap it inside the compound data type intended for this
             * purpose.*/
            final DtLengthBPIPDirection bpip = new DtLengthBPIPDirection(
                    DtLength.ZERO_LENGTH, DtLength.ZERO_LENGTH);
            if ("block-progression-direction".equals(subPropertyName)) {
                bpip.setBPDLength(pv);
            } else if ("inline-progression-direction".equals(subPropertyName)) {
                bpip.setIPDLength(pv);
            } else {
                throw unexpectedValue(value, fobj);
            }
            return bpip;
        }
View Full Code Here

            if (keyword == FoValue.INHERIT) {
                return getValueNoInstance(context, axis, fobj);
            }
        }
        if (value() instanceof DtLengthBPIPDirection) {
            final DtLengthBPIPDirection lengthDir = (DtLengthBPIPDirection)
                    value();
            if (axis == RelativeAxis.BLOCK_PROGRESSION) {
                final PropertyValue length = lengthDir.getBPDLength();
                return this.convertValueToLength(length, fobj, context);
            }
            if (axis == RelativeAxis.INLINE_PROGRESSION) {
                final PropertyValue length = lengthDir.getIPDLength();
                return this.convertValueToLength(length, fobj, context);
            }
        }
        throw this.unexpectedRetrieval();
    }
View Full Code Here

            throws PropertyException {
        /* Get the existing property value. */
        if (! (value() instanceof DtLengthBPIPDirection)) {
            return false;
        }
        final DtLengthBPIPDirection lengthDirection =
                (DtLengthBPIPDirection) value();

        /* Parse the attribute. */
        final PropertyValue pv = standardParse(fobj, attributeValue);
        if (pv.canEvalLength()) {
            final String subPropertyName = Property.getSubPropertyName(
                    propertyFullName);
            if ("block-progression-direction".equals(subPropertyName)) {
                lengthDirection.setBPDLength(pv);
                return true;
            }
            if ("inline-progression-direction".equals(subPropertyName)) {
                lengthDirection.setIPDLength(pv);
                return true;
            }
        }
        throw unexpectedValue(attributeValue, fobj);
    }
View Full Code Here

TOP

Related Classes of org.foray.fotree.value.DtLengthBPIPDirection

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.