Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/fixation/FixGaugeSelectPanel.java @ 2887:12f58f719125
Changed numbers in gauge sector selection state to strings.
flys-client/trunk@4570 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Fri, 01 Jun 2012 11:08:35 +0000 |
parents | 88bca9f735c0 |
children | 55ea5474e11e |
comparison
equal
deleted
inserted
replaced
2886:bd16493cc0da | 2887:12f58f719125 |
---|---|
41 protected String second; | 41 protected String second; |
42 | 42 |
43 protected SelectItem from; | 43 protected SelectItem from; |
44 protected SelectItem to; | 44 protected SelectItem to; |
45 | 45 |
46 protected LinkedHashMap mapValues; | |
47 | |
46 public FixGaugeSelectPanel() { | 48 public FixGaugeSelectPanel() { |
47 htmlOverview = ""; | 49 htmlOverview = ""; |
50 mapValues = new LinkedHashMap(); | |
51 mapValues.put("0", "Q \u2208 [0, (MNQ + MQ)/2"); | |
52 mapValues.put("1", "Q \u2208 [(MNQ + MQ)/2, (MQ + MHQ)/2]"); | |
53 mapValues.put("2", "Q \u2208 [(MQ + MHQ)/2, HQ5]"); | |
54 mapValues.put("3", "Q \u2208 [HQ5, \u221e]"); | |
55 | |
56 | |
48 } | 57 } |
49 | 58 |
50 public Canvas createWidget(DataList data) { | 59 public Canvas createWidget(DataList data) { |
51 instances.put(this.artifact.getUuid(), this); | 60 instances.put(this.artifact.getUuid(), this); |
52 | 61 |
53 VLayout layout = new VLayout(); | 62 VLayout layout = new VLayout(); |
54 | 63 |
55 Label title = new Label(MESSAGES.gauge_class()); | 64 Label title = new Label(MESSAGES.gauge_class()); |
56 title.setHeight(25); | 65 title.setHeight(25); |
57 | 66 |
58 LinkedHashMap map = new LinkedHashMap(); | |
59 map.put("0", "0"); | |
60 map.put("1", "1"); | |
61 map.put("2", "2"); | |
62 map.put("3", "3"); | |
63 | |
64 from = new SelectItem(MESSAGES.from()); | 67 from = new SelectItem(MESSAGES.from()); |
65 to = new SelectItem(MESSAGES.to()); | 68 to = new SelectItem(MESSAGES.to()); |
66 | 69 |
67 from.setShowTitle(false); | 70 from.setShowTitle(false); |
68 to.setShowTitle(false); | 71 to.setShowTitle(false); |
69 from.setValueMap(map); | 72 from.setValueMap(mapValues); |
70 from.setWidth(60); | 73 from.setWidth(60); |
71 to.setValueMap(map); | 74 to.setValueMap(mapValues); |
72 to.setWidth(60); | 75 to.setWidth(60); |
73 | 76 |
74 DynamicForm form = new DynamicForm(); | 77 DynamicForm form = new DynamicForm(); |
75 StaticTextItem separator = new StaticTextItem("separator"); | 78 StaticTextItem separator = new StaticTextItem("separator"); |
76 separator.setShowTitle(false); | 79 separator.setShowTitle(false); |
92 Data t = getData(items, "q2"); | 95 Data t = getData(items, "q2"); |
93 DataItem[] fItems = f.getItems(); | 96 DataItem[] fItems = f.getItems(); |
94 DataItem[] tItems = t.getItems(); | 97 DataItem[] tItems = t.getItems(); |
95 | 98 |
96 StringBuilder sb = new StringBuilder(); | 99 StringBuilder sb = new StringBuilder(); |
97 sb.append(fItems[0].getLabel()); | 100 sb.append(mapValues.get(fItems[0].getLabel())); |
98 sb.append(" " + MESSAGES.to() + " "); | 101 sb.append(" " + MESSAGES.to() + " "); |
99 sb.append(tItems[0].getLabel()); | 102 sb.append(mapValues.get(tItems[0].getLabel())); |
100 | 103 |
101 Label old = new Label(sb.toString()); | 104 Label old = new Label(sb.toString()); |
102 old.setWidth(130); | 105 old.setWidth(130); |
103 | 106 |
104 HLayout layout = new HLayout(); | 107 HLayout layout = new HLayout(); |