Package org.thechiselgroup.choosel.core.client.util.math

Examples of org.thechiselgroup.choosel.core.client.util.math.NumberArray


        return calculation.calculate(toNumberArray(viewItem
                .getResources(subset)));
    }

    private NumberArray toNumberArray(LightweightCollection<Resource> resources) {
        NumberArray numberArray = MathUtils.createNumberArray();

        for (Resource resource : resources) {
            // TODO, what happens if this is null, should that be possible,
            // should it not show those resources
            // TODO also what is used by default and does that make sense
            // TODO but what would happen to number array if slot was missing
            numberArray.push((Double) resource.getValue(property));
        }

        return numberArray;
    }
View Full Code Here


        return calculation.calculate(toNumberArray(visualItem
                .getResources(subset)));
    }

    private NumberArray toNumberArray(LightweightCollection<Resource> resources) {
        NumberArray numberArray = MathUtils.createNumberArray();

        for (Resource resource : resources) {
            // TODO, what happens if this is null, should that be possible,
            // should it not show those resources
            numberArray.push((Double) resource.getValue(property));
        }

        return numberArray;
    }
View Full Code Here

    }

    private void updateFontSizes() {
        assert !items.isEmpty();

        NumberArray fontSizeValues = MathUtils.createNumberArray();

        boolean onlyOneValue = true;
        boolean first = true;
        double firstValue = 0;
        for (TextItem textItem : items) {
            double itemValue = textItem.getFontSizeValue();

            if (first) {
                first = false;
                firstValue = itemValue;
            } else if (firstValue != itemValue) {
                onlyOneValue = false;
            }

            fontSizeValues.push(itemValue);
        }

        if (!onlyOneValue) {
            groupValueMapper.setNumberValues(fontSizeValues);
            for (TextItem textItem : items) {
View Full Code Here

TOP

Related Classes of org.thechiselgroup.choosel.core.client.util.math.NumberArray

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.