Mercurial > dive4elements > river
annotate gwt-client/src/main/java/org/dive4elements/river/client/shared/Transform2D.java @ 7242:69709f490d92
Polish labels and remove unused classes. SQOverview is currently broken.
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Fri, 04 Oct 2013 17:56:02 +0200 |
parents | ea9eef426962 |
children |
rev | line source |
---|---|
5861
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
2 * Software engineering by Intevation GmbH |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
3 * |
5993
ea9eef426962
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5861
diff
changeset
|
4 * This file is Free Software under the GNU AGPL (>=v3) |
5861
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
5993
ea9eef426962
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5861
diff
changeset
|
6 * documentation coming with Dive4Elements River for details. |
5861
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
7 */ |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
8 |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
9 package org.dive4elements.river.client.shared; |
535
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 import java.io.Serializable; |
1598
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
12 import java.util.Date; |
535
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 |
610
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
535
diff
changeset
|
14 import com.google.gwt.core.client.GWT; |
1598
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
15 import com.google.gwt.i18n.client.DateTimeFormat; |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
16 import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat; |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
17 import com.google.gwt.i18n.client.NumberFormat; |
610
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
535
diff
changeset
|
18 |
535
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
19 |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 /** |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
21 * This object supports a linear transformation to transform xy coordinates into |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
22 * an other coordinate system based on scale and translation values. |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 * |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 */ |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 public class Transform2D implements Serializable { |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 |
1598
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
28 protected String xType; |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
29 protected String yType; |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
30 |
535
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 protected double sx; |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 protected double sy; |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 protected double tx; |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 protected double ty; |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 public Transform2D() { |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 } |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
40 |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 /** |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
43 * Creates a new transformation with scale and translation factors. |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 * |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
45 * @param sx The scale factor for the x axis. |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 * @param sy The scale factor for the y axis. |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 * @param tx The translation factor for the x axis. |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 * @param ty The translation factor for the y axis. |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 */ |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 public Transform2D(double sx, double sy, double tx, double ty) { |
1598
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
51 this(sx, sy, tx, ty, "number", "number"); |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
52 } |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
53 |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
54 |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
55 public Transform2D( |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
56 double sx, double sy, |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
57 double tx, double ty, |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
58 String xType, |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
59 String yType |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
60 ) { |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
61 this.xType = xType; |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
62 this.yType = yType; |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
63 |
535
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 this.sx = sx; |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 this.sy = sy; |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 this.tx = tx; |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 this.ty = ty; |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 } |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 /** |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 * Transforms the pixel x and y into a new coordinate system based on the |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
73 * scale and translation values specified in the constructor. |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
74 */ |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
75 public double[] transform(double x, double y) { |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
76 double resX = sx * x + tx; |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 double resY = sy * y + ty; |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 return new double[] { resX, resY }; |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 } |
610
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
535
diff
changeset
|
81 |
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
535
diff
changeset
|
82 |
1598
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
83 public String[] format(Number[] xy) { |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
84 String x = null; |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
85 String y = null; |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
86 |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
87 if (xType.equals("date")) { |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
88 x = formatDate(xy[0].longValue()); |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
89 } |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
90 else { |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
91 x = formatNumber(xy[0].doubleValue()); |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
92 } |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
93 |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
94 if (yType.equals("date")) { |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
95 y = formatDate(xy[1].longValue()); |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
96 } |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
97 else { |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
98 y = formatNumber(xy[1].doubleValue()); |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
99 } |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
100 |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
101 return new String[] { x, y }; |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
102 } |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
103 |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
104 |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
105 protected String formatDate(long time) { |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
106 Date date = new Date(time); |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
107 DateTimeFormat df = getDateTimeFormat(); |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
108 |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
109 return df.format(date); |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
110 } |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
111 |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
112 |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
113 protected String formatNumber(double number) { |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
114 NumberFormat nf = getNumberFormat(); |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
115 |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
116 return nf.format(number); |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
117 } |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
118 |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
119 |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
120 public DateTimeFormat getDateTimeFormat() { |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
121 return DateTimeFormat.getFormat(PredefinedFormat.DATE_SHORT); |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
122 } |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
123 |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
124 |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
125 public NumberFormat getNumberFormat() { |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
126 return NumberFormat.getDecimalFormat(); |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
127 } |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
128 |
ef745bc6bed9
Distinguish between numbers and dates while parsing chart info documents; the MousePosition panel now displays the position on date axes correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
610
diff
changeset
|
129 |
610
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
535
diff
changeset
|
130 public void dumpGWT() { |
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
535
diff
changeset
|
131 GWT.log("SX = " + sx); |
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
535
diff
changeset
|
132 GWT.log("SY = " + sy); |
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
535
diff
changeset
|
133 GWT.log("TX = " + tx); |
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
535
diff
changeset
|
134 GWT.log("TY = " + ty); |
ea2191b1299d
#170 Changed the DOM manipulation while zoom and drag operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
535
diff
changeset
|
135 } |
535
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
136 } |
017371801479
Added a chart info service to fetch the info document for a specific chart from artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
137 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |