Package org.foray.fotree.value

Examples of org.foray.fotree.value.PropertyValue


     * @return The parsed, storable property value.
     * @throws PropertyException For an invalid property value.
     */
    private PropertyValue createPropertyValue(final FObj fobj,
            final String value) throws PropertyException {
        PropertyValue pv = standardParse(fobj, value);
        if (pv.canEvalKeyword()) {
            return pv;
        }
        pv = DtFrequency.makeFrequencyDT(value);
        if (pv != null) {
            return pv;
View Full Code Here


     * @return The parsed, storable property value.
     * @throws PropertyException For an invalid property value.
     */
    private PropertyValue createPropertyValue(final FObj fobj,
            final String value) throws PropertyException {
        final PropertyValue pv = standardParse(fobj, value);
        if (pv.canEvalKeyword()) {
            return pv;
        }
        if (pv.canEvalPercentage()
                || pv.canEvalLength()) {
            return new DtLengthRange(true, pv, pv, pv);
        }
        throw unexpectedValue(value, fobj);
    }
View Full Code Here

     */
    public int getValue(final FoContext context, final LengthRange subProperty,
            final FObj fobj) {
        if (value() instanceof DtLengthRange) {
            final DtLengthRange lengthRange = (DtLengthRange) value();
            PropertyValue length = null;
            switch (subProperty) {
            case MINIMUM: {
                length = lengthRange.getLengthMinimum();
                break;
            }
            case OPTIMUM: {
                length = lengthRange.getLengthOptimum();
                break;
            }
            case MAXIMUM: {
                length = lengthRange.getLengthMaximum();
                break;
            }
            default: {
                return 0;
            }
            }
            if (length == null) {
                return 0;
            }
            if (length.canEvalLength()) {
                return length.evalLength(fobj.traitFontSize(context));
            }
            if (length.canEvalPercentage()) {
                final float percent = length.evalPercentage();
                return Math.round(context.ipdAncestorBlockOrRa() * percent
                        / WKConstants.PERCENT_CONVERSION);
            }
            throw this.unexpectedRetrieval();
        }
View Full Code Here

                    PdLeaderLength.DEFAULT_MAXIMUM_COMPONENT;
            lengthRange = new DtLengthRange(true, lengthMin, lengthOpt,
                    lengthMax);
        }

        final PropertyValue pv = standardParse(fobj, value);
        if (! pv.canEvalLength()
                && ! pv.canEvalPercentage()) {
            throw unexpectedValue(value, fobj);
        }
        if (subPropertyName.equals("minimum")) {
            lengthRange.setLengthMinimum(pv);
            return lengthRange;
View Full Code Here

     * @return The parsed, storable property value.
     * @throws PropertyException For an invalid property value.
     */
    private PropertyValue createPropertyValue(final FObj fobj,
            final String value) throws PropertyException {
        final PropertyValue pv = standardParse(fobj, value);
        if (pv.canEvalKeyword()) {
            return pv;
        }
        if (pv.canEvalPercentage()) {
            return pv;
        }
        if (pv instanceof DtLengthRange) {
            return pv;
        }
        if (pv.canEvalLength()) {
            return pv;
        }
        throw unexpectedValue(value, fobj);
    }
View Full Code Here

     */
    public int getValue(final FoContext context, final LengthRange subProperty,
            final FObj fobj) {
        if (value() instanceof DtLengthRange) {
            final DtLengthRange lengthRange = (DtLengthRange) value();
            PropertyValue length = null;
            switch (subProperty) {
            case MINIMUM: {
                length = lengthRange.getLengthMinimum();
                break;
            }
            case OPTIMUM: {
                length = lengthRange.getLengthOptimum();
                break;
            }
            case MAXIMUM: {
                length = lengthRange.getLengthMaximum();
                break;
            }
            default: {
                return FObj.DIMENSION_AUTO;
            }
            }
            if (length == null) {
                return FObj.DIMENSION_AUTO;
            }
            return length.evalLength(fobj.traitFontSize(context));
        }
        if (value().canEvalPercentage()) {

            int base = 0;
            if (this.getRelativeAxis() == RelativeAxis.BLOCK_PROGRESSION) {
View Full Code Here

            throws PropertyException {
        if (! (value() instanceof DtLengthRange)) {
            return false;
        }
        final DtLengthRange lr = (DtLengthRange) value();
        final PropertyValue pv = standardParse(fobj, attributeValue);
        if (! (pv instanceof DtLength)) {
            throw unexpectedValue(attributeValue, fobj);
        }
        final DtLength length = (DtLength) pv;
        final String subPropertyName = getSubPropertyName(propertyFullName);
View Full Code Here

     */
    private PropertyValue createPropertyValue(final FObj fobj,
            final String propertyFullName, final String value)
            throws PropertyException {
        final PropertyCollection collection = new PropertyCollection();
        final PropertyValue pv = checkKeywords(this.getValidKeywords(), value);
        if (pv != null) {
            collection.addItem(new PdFontStyle(pv));
            collection.addItem(new PdFontVariant(pv));
            collection.addItem(new PdFontWeight(pv));
            collection.addItem(new PdFontSize(pv));
View Full Code Here

     * @return The parsed, storable property value.
     * @throws PropertyException For an invalid property value.
     */
    private PropertyValue createPropertyValue(final FObj fobj,
            final String value) throws PropertyException {
        PropertyValue pv = checkKeywords(this.getValidKeywords(), value);
        if (pv != null) {
            return pv;
        }
        pv = DtAngle.makeAngleDT(value);
        if (pv != null) {
View Full Code Here

     * @return The parsed, storable property value.
     * @throws PropertyException For an invalid property value.
     */
    private PropertyValue createPropertyValue(final FObj fobj,
            final String value) throws PropertyException {
        final PropertyValue pv = standardParse(fobj, value);
        if (pv.canEvalKeyword()) {
            return pv;
        }
        if (pv.canEvalPercentage()) {
            return pv;
        }
        if (pv.canEvalLength()) {
            return pv;
        }
        throw unexpectedValue(value, fobj);
    }
View Full Code Here

TOP

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

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.