Project

General

Profile

« Previous | Next » 

Revision 6809e6bd

Added by Cherian Mathew almost 9 years ago

D3ConceptRelationshipTree, ConceptRelationshipComposite, ConceptRelationshipPresenter, ConceptRelationshipView, IConceptRelationshipComponentListener : added directional variable to display cr tree in both direction
d3.conceptrelationshiptree_connector.js : updated to handle bi-directional display
D3CTree, ConceptRelationshipPresenterTest, d3ctree_connector.js : testing bi-directional display

View differences:

src/test/java/eu/etaxonomy/cdm/vaadin/presenter/ConceptRelationshipPresenterTest.java
21 21
import eu.etaxonomy.cdm.vaadin.CdmVaadinBaseTest;
22 22
import eu.etaxonomy.cdm.vaadin.container.IdUuidName;
23 23
import eu.etaxonomy.cdm.vaadin.jscomponent.D3ConceptRelationshipTree;
24
import eu.etaxonomy.cdm.vaadin.jscomponent.D3ConceptRelationshipTree.Direction;
24 25

  
25 26
/**
26 27
 * @author cmathew
......
45 46
    @Test
46 47
    public void testRefreshRelationshipView() throws JSONException {
47 48
        UUID taxonUuid = UUID.fromString("5f713f69-e03e-4a11-8a55-700fbbf44805");
48
        crp.refreshRelationshipView(new IdUuidName(30, taxonUuid, null));
49
        crp.refreshRelationshipView(new IdUuidName(30, taxonUuid, null), Direction.LEFT_RIGHT);
49 50
        String expected = "{\"name\":\"Taxon d\",\"children\":[{\"name\":\"Congruent to\",\"children\":[{\"name\":\"Taxon e\",\"uuid\":\"84e99e24-f50a-4726-92d0-6088430c492a\",\"type\":\"taxon\"}],\"uuid\":\"511f504b-ae3b-4f04-b7b9-35c222f06e10\",\"type\":\"conceptr\"},{\"name\":\"Includes\",\"children\":[{\"name\":\"Taxon a\",\"uuid\":\"eaac797e-cac7-4649-97cf-c7b580076895\",\"type\":\"taxon\"}],\"uuid\":\"0e8b7922-974d-4389-b71e-af6fc9f98c56\",\"type\":\"conceptr\"},{\"name\":\"Includes\",\"children\":[{\"name\":\"Taxon b\",\"uuid\":\"5004a8e7-b907-4744-b67e-44ccb057ab3b\",\"type\":\"taxon\"}],\"uuid\":\"6fd9947e-21c3-4190-8748-57d9661e8659\",\"type\":\"conceptr\"},{\"name\":\"Excludes\",\"children\":[{\"name\":\"Taxon c\",\"uuid\":\"3d71c8b8-3bec-4f5f-ba23-6f9d55ef84e9\",\"type\":\"taxon\"}],\"uuid\":\"cc761030-38d2-4b5d-954d-32329c0ea106\",\"type\":\"conceptr\"}],\"uuid\":\"5f713f69-e03e-4a11-8a55-700fbbf44805\",\"type\":\"taxon\"}";
51
        logger.warn(crTree.getState().getConceptRelationshipTree());
50 52
        Assert.assertEquals(expected, crTree.getState().getConceptRelationshipTree());
51 53

  
52 54
        taxonUuid = UUID.fromString("3d71c8b8-3bec-4f5f-ba23-6f9d55ef84e9");
53
        crp.refreshRelationshipView(new IdUuidName(20, taxonUuid, null));
55
        crp.refreshRelationshipView(new IdUuidName(20, taxonUuid, null), Direction.LEFT_RIGHT);
54 56
        expected = "{\"name\":\"Taxon c\",\"children\":[],\"uuid\":\"3d71c8b8-3bec-4f5f-ba23-6f9d55ef84e9\",\"type\":\"taxon\"}";
57
        logger.warn(crTree.getState().getConceptRelationshipTree());
55 58
        Assert.assertEquals(expected, crTree.getState().getConceptRelationshipTree());
56 59

  
57 60
    }

Also available in: Unified diff