Mercurial > dive4elements > river
changeset 2924:60c375173263
Minor refactoring.
flys-client/trunk@4806 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 27 Jun 2012 06:52:54 +0000 |
parents | 43e0f6d96206 |
children | 6461b8dbe093 |
files | flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ManualPointsEditor.java |
diffstat | 2 files changed, 14 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-client/ChangeLog Mon Jun 25 17:33:27 2012 +0000 +++ b/flys-client/ChangeLog Wed Jun 27 06:52:54 2012 +0000 @@ -1,3 +1,8 @@ +2012-06-27 Felix Wolfsteller <felix.wolfsteller@intevation.de> + + * src/main/java/de/intevation/flys/client/client/ui/chart/ManualPointsEditor.java: + Minor refactoring. + 2012-06-25 Sascha L. Teichmann <sascha.teichmann@intevation.de> * src/main/java/de/intevation/flys/client/client/ui/fixation/FixationPanel.java:
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ManualPointsEditor.java Mon Jun 25 17:33:27 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ManualPointsEditor.java Wed Jun 27 06:52:54 2012 +0000 @@ -68,10 +68,8 @@ /** The interface that provides i18n messages. */ protected FLYSConstants MSG = GWT.create(FLYSConstants.class); - /** Name of the main data item to be fed. */ + /** Part of name of the main data item to be fed. */ public static final String POINT_DATA = "manualpoints.data"; - // TODO with separate point sets in multiple diagrams, we might need - // different POINT_DATA-names (e.g. one per diagram). /** When we chaged something, we need a RedrawRequest(Handler). */ protected RedrawRequestHandler redrawRequestHandler; @@ -96,6 +94,9 @@ /** Name of the outputmode, important when feeding data. */ protected String outputModeName; + /** Name of the point data item. */ + protected String pointDataItemName; + /** * Setup editor dialog. @@ -107,6 +108,7 @@ this.collection = collection; this.redrawRequestHandler = handler; this.outputModeName = outputModeName; + this.pointDataItemName = outputModeName + "." + POINT_DATA; init(); } @@ -118,8 +120,7 @@ for (int i = 0; i < size; i++) { CollectionItem item = collection.getItem(i); - String dataValue = (String) item.getData().get(outputModeName - + "." + POINT_DATA); + String dataValue = (String) item.getData().get(pointDataItemName); if (dataValue != null) { // Found it. uuid = item.identifier(); @@ -300,7 +301,8 @@ // Add points to grid. if (item != null) { - String jsonData = item.getData().get(outputModeName + "." + POINT_DATA); + // TODO store this from findPointUUID instead (we touched these). + String jsonData = item.getData().get(pointDataItemName); JSONArray jsonArray = (JSONArray) JSONParser.parse(jsonData); for (int i = 0; i < jsonArray.size(); i++) { JSONArray point = (JSONArray) jsonArray.get(i); @@ -389,7 +391,7 @@ JSONArray list = jsonArrayFromListGrid(); Data[] feedData = new Data[] { - DefaultData.createSimpleStringData(outputModeName + "." + POINT_DATA, + DefaultData.createSimpleStringData(pointDataItemName, list.toString()) };