# HG changeset patch # User Sascha L. Teichmann # Date 1337692852 0 # Node ID c7da05282644a5473c34111777d168f7792b2c14 # Parent cc5969df04901a93e07e42c681c0f6575f9febea FixPeriodPanel: Make the names of state parameters configurable by constructor. flys-client/trunk@4458 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r cc5969df0490 -r c7da05282644 flys-client/ChangeLog --- a/flys-client/ChangeLog Mon May 21 09:22:29 2012 +0000 +++ b/flys-client/ChangeLog Tue May 22 13:20:52 2012 +0000 @@ -1,3 +1,12 @@ +2012-05-22 Sascha L. Teichmann + + * src/main/java/de/intevation/flys/client/client/ui/fixation/FixPeriodPanel.java: + Make the names of state parameters configurable by constructor. + + * src/main/java/de/intevation/flys/client/client/ui/UIProviderFactory.java: + Create specialized FixPeriodPanels when using "fix.period_ref_panel" or + "fix.period_ana_panel" provider types. + 2012-05-21 Raimund Renkert * src/main/java/de/intevation/flys/client/client/ui/fixation/FixLocationPanel.java, diff -r cc5969df0490 -r c7da05282644 flys-client/src/main/java/de/intevation/flys/client/client/ui/UIProviderFactory.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/UIProviderFactory.java Mon May 21 09:22:29 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/UIProviderFactory.java Tue May 22 13:20:52 2012 +0000 @@ -91,6 +91,12 @@ else if (uiProvider.equals("fix.period_panel")) { return new FixPeriodPanel(); } + else if (uiProvider.equals("fix.period_ref_panel")) { + return new FixPeriodPanel("ref_start", "ref_end"); + } + else if (uiProvider.equals("fix.period_ana_panel")) { + return new FixPeriodPanel("ana_start", "ana_end"); + } else if (uiProvider.equals("fix.gaugeselect_panel")) { return new FixGaugeSelectPanel(); } diff -r cc5969df0490 -r c7da05282644 flys-client/src/main/java/de/intevation/flys/client/client/ui/fixation/FixPeriodPanel.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/fixation/FixPeriodPanel.java Mon May 21 09:22:29 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/fixation/FixPeriodPanel.java Tue May 22 13:20:52 2012 +0000 @@ -43,7 +43,16 @@ long start; long end; + protected String startName; + protected String endName; + public FixPeriodPanel() { + this("start", "end"); + } + + public FixPeriodPanel(String startName, String endName) { + this.startName = startName; + this.endName = endName; htmlOverview = ""; } @@ -72,8 +81,8 @@ public Canvas createOld(DataList dataList) { List items = dataList.getAll(); - Data start = getData(items, "start"); - Data end = getData(items, "end"); + Data start = getData(items, startName); + Data end = getData(items, endName); DataItem[] startItem = start.getItems(); DataItem[] endItem = end.getItems(); @@ -132,15 +141,15 @@ this.fixFilter.setToDate(this.end); String start = Long.valueOf(this.start).toString(); String end = Long.valueOf(this.end).toString(); - DataItem startItem = new DefaultDataItem("start", "start", start); - DataItem endItem = new DefaultDataItem("end", "end", end); + DataItem startItem = new DefaultDataItem(startName, startName, start); + DataItem endItem = new DefaultDataItem(endName, endName, end); data.add(new DefaultData( - "start", + startName, null, null, new DataItem[] { startItem })); data.add(new DefaultData( - "end", + endName, null, null, new DataItem[] { endItem }));