Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/MousePositionPanel.java @ 4038:0189d6b0973a
Cosmetics, refac.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Thu, 04 Oct 2012 16:43:18 +0200 |
parents | 6a8f83c538e3 |
children | 651b93c10dc5 |
comparison
equal
deleted
inserted
replaced
4037:52a280532c2f | 4038:0189d6b0973a |
---|---|
17 * Panel showing the mouse position in data space. | 17 * Panel showing the mouse position in data space. |
18 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | 18 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
19 */ | 19 */ |
20 public class MousePositionPanel extends HLayout implements MouseMoveHandler { | 20 public class MousePositionPanel extends HLayout implements MouseMoveHandler { |
21 | 21 |
22 /** Is associated to a ChartTab. */ | |
22 protected ChartOutputTab chartTab; | 23 protected ChartOutputTab chartTab; |
23 | |
24 protected NumberFormat nf; | |
25 | 24 |
26 protected HLayout xLayout; | 25 protected HLayout xLayout; |
27 protected ArrayList<HLayout> yLayouts; | 26 protected ArrayList<HLayout> yLayouts; |
27 | |
28 | 28 |
29 public MousePositionPanel(ChartOutputTab chartTab) { | 29 public MousePositionPanel(ChartOutputTab chartTab) { |
30 super(); | 30 super(); |
31 | 31 |
32 this.chartTab = chartTab; | 32 this.chartTab = chartTab; |
33 | |
34 nf = NumberFormat.getDecimalFormat(); | |
35 | 33 |
36 chartTab.getChartPanel().addMouseMoveHandler(this); | 34 chartTab.getChartPanel().addMouseMoveHandler(this); |
37 | 35 |
38 initLayout(); | 36 initLayout(); |
39 } | 37 } |
121 | 119 |
122 // Get the label for the coordinates. | 120 // Get the label for the coordinates. |
123 Canvas xLabel = xLayout.getMember(1); | 121 Canvas xLabel = xLayout.getMember(1); |
124 Canvas yLabel = yLayout.getMember(1); | 122 Canvas yLabel = yLayout.getMember(1); |
125 | 123 |
126 double[] xy = transformer.transform(x,y); | 124 double[] xy = transformer.transform(x, y); |
127 String[] xyStr = transformer.format(new Number[] { | 125 String[] xyStr = transformer.format(new Number[] { |
128 new Double(xy[0]), new Double(xy[1]) }); | 126 new Double(xy[0]), new Double(xy[1]) }); |
129 // Set the coordinates. | 127 // Set the coordinates. |
130 xLabel.setContents(xyStr[0]); | 128 xLabel.setContents(xyStr[0]); |
131 yLabel.setContents(xyStr[1]); | 129 yLabel.setContents(xyStr[1]); |