Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/ChartPropertiesEditor.java @ 7597:fca46ce8e4f5
(issue1225) Implement Magic labels.
There is now a new value in the chartsettings "Suggested Label" which
is hidden in the property editor. A suggested label is the label that
combines the label's of all processors that wrote data to an axis.
This suggested label is set as the label when the user has not
overwritten the label.
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Mon, 25 Nov 2013 14:58:14 +0100 |
parents | 480fb71ab73f |
children | 8580f222dfb2 |
comparison
equal
deleted
inserted
replaced
7596:12c4c8d0ac41 | 7597:fca46ce8e4f5 |
---|---|
186 protected Canvas generatePropertyGroup(Property group, Property orig) { | 186 protected Canvas generatePropertyGroup(Property group, Property orig) { |
187 PropertyGroup pg = (PropertyGroup)group; | 187 PropertyGroup pg = (PropertyGroup)group; |
188 PropertyGroup origPg = (PropertyGroup)orig; | 188 PropertyGroup origPg = (PropertyGroup)orig; |
189 | 189 |
190 if (pg.getName().equals("axis")) { | 190 if (pg.getName().equals("axis")) { |
191 for (Property prop: origPg.getProperties()) { | |
192 GWT.log("Found: " + prop.getName()); | |
193 } | |
194 for (Property prop: pg.getProperties()) { | |
195 GWT.log("Found new: " + prop.getName()); | |
196 } | |
191 // Certain axis shall be skipped (W/Q-Diagrams cm-axis especially). | 197 // Certain axis shall be skipped (W/Q-Diagrams cm-axis especially). |
192 String outputName = tab.getOutputName(); | 198 String outputName = tab.getOutputName(); |
193 if (outputName.equals("fix_wq_curve") || outputName.equals("computed_discharge_curve") | 199 if (outputName.equals("fix_wq_curve") || outputName.equals("computed_discharge_curve") |
194 || outputName.equals("extreme_wq_curve")) { | 200 || outputName.equals("extreme_wq_curve")) { |
195 String labelString = ((StringProperty)origPg.getPropertyByName("label")).getValue(); | 201 String labelString = ((StringProperty)origPg.getPropertyByName("label")).getValue(); |
210 StringProperty label = | 216 StringProperty label = |
211 (StringProperty)pg.getPropertyByName("label"); | 217 (StringProperty)pg.getPropertyByName("label"); |
212 FormItem title = createStringProperty(label); | 218 FormItem title = createStringProperty(label); |
213 title.setValue( | 219 title.setValue( |
214 ((StringProperty)origPg.getPropertyByName("label")).getValue()); | 220 ((StringProperty)origPg.getPropertyByName("label")).getValue()); |
221 | |
222 StringProperty suggestedLabel = | |
223 (StringProperty)pg.getPropertyByName("suggested-label"); | |
224 FormItem sugLabel = null; | |
225 | |
226 if (suggestedLabel != null) { | |
227 // X Axis does not have a suggested label | |
228 // otherwise add an hidden property for suggestedLabel | |
229 sugLabel = createStringProperty(suggestedLabel); | |
230 sugLabel.setValue( | |
231 ((StringProperty)origPg.getPropertyByName("suggested-label")).getValue()); | |
232 } | |
215 | 233 |
216 IntegerProperty fontsize = | 234 IntegerProperty fontsize = |
217 (IntegerProperty)pg.getPropertyByName("font-size"); | 235 (IntegerProperty)pg.getPropertyByName("font-size"); |
218 FormItem fs = createIntegerProperty(fontsize); | 236 FormItem fs = createIntegerProperty(fontsize); |
219 fs.setValue( | 237 fs.setValue( |