# HG changeset patch # User Raimund Renkert # Date 1316165742 0 # Node ID 2c8f1112be370091cd19a96f64f13f3b32cce04d # Parent 4668357b255e429f02114b5402fd67feddefbc36 Rollback for input assistance of "Q/D" table. The selectable icon columns are visible in all modes except of "Q" input mode. (Issue203) flys-client/trunk@2771 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 4668357b255e -r 2c8f1112be37 flys-client/ChangeLog --- a/flys-client/ChangeLog Thu Sep 15 17:01:12 2011 +0000 +++ b/flys-client/ChangeLog Fri Sep 16 09:35:42 2011 +0000 @@ -1,3 +1,13 @@ +2011-09-16 Raimund Renkert + + Issue203 + + * src/main/java/de/intevation/flys/client/client/ui/wq/QDTable.java, + src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java: + Rollback for input assistance of "Q/D" table. + The selectable icon columns are visible in all modes except of + "Q" input mode. + 2011-09-15 Ingo Weinzierl flys/issue259 (Daten aus Datenkorb in Diagramm einladen) diff -r 4668357b255e -r 2c8f1112be37 flys-client/src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java Thu Sep 15 17:01:12 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java Fri Sep 16 09:35:42 2011 +0000 @@ -156,6 +156,45 @@ public WQInputPanel() { qdTable = new QDTable(); wTable = new WTable(); + + initTableListeners(); + } + + + /** + * Initializes the listeners of the WQD tables. + */ + protected void initTableListeners() { + CellClickHandler handler = new CellClickHandler() { + public void onCellClick(CellClickEvent e) { + if (isWMode()) { + return; + } + + int idx = e.getColNum(); + Record r = e.getRecord (); + double val = r.getAttributeAsDouble("value"); + + if (idx == 0) { + if (isRangeMode()) { + qRangePanel.setFrom(val); + } + else { + qArrayPanel.addValue(val); + } + } + else if (idx == 1) { + if (isRangeMode()) { + qRangePanel.setTo(val); + } + else { + qArrayPanel.addValue(val); + } + } + } + }; + + qdTable.addCellClickHandler(handler); } @@ -982,6 +1021,13 @@ inputMode = form.getValueAsString(FIELD_MODE); } + if (wqMode.equals("Q")) { + qdTable.hideIconFields(); + } + else { + qdTable.showIconFields(); + } + updatePanels(wqMode, inputMode); } diff -r 4668357b255e -r 2c8f1112be37 flys-client/src/main/java/de/intevation/flys/client/client/ui/wq/QDTable.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/wq/QDTable.java Thu Sep 15 17:01:12 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/wq/QDTable.java Fri Sep 16 09:35:42 2011 +0000 @@ -22,7 +22,6 @@ /** The interface that provides the image resources. */ private FLYSImages IMAGES = GWT.create(FLYSImages.class); - public QDTable() { setWidth100(); setHeight100(); @@ -33,6 +32,16 @@ setShowRecordComponentsByCell(true); setEmptyMessage(MESSAGE.empty_table()); + ListGridField addMax = new ListGridField("max", ""); + addMax.setType(ListGridFieldType.ICON); + addMax.setWidth(30); + addMax.setCellIcon(IMAGES.markerRed().getURL()); + + ListGridField addMin = new ListGridField("min", ""); + addMin.setType(ListGridFieldType.ICON); + addMin.setWidth(30); + addMin.setCellIcon(IMAGES.markerGreen().getURL()); + ListGridField name = new ListGridField("name", MESSAGE.discharge()); name.setType(ListGridFieldType.TEXT); name.setWidth("*"); @@ -45,7 +54,19 @@ value.setType(ListGridFieldType.FLOAT); value.setWidth("20%"); - setFields(name, type, value); + setFields(addMax, addMin, name, type, value); } + + public void hideIconFields () { + hideField("max"); + hideField("min"); + } + + + public void showIconFields() { + showField("max"); + showField("min"); + } + } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :