Mercurial > dive4elements > river
diff flys-client/src/main/java/de/intevation/flys/client/client/ui/GaugeTimeRangePanel.java @ 4131:360e22afb98b
Cosmetics, warnings and minor TODOs.
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Mon, 15 Oct 2012 00:04:35 +0200 |
parents | 0cc2c3d89a9d |
children | c722c08cf502 |
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/GaugeTimeRangePanel.java Sun Oct 14 14:44:28 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/GaugeTimeRangePanel.java Mon Oct 15 00:04:35 2012 +0200 @@ -1,13 +1,11 @@ package de.intevation.flys.client.client.ui; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - import com.google.gwt.core.client.GWT; import com.google.gwt.i18n.client.DateTimeFormat; + import com.smartgwt.client.data.Record; import com.smartgwt.client.types.ListGridFieldType; +import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.Label; import com.smartgwt.client.widgets.form.DynamicForm; @@ -31,11 +29,17 @@ import de.intevation.flys.client.shared.model.LongRangeData; import de.intevation.flys.client.shared.model.RangeData; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + /** * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> */ public class GaugeTimeRangePanel extends RangePanel { + private static final long serialVersionUID = -157571967010594739L; + /** The message class that provides i18n strings. */ protected FLYSConstants MESSAGES = GWT.create(FLYSConstants.class); @@ -50,6 +54,7 @@ yearTable.setShowHeaderContextMenu(false); } + @Override public Canvas create(DataList data) { setDataName(data); @@ -89,8 +94,7 @@ public Canvas createOld(DataList dataList) { GWT.log("create old date."); Data data = dataList.get(0); - DataItem[] items = data.getItems(); -GWT.log(data.getClass().toString()); + HLayout layout = new HLayout(); Label label = new Label(dataList.getLabel()); @@ -99,6 +103,8 @@ Date dl = new Date((Long)((LongRangeData)data).getLower()); Date du = new Date((Long)((LongRangeData)data).getUpper()); + + @SuppressWarnings("deprecation") DateTimeFormat dtf = DateTimeFormat.getMediumDateFormat(); Label value = new Label(dtf.format(dl) + " - " + dtf.format(du)); value.setHeight(20); @@ -170,7 +176,7 @@ } catch (NumberFormatException nfe) { GWT.log("could not parse lower date."); - //TODO: Messagebox with error. + SC.warn(MESSAGES.warning_cannot_parse_date()); } } @@ -183,7 +189,7 @@ } catch (NumberFormatException nfe) { GWT.log("could not parse upper date."); - //TODO: Messagebox with error. + SC.warn(MESSAGES.warning_cannot_parse_date()); } } @@ -195,6 +201,7 @@ long value = Long.valueOf(raw); Date date = new Date(value); + @SuppressWarnings("deprecation") DateTimeFormat dtf = DateTimeFormat.getMediumDateFormat(); return dtf.format(date); @@ -212,6 +219,7 @@ yearTable.setCanReorderFields(false); CellFormatter cf = new CellFormatter() { + @Override public String format( Object value, ListGridRecord record, @@ -238,6 +246,7 @@ addstart.setWidth (20); addstart.setCellIcon(baseUrl + MESSAGES.markerGreen()); addstart.addRecordClickHandler(new RecordClickHandler() { + @Override public void onRecordClick(RecordClickEvent e) { Record r = e.getRecord(); if (r.getAttribute("start").equals("-1")) { @@ -254,6 +263,7 @@ addend.setWidth (20); addend.setCellIcon(baseUrl + MESSAGES.markerRed()); addend.addRecordClickHandler(new RecordClickHandler() { + @Override public void onRecordClick(RecordClickEvent e) { Record r = e.getRecord(); if (r.getAttribute("end").equals("-1")) {