Changeset 9981 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2016-03-13T17:25:42+01:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java
r9952 r9981 323 323 // "operator" (null) should mean the same as "operator()" 324 324 // (Always). I.e. match everything 325 this.match = new Always();325 this.match = Always.INSTANCE; 326 326 } else { 327 327 this.match = match; … … 372 372 */ 373 373 public static class Never extends TaggedMatch { 374 /** The unique instance/ */ 375 public static final Never INSTANCE = new Never(); 374 376 @Override 375 377 public boolean match(Tagged osm) { … … 1612 1614 throw new ParseError(tr("Unexpected token: {0}", tokenizer.nextToken())); 1613 1615 if (m == null) 1614 m = new Always();1616 m = Always.INSTANCE; 1615 1617 Main.debug("Parsed search expression is {0}", m); 1616 1618 return m; -
trunk/src/org/openstreetmap/josm/data/projection/ProjectionConfigurationException.java
r8378 r9981 3 3 4 4 public class ProjectionConfigurationException extends Exception { 5 6 /**7 * Constructs a new {@code ProjectionConfigurationException}.8 */9 public ProjectionConfigurationException() {10 super();11 }12 5 13 6 /** -
trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2GridShift.java
r9230 r9981 335 335 subGridName = string; 336 336 } 337 338 /**339 * Make this object a copy of the supplied GridShift340 * @param gs grid to copy data from341 */342 public void copy(NTV2GridShift gs) {343 this.lon = gs.lon;344 this.lat = gs.lat;345 this.lonShift = gs.lonShift;346 this.latShift = gs.latShift;347 this.lonAccuracy = gs.lonAccuracy;348 this.latAccuracy = gs.latAccuracy;349 this.latAccuracyAvailable = gs.latAccuracyAvailable;350 this.lonAccuracyAvailable = gs.lonAccuracyAvailable;351 this.subGridName = gs.subGridName;352 }353 354 337 } -
trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2GridShiftFile.java
r8870 r9981 61 61 * 62 62 * @author Peter Yuill 63 * Modifi fied for JOSM :63 * Modified for JOSM : 64 64 * - removed the RandomAccessFile mode (Pieren) 65 65 */ … … 267 267 } 268 268 return sub; 269 }270 271 public boolean isLoaded() {272 return topLevelSubGrid != null;273 }274 275 public void unload() {276 topLevelSubGrid = null;277 269 } 278 270 … … 304 296 } 305 297 306 /**307 * Get a copy of the SubGrid tree for this file.308 *309 * @return a deep clone of the current SubGrid tree310 */311 public NTV2SubGrid[] getSubGridTree() {312 NTV2SubGrid[] clone = new NTV2SubGrid[topLevelSubGrid.length];313 for (int i = 0; i < topLevelSubGrid.length; i++) {314 clone[i] = (NTV2SubGrid) topLevelSubGrid[i].clone();315 }316 return clone;317 }318 319 298 public String getFromEllipsoid() { 320 299 return fromEllipsoid; -
trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2SubGrid.java
r9067 r9981 36 36 * - read grid file by single bytes. Workaround for a bug in some VM not supporting 37 37 * file reading by group of 4 bytes from a jar file. 38 * - removed the Cloneable interface 38 39 */ 39 public class NTV2SubGrid implements Cloneable,Serializable {40 public class NTV2SubGrid implements Serializable { 40 41 41 42 private static final long serialVersionUID = 1L; … … 276 277 } 277 278 278 public NTV2SubGrid getSubGrid(int index) {279 return (subGrid == null) ? null : subGrid[index];280 }281 282 279 /** 283 280 * Set an array of Sub Grids of this sub grid … … 324 321 325 322 /** 326 * Make a deep clone of this Sub Grid327 */328 @Override329 public Object clone() {330 NTV2SubGrid clone = null;331 try {332 clone = (NTV2SubGrid) super.clone();333 // Do a deep clone of the sub grids334 if (subGrid != null) {335 clone.subGrid = new NTV2SubGrid[subGrid.length];336 for (int i = 0; i < subGrid.length; i++) {337 clone.subGrid[i] = (NTV2SubGrid) subGrid[i].clone();338 }339 }340 } catch (CloneNotSupportedException cnse) {341 Main.warn(cnse);342 }343 return clone;344 }345 346 /**347 323 * Get maximum latitude value 348 324 * @return maximum latitude -
trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2Util.java
r8510 r9981 19 19 */ 20 20 package org.openstreetmap.josm.data.projection.datum; 21 22 import org.openstreetmap.josm.Main;23 21 24 22 /** … … 104 102 return Double.longBitsToDouble(l); 105 103 } 106 107 /**108 * Does the current VM support the New IO api109 * @return true or false110 */111 public static boolean isNioAvailable() {112 boolean nioAvailable = false;113 try {114 Class.forName("java.nio.channels.FileChannel");115 nioAvailable = true;116 } catch (NoClassDefFoundError | ClassNotFoundException cnfe) {117 Main.info(cnfe.getMessage());118 }119 return nioAvailable;120 }121 104 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/RecentTagCollection.java
r9940 r9981 26 26 } 27 27 }; 28 tagsToIgnore = new SearchCompiler.Never();28 tagsToIgnore = SearchCompiler.Never.INSTANCE; 29 29 } 30 30 … … 73 73 74 74 public void setTagsToIgnore(SearchAction.SearchSetting tagsToIgnore) throws SearchCompiler.ParseError { 75 setTagsToIgnore(tagsToIgnore.text.isEmpty() ? new SearchCompiler.Never(): SearchCompiler.compile(tagsToIgnore));75 setTagsToIgnore(tagsToIgnore.text.isEmpty() ? SearchCompiler.Never.INSTANCE : SearchCompiler.compile(tagsToIgnore)); 76 76 } 77 77 -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
r9940 r9981 310 310 warnAboutParseError(parseError); 311 311 tagsToIgnore = new SearchAction.SearchSetting(); 312 recentTags.setTagsToIgnore( new SearchCompiler.Never());312 recentTags.setTagsToIgnore(SearchCompiler.Never.INSTANCE); 313 313 } 314 314 } -
trunk/src/org/openstreetmap/josm/gui/widgets/CompileSearchTextDecorator.java
r9978 r9981 45 45 textComponent.setBackground(new Color(255, 224, 224)); 46 46 textComponent.setToolTipText(ex.getMessage()); 47 filter = new SearchCompiler.Always();47 filter = SearchCompiler.Always.INSTANCE; 48 48 } 49 49 textComponent.firePropertyChange("filter", 0, 1);
Note:
See TracChangeset
for help on using the changeset viewer.