Changeset 6471 in josm
- Timestamp:
- 2013-12-11T00:51:08+01:00 (11 years ago)
- Location:
- trunk
- Files:
-
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r6453 r6471 18 18 import java.net.URI; 19 19 import java.net.URISyntaxException; 20 import java.net.URL; 20 21 import java.text.MessageFormat; 21 22 import java.util.ArrayList; … … 54 55 import org.openstreetmap.josm.data.Bounds; 55 56 import org.openstreetmap.josm.data.Preferences; 57 import org.openstreetmap.josm.data.ServerSidePreferences; 56 58 import org.openstreetmap.josm.data.UndoRedoHandler; 57 59 import org.openstreetmap.josm.data.coor.CoordinateFormat; … … 335 337 336 338 /** 339 * Initializes {@code Main.pref} in applet context. 340 * @param serverURL The server URL hosting the user preferences. 341 * @since 6471 342 */ 343 public static void initAppletPreferences(URL serverURL) { 344 Main.pref = new ServerSidePreferences(serverURL); 345 } 346 347 /** 348 * Initializes {@code Main.pref} in normal application context. 349 * @since 6471 350 */ 351 public static void initApplicationPreferences() { 352 Main.pref = new Preferences(); 353 } 354 355 /** 337 356 * Set or clear (if passed <code>null</code>) the map. 338 357 * @param map The map to set {@link Main#map} to. Can be null. -
trunk/src/org/openstreetmap/josm/gui/MainApplet.java
r6380 r6471 101 101 Main.platform.preStartupHook(); 102 102 103 Main. pref = new ServerSidePreferences(getCodeBase());103 Main.initAppletPreferences(getCodeBase()); 104 104 105 105 String lang = getParameter("language"); … … 166 166 Main.applet = true; 167 167 MainApplet applet = new MainApplet(); 168 Main. pref = new ServerSidePreferences(applet.getCodeBase());168 Main.initAppletPreferences(applet.getCodeBase()); 169 169 applet.setStub(new AppletStub() { 170 170 @Override -
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r6453 r6471 273 273 } 274 274 275 Main.pref = newPreferences();275 initApplicationPreferences(); 276 276 277 277 Policy.setPolicy(new Policy() { -
trunk/test/functional/org/openstreetmap/josm/fixtures/JOSMFixture.java
r5556 r6471 58 58 } 59 59 System.setProperty("josm.home", josmHome); 60 Main. pref = newPreferences();60 Main.initApplicationPreferences(); 61 61 I18n.init(); 62 62 // initialize the plaform hook, and -
trunk/test/unit/org/openstreetmap/josm/actions/search/SearchCompilerTest.java
r6429 r6471 13 13 @Before 14 14 public void setUp() throws Exception { 15 Main. pref = newPreferences();15 Main.initApplicationPreferences(); 16 16 } 17 17 -
trunk/test/unit/org/openstreetmap/josm/corrector/ReverseWayTagCorrectorTest.java
r5787 r6471 19 19 @BeforeClass 20 20 public static void setUp() { 21 Main. pref = newPreferences();21 Main.initApplicationPreferences(); 22 22 } 23 23 -
trunk/test/unit/org/openstreetmap/josm/data/osm/APIDataSetTest.java
r3577 r6471 19 19 @BeforeClass 20 20 public static void init() { 21 Main. pref = newPreferences();21 Main.initApplicationPreferences(); 22 22 } 23 23 -
trunk/test/unit/org/openstreetmap/josm/data/osm/DataSetMergerTest.java
r5556 r6471 63 63 @BeforeClass 64 64 public static void init() { 65 Main. pref = newPreferences();65 Main.initApplicationPreferences(); 66 66 } 67 67 -
trunk/test/unit/org/openstreetmap/josm/data/osm/FilterTest.java
r6334 r6471 30 30 public static void setUp() { 31 31 Main.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator 32 Main. pref = newPreferences();32 Main.initApplicationPreferences(); 33 33 } 34 34 -
trunk/test/unit/org/openstreetmap/josm/data/osm/OsmPrimitiveKeyHandling.java
r3577 r6471 19 19 @BeforeClass 20 20 public static void init() { 21 Main. pref = newPreferences();21 Main.initApplicationPreferences(); 22 22 } 23 23 -
trunk/test/unit/org/openstreetmap/josm/data/osm/OsmPrimitiveTest.java
r5556 r6471 17 17 @BeforeClass 18 18 public static void init() { 19 Main. pref = newPreferences();19 Main.initApplicationPreferences(); 20 20 } 21 21 -
trunk/test/unit/org/openstreetmap/josm/data/osm/QuadBucketsTest.java
r5556 r6471 24 24 @BeforeClass 25 25 public static void init() { 26 Main. pref = newPreferences();26 Main.initApplicationPreferences(); 27 27 } 28 28 -
trunk/test/unit/org/openstreetmap/josm/data/osm/RelationTest.java
r5556 r6471 17 17 public static void setUp() { 18 18 Main.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator 19 Main. pref = newPreferences();19 Main.initApplicationPreferences(); 20 20 } 21 21 -
trunk/test/unit/org/openstreetmap/josm/data/osm/visitor/MergeSourceBuildingVisitorTest.java
r5556 r6471 38 38 public static void setUp() { 39 39 Main.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator 40 Main. pref = newPreferences();40 Main.initApplicationPreferences(); 41 41 } 42 42 -
trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java
r6334 r6471 149 149 @BeforeClass 150 150 public static void setUp() { 151 Main. pref = newPreferences();151 Main.initApplicationPreferences(); 152 152 } 153 153 -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/DuplicateNodeTest.java
r6226 r6471 25 25 public static void setUp() { 26 26 Main.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator 27 Main. pref = newPreferences();27 Main.initApplicationPreferences(); 28 28 } 29 29 -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/OpeningHourTestTest.java
r6420 r6471 22 22 @Before 23 23 public void setUp() throws Exception { 24 Main. pref = newPreferences();24 Main.initApplicationPreferences(); 25 25 OPENING_HOUR_TEST.initialize(); 26 26 } -
trunk/test/unit/org/openstreetmap/josm/gui/SystemOfMeasurementTest.java
r6422 r6471 23 23 @BeforeClass 24 24 public static void setUp() { 25 Main. pref = newPreferences();25 Main.initApplicationPreferences(); 26 26 } 27 27 -
trunk/test/unit/org/openstreetmap/josm/gui/conflict/nodes/NodeListMergeModelTest.java
r5299 r6471 32 32 @BeforeClass 33 33 public static void init() { 34 Main. pref = newPreferences();34 Main.initApplicationPreferences(); 35 35 } 36 36 -
trunk/test/unit/org/openstreetmap/josm/gui/conflict/properties/PropertiesMergeModelTest.java
r5556 r6471 48 48 public static void init() { 49 49 Main.setProjection(Projections.getProjectionByCode("EPSG:4326")); 50 Main. pref = newPreferences();50 Main.initApplicationPreferences(); 51 51 } 52 52 -
trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/TagMergeItemTest.java
r3577 r6471 18 18 @BeforeClass 19 19 public static void init() { 20 Main. pref = newPreferences();20 Main.initApplicationPreferences(); 21 21 } 22 22 -
trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/TagMergeModelTest.java
r3577 r6471 24 24 @BeforeClass 25 25 public static void init() { 26 Main. pref = newPreferences();26 Main.initApplicationPreferences(); 27 27 } 28 28 -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSorterTest.java
r6461 r6471 26 26 @BeforeClass 27 27 public static void loadData() throws FileNotFoundException, IllegalDataException { 28 Main. pref = newPreferences();28 Main.initApplicationPreferences(); 29 29 Main.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator 30 30 testDataset = OsmReader.parseDataSet(new FileInputStream("data_nodist/relation_sort.osm"), NullProgressMonitor.INSTANCE); -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionTypeCalculatorTest.java
r6467 r6471 27 27 @BeforeClass 28 28 public static void loadData() throws FileNotFoundException, IllegalDataException { 29 Main. pref = newPreferences();29 Main.initApplicationPreferences(); 30 30 Main.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator 31 31 testDataset = OsmReader.parseDataSet(new FileInputStream("data_nodist/relation_sort.osm"), NullProgressMonitor.INSTANCE); -
trunk/test/unit/org/openstreetmap/josm/gui/tagging/TaggingPresetReaderTest.java
r6208 r6471 23 23 @BeforeClass 24 24 public static void setUpClass() { 25 Main. pref = newPreferences();25 Main.initApplicationPreferences(); 26 26 testdataroot = System.getProperty("josm.test.data"); 27 27 if (testdataroot == null || testdataroot.isEmpty()) { -
trunk/test/unit/org/openstreetmap/josm/tools/TextTagParserTest.java
r5756 r6471 15 15 @BeforeClass 16 16 public static void before() { 17 Main. pref = newPreferences();17 Main.initApplicationPreferences(); 18 18 } 19 19 -
trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java
r6421 r6471 74 74 @Test 75 75 public void testOpenUrlGzip() throws Exception { 76 Main. pref = newPreferences();76 Main.initApplicationPreferences(); 77 77 final BufferedReader x = Utils.openURLReaderAndDecompress(new URL("http://www.openstreetmap.org/trace/1613906/data"), true); 78 78 Assert.assertTrue(x.readLine().startsWith("<?xml version=")); … … 82 82 @Test 83 83 public void testOpenUrlBzip() throws Exception { 84 Main. pref = newPreferences();84 Main.initApplicationPreferences(); 85 85 final BufferedReader x = Utils.openURLReaderAndDecompress(new URL("http://www.openstreetmap.org/trace/785544/data"), true); 86 86 Assert.assertTrue(x.readLine().startsWith("<?xml version=")); -
trunk/test/unit/org/openstreetmap/josm/tools/template_engine/TemplateEngineTest.java
r6289 r6471 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.tools.template_engine; 3 4 3 5 4 import java.util.Arrays; … … 12 11 import org.openstreetmap.josm.actions.search.SearchCompiler; 13 12 import org.openstreetmap.josm.actions.search.SearchCompiler.Match; 14 import org.openstreetmap.josm.data.Preferences;15 13 import org.openstreetmap.josm.data.osm.DatasetFactory; 16 14 import org.openstreetmap.josm.data.osm.Node; … … 23 21 @BeforeClass 24 22 public static void before() { 25 Main. pref = newPreferences();23 Main.initApplicationPreferences(); 26 24 } 27 25
Note:
See TracChangeset
for help on using the changeset viewer.