Mercurial > dive4elements > river
diff flys-client/src/main/java/de/intevation/flys/client/client/ui/LocationPanel.java @ 1593:ff9d71469b7c
Adjusted to be able to feed data to reference curves.
flys-client/trunk@3902 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Fri, 03 Feb 2012 13:57:27 +0000 |
parents | 8ab010967f78 |
children | ddf43791244c |
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/LocationPanel.java Fri Feb 03 11:15:09 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/LocationPanel.java Fri Feb 03 13:57:27 2012 +0000 @@ -38,8 +38,6 @@ /** * This UIProvider serves as base for UI Providers to enter a single location (km). - * - * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> */ public abstract class LocationPanel extends AbstractUIProvider @@ -56,11 +54,12 @@ /** The values entered in the location mode. */ protected double[] values; + /** Name of the data item that keeps this location(s). */ + protected String dataItemName; + /** The input panel for locations. */ protected DoubleArrayPanel locationPanel; - /** Name of the data item that keeps locations. */ - protected String DATA_ITEM_NAME = "ld_locations"; /** * Creates a new LocationDistancePanel instance. @@ -80,6 +79,8 @@ */ @Override public Canvas create(DataList data) { + findDataItemName(data); + VLayout layout = new VLayout(); layout.setMembersMargin(10); @@ -100,14 +101,25 @@ } + public void findDataItemName(DataList list) { + this.dataItemName = list.getAll().get(0).getLabel(); + } + + + public String getDataItemName() { + return this.dataItemName; + } + /** * This method creates a Canvas element showing the old Data objects in the * DataList <i>data</i>. */ public Canvas createOld(DataList dataList) { + findDataItemName(dataList); + List<Data> items = dataList.getAll(); - Data dLocation = getData(items, DATA_ITEM_NAME); + Data dLocation = getData(items, getDataItemName()); DataItem[] loc = dLocation.getItems(); HLayout layout = new HLayout();