# HG changeset patch # User Felix Wolfsteller # Date 1327656413 0 # Node ID 42f1213dfbcc3d4303cb970dced37cd5093b9112 # Parent e2f74131ffc1ae435331d0dbabdbd9b0c2806dd4 Let ManualPointEditor use RedrawRequests to let freshly edited points show up in Chart. flys-client/trunk@3780 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r e2f74131ffc1 -r 42f1213dfbcc flys-client/ChangeLog --- a/flys-client/ChangeLog Fri Jan 27 08:49:16 2012 +0000 +++ b/flys-client/ChangeLog Fri Jan 27 09:26:53 2012 +0000 @@ -1,3 +1,11 @@ +2012-01-27 Felix Wolfsteller + + * src/main/java/de/intevation/flys/client/client/ui/chart/ManualPointsEditor.java: + Fire RedrawRequest when finished adding points. + + * src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java: + Register RedrawRequestHandler with ManualPointsEditor. + 2012-01-27 Felix Wolfsteller * src/main/java/de/intevation/flys/client/client/ui/LocationDistancePanel.java, diff -r e2f74131ffc1 -r 42f1213dfbcc flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java Fri Jan 27 08:49:16 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java Fri Jan 27 09:26:53 2012 +0000 @@ -208,7 +208,8 @@ /** Open editor for custom points. */ protected void openPointWindow() { - new ManualPointsEditor(chartTab.getView().getCollection()).show(); + new ManualPointsEditor(chartTab.getView().getCollection(), + this.chartTab).show(); } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r e2f74131ffc1 -r 42f1213dfbcc flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ManualPointsEditor.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ManualPointsEditor.java Fri Jan 27 08:49:16 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ManualPointsEditor.java Fri Jan 27 09:26:53 2012 +0000 @@ -33,8 +33,6 @@ import de.intevation.flys.client.shared.model.CollectionItem; import de.intevation.flys.client.client.utils.DoubleValidator; -import de.intevation.flys.client.client.services.CollectionAttributeService; -import de.intevation.flys.client.client.services.CollectionAttributeServiceAsync; import de.intevation.flys.client.client.services.LoadArtifactService; import de.intevation.flys.client.client.services.LoadArtifactServiceAsync; import de.intevation.flys.client.client.services.FeedService; @@ -45,6 +43,10 @@ import de.intevation.flys.client.shared.model.DefaultData; import de.intevation.flys.client.shared.model.Recommendation; +import de.intevation.flys.client.client.event.RedrawRequestHandler; +import de.intevation.flys.client.client.event.RedrawRequestEvent; +import de.intevation.flys.client.client.event.RedrawRequestEvent.Type; + /** * UI to enter point data and save it to an PointArtifact. @@ -61,8 +63,8 @@ // TODO with separate point sets in multiple diagrams, we might need // different POINT_DATA-names (e.g. one per diagram). - protected CollectionAttributeServiceAsync updater = - GWT.create(CollectionAttributeService.class); + /** When we chaged something, we need a RedrawRequest(Handler). */ + protected RedrawRequestHandler redrawRequestHandler; /** The collection */ protected Collection collection; @@ -86,8 +88,11 @@ * Setup editor dialog. * @param collection The collection to use. */ - public ManualPointsEditor(Collection collection) { + public ManualPointsEditor(Collection collection, + RedrawRequestHandler handler + ) { this.collection = collection; + this.redrawRequestHandler = handler; init(); } @@ -191,11 +196,14 @@ } public void onSuccess(Artifact fartifact) { GWT.log("Successfully set points "); - // TODO refresh view + // TODO refresh collection such that next time + // the new points are shown. //requestRedraw(); //updateCollection(); //updateGrid(); //enable(); + redrawRequestHandler.onRedrawRequest( + new RedrawRequestEvent(Type.DEFAULT)); destroy(); } });