# HG changeset patch # User Felix Wolfsteller # Date 1324538272 0 # Node ID a2b0b2af529f77216b5794c4ff39a734adc7dfe5 # Parent e125f889cf2f5af812469912aa2ff68b6552fe6f Tell master-artifact of collection when cross-section-master changed kilometer. flys-client/trunk@3517 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r e125f889cf2f -r a2b0b2af529f flys-client/ChangeLog --- a/flys-client/ChangeLog Thu Dec 22 07:07:54 2011 +0000 +++ b/flys-client/ChangeLog Thu Dec 22 07:17:52 2011 +0000 @@ -1,3 +1,10 @@ +2011-12-22 Felix Wolfsteller + + * src/main/java/de/intevation/flys/client/client/ui/chart/CrossSectionChartThemePanel.java: + When changing cross-section-masters kilometer in cross sections, + also feed the collection-master-artifact with the kilometer, so that + it can be displayed in the diagrams subtitle. + 2011-12-22 Felix Wolfsteller * src/main/java/de/intevation/flys/client/client/ui/chart/ChartOutputTab.java: diff -r e125f889cf2f -r a2b0b2af529f flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/CrossSectionChartThemePanel.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/CrossSectionChartThemePanel.java Thu Dec 22 07:07:54 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/CrossSectionChartThemePanel.java Thu Dec 22 07:17:52 2011 +0000 @@ -44,6 +44,8 @@ import de.intevation.flys.client.client.services.LoadArtifactService; import de.intevation.flys.client.client.services.LoadArtifactServiceAsync; +import de.intevation.flys.client.client.ui.CollectionView; + /** @@ -126,7 +128,8 @@ } if (!value.equals("0")) { setCurrentCSMaster(theme.getArtifact()); - GWT.log("found a master: " + currentCSMasterUUID + "/" + theme.getDescription()); + GWT.log("found a master: " + currentCSMasterUUID + + "/" + theme.getDescription()); return theme.getDescription(); } } @@ -249,16 +252,10 @@ } - /** Feed the master (WINFO) artifact with the km of the crosssection, - * such that it can be displayed in the diagrams subtitle. */ - public void sendFeed(double kmD) { - ; - } - /** Feed a single artifact with the km of the crosssection to display. */ - public void sendFeed(FacetRecord facetRecord, double kmD) { - Config config = Config.getInstance(); - final String locale = config.getLocale(); + public void sendFeed(final String artUUID, final double kmD) { + Config config = Config.getInstance(); + final String locale = config.getLocale(); Data[] feedData = DefaultData.createSimpleStringDataArray("cross_section.km", @@ -268,7 +265,7 @@ feedService.feed( locale, new DefaultArtifact( - facetRecord.getTheme().getArtifact(), + artUUID, "TODO:hash"), feedData, new AsyncCallback() { @@ -280,10 +277,16 @@ } @Override public void onSuccess(Artifact artifact) { - GWT.log("Successfully fed"); + GWT.log("Successfully fed with km"); requestRedraw(); - // TODO also feed the winfo/masterartifact? (for plot subtitle) - enable(); + // Also feed the winfo/masterartifact (for plot subtitle) + if (artUUID.equals(getCurrentCSMaster()) + && !artUUID.equals(view.getArtifact().getUuid())) { + sendFeed(view.getArtifact().getUuid(), kmD); + } + else { + enable(); + } } }); } @@ -353,7 +356,8 @@ + closest); SpinnerItem item = (SpinnerItem) ce.getItem(); item.setValue(closest); - sendFeed(facetRecord, closest); + sendFeed(facetRecord.getTheme().getArtifact(), + closest); } }); }