# HG changeset patch # User Felix Wolfsteller # Date 1334740662 0 # Node ID 26fc6163643de7bdb9e235e47306d5372b73a974 # Parent 6f30bbd98618e2e16a2affa947b6bac1fa907e7c Replace spinnerItem by custom implementation to switch km in cross sections, but regress. flys-client/trunk@4261 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 6f30bbd98618 -r 26fc6163643d flys-client/ChangeLog --- a/flys-client/ChangeLog Wed Apr 18 09:03:08 2012 +0000 +++ b/flys-client/ChangeLog Wed Apr 18 09:17:42 2012 +0000 @@ -1,12 +1,22 @@ 2012-04-18 Felix Wolfsteller - * src/main/java/de/intevation/flys/client/client/ui/chart/CrossSectionChartThemePanel.java: + Improve km-Spinner behaviour but regressing on input-possibility (no + direct text input possible). + + * src/main/java/de/intevation/flys/client/client/ui/chart/CrossSectionChartThemePanel.java + (KmSpinner): New inner class. + (createGrid): Use new inner class as experiment (old code commented). + +2012-04-18 Felix Wolfsteller + + * src/main/java/de/intevation/flys/client/client/ui/chart/CrossSectionChartThemePanel.java (closest): Fix bug that prevented that always the closest km was fetched. 2012-04-18 Raimund Renkert * src/main/java/de/intevation/flys/client/client/ui/chart/ChartThemePanel.java: Open the ManualDatePointsEditor from context menu. + 2012-04-18 Raimund Renkert * src/main/java/de/intevation/flys/client/client/ui/chart/ChartThemePanel.java: diff -r 6f30bbd98618 -r 26fc6163643d 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 Wed Apr 18 09:03:08 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/CrossSectionChartThemePanel.java Wed Apr 18 09:17:42 2012 +0000 @@ -520,6 +520,56 @@ /** + * SpinnerItem-like element with text label and up/down buttons. + */ + public class KmSpinner extends HLayout { + protected Label label; + + protected FacetRecord facetRecord; + + protected double currentValue; + + public KmSpinner(FacetRecord facetRecord) { + super(2); + this.facetRecord = facetRecord; + final FacetRecord _facetRecord = facetRecord; + currentValue = Double.valueOf(facetRecord.getTheme() + .getCollectionItem().getData().get(CS_KM)); + // Buttons and labels. + int height = 10; + // MinusButton shall ask service for previous available cs. + Button minusButton = new Button("-"); + minusButton.setWidth(10); + minusButton.setHeight(height); + minusButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() { + public void onClick(ClickEvent evt) { + spinnerValueEntered(null, currentValue - 0.1d, _facetRecord); + } + }); + // TODO i18n + label = new Label(Double.toString(currentValue)); + label.setWidth(10); + label.setHeight(height); + // PlusButton shall ask service for next available cs. + Button plusButton = new Button("+"); + plusButton.setWidth(10); + plusButton.setHeight(height); + plusButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() { + public void onClick(ClickEvent evt) { + spinnerValueEntered(null, currentValue + 0.1d, _facetRecord); + } + }); + this.addMember(minusButton); + this.addMember(label); + this.addMember(plusButton); + + this.setHeight(height*2); + } + + } + + + /** * Create and configure the Grid to display. * @return ListGrid with Themes and related controls inside. */ @@ -542,6 +592,7 @@ String fieldName = this.getFieldName(colNum); if (fieldName.equals(GRID_FIELD_ACTIONS)) { + /* HLayout recordCanvas = new HLayout(3); recordCanvas.setHeight(22); recordCanvas.setAlign(Alignment.CENTER); @@ -570,6 +621,7 @@ if (facetRecord.getTheme().getActive() != 1) { spinnerItem.disable(); } + */ /* // To have visual representation of synchronous @@ -580,12 +632,13 @@ } */ + /* DynamicForm formWrap = new DynamicForm(); formWrap.setFields(spinnerItem); formWrap.setTitlePrefix(""); formWrap.setTitleSuffix(""); - recordCanvas.addMember(formWrap); - return recordCanvas; + */ + return new KmSpinner(facetRecord); } else { return null;