Package org.foray.fotree.value

Examples of org.foray.fotree.value.DtPercentage


            break;

        case TOK_PERCENT:
            final double pcval = new Double(getCurrentTokenValue().substring(0,
                    getCurrentTokenValue().length() - 1)).doubleValue();
            prop = new DtPercentage((float) pcval);
            break;

        case TOK_NUMERIC:
            // A number plus a valid unit name.
            final int numLen = getCurrentTokenValue().length()
View Full Code Here


            throws PropertyException {
        DtLengthRange lengthRange = inputLengthRange;
        if (lengthRange == null) {
            final DtLength lengthMin = DtLength.ZERO_LENGTH;
            final DtLength lengthOpt = PdLeaderLength.DEFAULT_OPTIMUM_COMPONENT;
            final DtPercentage lengthMax =
                    PdLeaderLength.DEFAULT_MAXIMUM_COMPONENT;
            lengthRange = new DtLengthRange(true, lengthMin, lengthOpt,
                    lengthMax);
        }
View Full Code Here

        }
        final DtLength length = DtLength.makeLengthDT(input);
        if (length != null) {
            return FoProperty.FONT_SIZE;
        }
        final DtPercentage percentage = DtPercentage.makePercentageDT(input);
        if (percentage != null) {
            return FoProperty.FONT_SIZE;
        }
        return FoProperty.FONT_FAMILY;
    }
View Full Code Here

     * @return The value of this property.
     */
    public int getValue(final FoContext context, final FObj fobj) {
        if (value().canEvalPercentage()) {
            final int base = context.ipdAncestorBlockArea();
            final DtPercentage percentageDT = (DtPercentage) value();
            final float percentage = percentageDT.getValue();
            return Math.round(percentage * base /
                    WKConstants.PERCENT_CONVERSION);
        }
        if (value().canEvalLength()) {
            return this.convertValueToLength(value(), fobj, context);
View Full Code Here

        }
        final DtLength length = DtLength.makeLengthDT(input);
        if (length != null) {
            return FoProperty.BACKGROUND_POSITION;
        }
        final DtPercentage percentage = DtPercentage.makePercentageDT(input);
        if (percentage != null) {
            return FoProperty.BACKGROUND_POSITION;
        }
        return null;
    }
View Full Code Here

TOP

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

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.