Package org.foray.fotree.value

Examples of org.foray.fotree.value.DtSpace


                return pv;
            }
            }
        }
        if (pv.canEvalLength()) {
            return new DtSpace(pv, pv, pv, FoValue.DISCARD,
                    new DtInteger(0));
        }
        throw unexpectedValue(value, fobj);
    }
View Full Code Here


     */
    private PropertyValue createPropertyValueSpace(
            final FObj fobj,
            final String value, final String subPropertyName,
            final String propertyFullName) throws PropertyException {
        final DtSpace spaceDT = createOrAddSpace(null, fobj, value,
                subPropertyName, propertyFullName);
        if (spaceDT != null) {
            return spaceDT;
        }
        throw unexpectedValue(value, fobj);
View Full Code Here

     * @return The value of this property.
     */
    public int getValue(final FoContext context,
            final LengthRange subProperty, final FObj fobj) {
        if (value() instanceof DtSpace) {
            final DtSpace spaceDT = (DtSpace) value();
            switch (subProperty) {
            case MINIMUM: {
                return spaceDT.getLengthMinimum(fobj.traitFontSize(context));
            }
            case OPTIMUM: {
                return spaceDT.getLengthOptimum(fobj.traitFontSize(context));
            }
            case MAXIMUM: {
                return spaceDT.getLengthMaximum(fobj.traitFontSize(context));
            }
            default: {
                return 0;
            }
            }
View Full Code Here

     * Returns the conditionality component of this property.
     * @return The conditionality component.
     */
    public Conditionality getConditionality() {
        if (value() instanceof DtSpace) {
            final DtSpace spaceDT = (DtSpace) value();
            return spaceDT.getConditionality();
        }
        return getConditionalityNoInstance();
    }
View Full Code Here

     * Returns the precedence component of this property.
     * @return The precedence component.
     */
    public int getPrecedence() {
        if (value() instanceof DtSpace) {
            final DtSpace spaceDT = (DtSpace) value();
            return spaceDT.getPrecedence();
        }
        return getPrecedenceNoInstance();
    }
View Full Code Here

            final String propertyFullName, final String attributeValue)
            throws PropertyException {
        if (! (value() instanceof DtSpace)) {
            return false;
        }
        DtSpace spaceDT = (DtSpace) value();
        final String subPropertyName = Property.getSubPropertyName(
                propertyFullName);
        spaceDT = createOrAddSpace(spaceDT, fobj, attributeValue,
                subPropertyName, propertyFullName);
        return true;
View Full Code Here

     */
    private DtSpace createOrAddSpace(final DtSpace inputSpaceDT,
            final FObj fobj,
            final String value, final String subPropertyName,
            final String propertyFullName) throws PropertyException {
        DtSpace spaceDT = inputSpaceDT;
        if (spaceDT == null) {
            final DtLength length = DtLength.makeLengthDT("0pt");
            spaceDT = new DtSpace(length, length, length,
                    FoValue.DISCARD, new DtInteger(0));
        }
        final PropertyValue pv = this.standardParse(fobj, value, null);
        if (pv.canEvalLength()) {
            final boolean componentAdded = spaceDT.addComponent(subPropertyName,
                    pv);
            if (! componentAdded) {
                throw unexpectedValue(value, fobj);
            }
        }
View Full Code Here

     */
    private PropertyValue createPropertyValueSpace(
            final FObj fobj,
            final String value, final String subPropertyName,
            final String propertyFullName) throws PropertyException {
        final DtSpace spaceDT = createOrAddSpace(null, fobj, value,
                subPropertyName, propertyFullName);
        if (spaceDT != null) {
            return spaceDT;
        }
        throw unexpectedValue(value, fobj);
View Full Code Here

     * @return The value of this property.
     */
    public int getValue(final FoContext context, final LengthRange subProperty,
            final FObj fobj) {
        if (value() instanceof DtSpace) {
            final DtSpace spaceDT = (DtSpace) value();
            switch (subProperty) {
            case MINIMUM: {
                return spaceDT.getLengthMinimum(fobj.traitFontSize(context));
            }
            case OPTIMUM: {
                return spaceDT.getLengthOptimum(fobj.traitFontSize(context));
            }
            case MAXIMUM: {
                return spaceDT.getLengthMaximum(fobj.traitFontSize(context));
            }
            default: {
                return 0;
            }
            }
View Full Code Here

     * Returns the conditionality component of this property.
     * @return The conditionality component.
     */
    public Conditionality getConditionality() {
        if (value() instanceof DtSpace) {
            final DtSpace spaceDT = (DtSpace) value();
            return spaceDT.getConditionality();
        }
        return getConditionalityNoInstance();
    }
View Full Code Here

TOP

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

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.