Package org.thechiselgroup.choosel.core.client.resources

Examples of org.thechiselgroup.choosel.core.client.resources.Resource


        slotMappingInitializer = new TestSlotMappingInitializer(
                initialSlotMapping);

        DefaultVisualizationModel model = createViewModel(new ResourceByUriMultiCategorizer());

        Resource resource = ResourceSetTestUtils.createResource(1);
        resource.putValue(property1, 1);
        model.getContentResourceSet().add(resource);

        LightweightCollection<VisualItem> visualItems = model
                .getFullVisualItemContainer().getVisualItems();
View Full Code Here


    private Double fixedNumberReturnValue;

    @Test
    public void initialSlotValueForDateSlot() {
        Resource resource = new Resource("test:1");
        resource.putValue("date1", new Date(100, 1, 1, 0, 0, 0));

        helper.getContainedResources().add(resource);

        assertEquals(true, underTest.isConfigured(slots[2]));
View Full Code Here

        assertEquals(datePropertyReturnValue, visualItem.getValue(slots[2]));
    }

    @Test
    public void initialSlotValueForNumberSlotIfNoNumberIsAvailableInData() {
        Resource resource = new Resource("test:1");
        resource.putValue("text1", "xt1");
        resource.putValue("text2", "xt2");

        helper.getContainedResources().add(resource);

        assertEquals(true, underTest.isConfigured(slots[1]));
View Full Code Here

        slotMappingInitializer = new TestSlotMappingInitializer(
                initialSlotMapping);

        DefaultVisualizationModel model = createViewModel(new ResourceByUriMultiCategorizer());

        Resource resource1 = ResourceSetTestUtils.createResource(1);
        resource1.putValue(property1, 1);
        resource1.putValue(property2, "a");

        model.getContentResourceSet().add(resource1);

        /* Test results */
        LightweightCollection<VisualItem> visualItems = model
View Full Code Here

    }

    private static Resource createResource(int index, long timestamp,
            String uriClass, int numberOfResources) {

        Resource resource = new Resource(uriClass + ":" + index);

        resource.putValue(LOCATION_1, createRandomLocation());
        resource.putValue(LOCATION_2, createRandomLocation());
        resource.putValue(DATE_1, createRandomDate(365, timestamp));
        resource.putValue(DATE_2, createRandomDate(180, timestamp));
        resource.putValue(NUMBER_1, createRandomNumber(0, 10000));
        resource.putValue(NUMBER_2, createRandomNumber(0, 100));
        resource.putValue(NUMBER_3, createRandomNumber(-100, 100));
        resource.putValue(TEXT_1, "text" + index);
        resource.putValue(TEXT_2, createRandomText(10));
        resource.putValue(TEXT_3, createRandomText(100));
        resource.putValue(RESOURCE_1,
                createRandomUriList(uriClass, numberOfResources));

        return resource;
    }
View Full Code Here

        assertEquals(fixedNumberReturnValue, visualItem.getValue(slots[1]));
    }

    @Test
    public void initialSlotValueForTextSlot() {
        Resource resource = new Resource("test:1");
        resource.putValue("text1", "t1x");
        resource.putValue("text2", "t2x");

        helper.getContainedResources().add(resource);

        assertEquals(true, underTest.isConfigured(slots[0]));
View Full Code Here

        slotMappingInitializer = new TestSlotMappingInitializer(
                initialSlotMapping);

        DefaultVisualizationModel model = createViewModel(new ResourceByUriMultiCategorizer());

        Resource resource = createResource(1);
        resource.putValue(property1, 1);
        model.getContentResourceSet().add(resource);

        LightweightCollection<VisualItem> visualItems = model
                .getFullVisualItemContainer().getVisualItems();
View Full Code Here

        registerDefaultResolverFactory(DataType.NUMBER, "fixed-number",
                fixedNumberReturnValue);
        registerDefaultResolverFactory(DataType.TEXT, "fixed-text", "fixed");
        registerDefaultResolverFactory(DataType.DATE, "fixed-date", new Date());
        registerDefaultResolverFactory(DataType.LOCATION, "fixed-location",
                new Resource("location:0"));

        new DefaultManagedSlotMappingConfiguration(resolverProvider,
                initializer, underTest, errorModel);
    }
View Full Code Here

            GraphNodeExpansionCallback graph) {

        assert visualItem != null;
        assert graph != null;

        Resource resource = getSingleResource(visualItem);

        if (isNeighbourhoodLoaded(visualItem, resource)) {
            expandNeighbourhood(visualItem, resource, graph,
                    reconstructNeighbourhood(visualItem, resource));
        } else {
View Full Code Here

                if (expansionCallback.getResourceManager().contains(uri)) {
                    /*
                     * XXX we are ignoring resources that are not available in
                     * the resource manager.
                     */
                    Resource resourceToAdd = expansionCallback
                            .getResourceManager().getByUri(uri);
                    assert resourceToAdd != null : "resource with uri '" + uri
                            + "' must be available";
                    expansionCallback.addAutomaticResource(resourceToAdd);
                    added.add(uri);
View Full Code Here

TOP

Related Classes of org.thechiselgroup.choosel.core.client.resources.Resource

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.