source: josm/trunk/src/org/openstreetmap/josm/data/coor/CoordinateFormat.java@ 3083

Last change on this file since 3083 was 3083, checked in by bastiK, 14 years ago

added svn:eol-style=native to source files

  • Property svn:eol-style set to native
File size: 1.5 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data.coor;
3
4import static org.openstreetmap.josm.tools.I18n.tr;
5
6/**
7 * An enumeration of coordinate formats
8 *
9 */
10public enum CoordinateFormat {
11
12 /**
13 * the decimal format 999.999
14 */
15 DECIMAL_DEGREES (tr("Decimal Degrees")),
16
17 /**
18 * the minutes/seconds format 99" 99'
19 */
20 DEGREES_MINUTES_SECONDS (tr("Degrees Minutes Seconds")),
21
22 /**
23 * coordinates East/North
24 */
25 EAST_NORTH (tr("Projected Coordinates"));
26
27 private String displayName;
28 private CoordinateFormat(String displayName) {
29 this.displayName = displayName;
30 }
31
32 /**
33 * Replies the display name of the format
34 *
35 * @return the display name
36 */
37 public String getDisplayName() {
38 return displayName;
39 }
40
41 @Override
42 public String toString() {
43 return getDisplayName();
44 }
45
46 private static CoordinateFormat defaultCoordinateFormat = DECIMAL_DEGREES;
47
48 /**
49 * Replies the default coordinate format to be use
50 *
51 * @return the default coordinate format
52 */
53 static public CoordinateFormat getDefaultFormat() {
54 return defaultCoordinateFormat;
55 }
56
57 /**
58 * Sets the default coordinate format
59 *
60 * @param format the default coordinate format
61 */
62 static public void setCoordinateFormat(CoordinateFormat format) {
63 if (format != null) {
64 defaultCoordinateFormat = format;
65 }
66 }
67}
Note: See TracBrowser for help on using the repository browser.