Examples of SumCalculation


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

        // TODO the slot mapping configuration should be what defines these
        // below The Resolvers should have Id's and the ability to determine if
        // something is resolvable
        ViewItemResolverFactory[] calculations = new ViewItemResolverFactory[] {
                new FixedValueResolverFactory(new ResourceCountResolver()),
                new CalculationResolverFactory(new SumCalculation()),
                new CalculationResolverFactory(new AverageCalculation()),
                new CalculationResolverFactory(new MinCalculation()),
                new CalculationResolverFactory(new MaxCalculation()),
                new FixedValueResolverFactory(new FixedValueResolver(
                        new Double(1), DataType.NUMBER)) };
View Full Code Here

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

                    } else if ("max".equals(calculationType)) {
                        setResolver(slot, new CalculationResolver(property,
                                Subset.ALL, new MaxCalculation()));
                    } else if ("sum".equals(calculationType)) {
                        setResolver(slot, new CalculationResolver(property,
                                Subset.ALL, new SumCalculation()));
                    } else if ("average".equals(calculationType)) {
                        setResolver(slot, new CalculationResolver(property,
                                Subset.ALL, new AverageCalculation()));
                    }
                }
View Full Code Here

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

        switch (dataType) {
        case TEXT:
            return new TextPropertyResolver(firstProperty);
        case NUMBER:
            return new CalculationResolver(firstProperty, new SumCalculation());
        }

        return new FirstResourcePropertyResolver(firstProperty, dataType);
    }
View Full Code Here

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

                        .full(COLOR_SELECTION_BORDER, Subset.SELECTED),
                        StatusRule.fullOrPartial(COLOR_HIGHLIGHTED_BORDER,
                                Subset.HIGHLIGHTED)));
        scatterPlot.setResolver(ScatterPlot.X_POSITION,
                new CalculationResolver(BenchmarkResourceSetFactory.NUMBER_2,
                        new SumCalculation()));
        scatterPlot.setResolver(ScatterPlot.Y_POSITION,
                new CalculationResolver(BenchmarkResourceSetFactory.NUMBER_1,
                        new SumCalculation()));
        scatterPlot.setResolver(ScatterPlot.SIZE, new FixedValueResolver(20,
                DataType.NUMBER));
        scatterPlot.setResolver(ScatterPlot.SHAPE,
                new AbstractBasicVisualItemValueResolver() {
                    public Object resolve(VisualItem visualItem,
View Full Code Here

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

                new VisualItemStatusResolver(COLOR_DEFAULT_BORDER, StatusRule
                        .full(COLOR_SELECTION_BORDER, Subset.SELECTED),
                        StatusRule.fullOrPartial(COLOR_HIGHLIGHTED_BORDER,
                                Subset.HIGHLIGHTED)));
        pieChart.setResolver(PieChart.VALUE, new CalculationResolver(
                BenchmarkResourceSetFactory.NUMBER_2, new SumCalculation()));
        pieChart.setResolver(PieChart.PARTIAL_VALUE,
                new SubsetDelegatingValueResolver(PieChart.VALUE,
                        Subset.SELECTED));
        pieChart.setResolver(PieChart.PARTIAL_COLOR, COLOR_RESOLVER);
        pieChart.setResolver(PieChart.PARTIAL_BORDER_COLOR,
View Full Code Here

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

        // mappings
        barChart.setResolver(BarChart.BAR_LABEL,
                new FirstResourcePropertyResolver(
                        BenchmarkResourceSetFactory.TEXT_2, DataType.TEXT));
        barChart.setResolver(BarChart.BAR_LENGTH, new CalculationResolver(
                BenchmarkResourceSetFactory.NUMBER_2, new SumCalculation()) {
            @Override
            public String toString() {
                return "my axis label"; // example for axis labeling
            }
        });
View Full Code Here

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

    @Test
    public void visualItemsReturnCorrectValuesOnViewContentDisplayUpdateAfterResourceSetChange() {
        String propertyName = "property";

        underTest.setResolver(slot, new CalculationResolver(propertyName,
                new SumCalculation()));

        Resource resource1 = createResource(TYPE_1, 1);
        resource1.putValue(propertyName, 1d);
        helper.addToContainedResources(resource1);
View Full Code Here

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

    }

    @Test
    public void changingSlotMappingUpdatesVisualItemValue2() {
        underTest.setResolver(numberSlot, new CalculationResolver(
                NUMBER_PROPERTY_1, new SumCalculation()));
        getFirstVisualItem().getValue(numberSlot);
        underTest.setResolver(numberSlot, new CalculationResolver(
                NUMBER_PROPERTY_1, new MaxCalculation()));

        assertEquals(8d, getFirstVisualItem().getValue(numberSlot));
View Full Code Here

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

                TEXT_PROPERTY_1));
    }

    @Test
    public void sumCalculationOverGroup() {
        testCalculationOverGroup(12d, new SumCalculation());
    }
View Full Code Here

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

    }

    @Test
    public void restoreSumCalculationOverGroup() {
        testRestoreCalculationOverGroup(12d, new CalculationResolverFactory(
                "sum", new SumCalculation()));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.