Revision 6809e6bd
Added by Cherian Mathew almost 9 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/component/ConceptRelationshipComposite.java | ||
---|---|---|
26 | 26 |
|
27 | 27 |
import eu.etaxonomy.cdm.vaadin.container.IdUuidName; |
28 | 28 |
import eu.etaxonomy.cdm.vaadin.jscomponent.D3ConceptRelationshipTree; |
29 |
import eu.etaxonomy.cdm.vaadin.jscomponent.D3ConceptRelationshipTree.Direction; |
|
29 | 30 |
import eu.etaxonomy.cdm.vaadin.presenter.ConceptRelationshipPresenter; |
30 | 31 |
import eu.etaxonomy.cdm.vaadin.session.BasicEvent; |
31 | 32 |
import eu.etaxonomy.cdm.vaadin.session.CdmChangeEvent; |
... | ... | |
160 | 161 |
} |
161 | 162 |
|
162 | 163 |
|
163 |
private void refreshRelationshipView() { |
|
164 |
private void refreshRelationshipView(Direction direction) {
|
|
164 | 165 |
if(fromTaxonIun != null) { |
165 | 166 |
try { |
166 |
listener.refreshRelationshipView(fromTaxonIun); |
|
167 |
listener.refreshRelationshipView(fromTaxonIun, direction);
|
|
167 | 168 |
} catch (JSONException e) { |
168 | 169 |
Notification.show("Error generating concept relation JSON", e.getMessage(), Type.WARNING_MESSAGE); |
169 | 170 |
} |
... | ... | |
188 | 189 |
public void onSelect(SelectionEvent event) { |
189 | 190 |
if(event.getSourceType().equals(StatusComposite.class)) { |
190 | 191 |
fromTaxonIun = (IdUuidName)event.getSelectedObjects().get(0); |
191 |
view.setPrimaryStatusComposite((UUID)event.getSelectedObjects().get(1)); |
|
192 |
refreshRelationshipView(); |
|
192 |
view.setPrimaryStatusCompositeUuid((UUID)event.getSelectedObjects().get(1));
|
|
193 |
refreshRelationshipView(view.getDirection());
|
|
193 | 194 |
} |
194 | 195 |
} |
195 | 196 |
|
... | ... | |
202 | 203 |
public void onCreate(CdmChangeEvent event) { |
203 | 204 |
if(event.getSourceType().equals(EditConceptRelationshipComposite.class)) { |
204 | 205 |
setSelectedTaxonRelUuid(null); |
205 |
refreshRelationshipView(); |
|
206 |
refreshRelationshipView(view.getDirection());
|
|
206 | 207 |
|
207 | 208 |
} |
208 | 209 |
|
... | ... | |
216 | 217 |
public void onUpdate(CdmChangeEvent event) { |
217 | 218 |
if(event.getSourceType().equals(EditConceptRelationshipComposite.class)) { |
218 | 219 |
setSelectedTaxonRelUuid(null); |
219 |
refreshRelationshipView(); |
|
220 |
refreshRelationshipView(view.getDirection());
|
|
220 | 221 |
} |
221 | 222 |
|
222 | 223 |
} |
... | ... | |
229 | 230 |
public void onDelete(CdmChangeEvent event) { |
230 | 231 |
if(event.getSourceType().equals(EditConceptRelationshipComposite.class)) { |
231 | 232 |
setSelectedTaxonRelUuid(null); |
232 |
refreshRelationshipView(); |
|
233 |
refreshRelationshipView(view.getDirection());
|
|
233 | 234 |
} |
234 | 235 |
|
235 | 236 |
} |
Also available in: Unified diff
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