comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/MousePositionPanel.java @ 1598:ef745bc6bed9

Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly. flys-client/trunk@3931 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 06 Feb 2012 14:43:27 +0000
parents 78907f0fb939
children 936e3e6cd9b9
comparison
equal deleted inserted replaced
1597:8bbaa0d173cf 1598:ef745bc6bed9
73 /** 73 /**
74 * /Updates the X value displayed in the <i>x</i> label. 74 * /Updates the X value displayed in the <i>x</i> label.
75 * 75 *
76 * @param x the new x value. 76 * @param x the new x value.
77 */ 77 */
78 public void setX(double x) { 78 public void setX(String x) {
79 this.x.setContents(nf.format(x)); 79 this.x.setContents(x);
80 } 80 }
81 81
82 82
83 /** 83 /**
84 * /Updates the Y value displayed in the <i>y</i> label. 84 * /Updates the Y value displayed in the <i>y</i> label.
85 * 85 *
86 * @param y the new y value. 86 * @param y the new y value.
87 */ 87 */
88 public void setY(double y) { 88 public void setY(String y) {
89 this.y.setContents(nf.format(y)); 89 this.y.setContents(y);
90 } 90 }
91 91
92 92
93 /** 93 /**
94 * Listens to mouse move events to refresh the xy position. 94 * Listens to mouse move events to refresh the xy position.
119 int yOffset = chart.getPageTop(); 119 int yOffset = chart.getPageTop();
120 120
121 x = x - xOffset; 121 x = x - xOffset;
122 y = y - yOffset; 122 y = y - yOffset;
123 123
124 double[] xy = transformer.transform(x,y); 124 double[] xy = transformer.transform(x,y);
125 String[] xyStr = transformer.format(new Number[] {
126 new Double(xy[0]), new Double(xy[1]) });
125 127
126 setX(xy[0]); 128 setX(xyStr[0]);
127 setY(xy[1]); 129 setY(xyStr[1]);
128 } 130 }
129 } 131 }
130 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 132 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org