Changeset 6093 in josm
- Timestamp:
- 2013-07-30T18:35:47+02:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 42 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AlignInLineAction.java
r6084 r6093 114 114 115 115 /// Only ways selected -> Align their nodes. 116 if ((selectedNodes. size() == 0) && (selectedWays.size() == 1)) { // TODO: handle multiple ways116 if ((selectedNodes.isEmpty()) && (selectedWays.size() == 1)) { // TODO: handle multiple ways 117 117 for (Way way : selectedWays) { 118 118 nodes.addAll(way.getNodes()); -
trunk/src/org/openstreetmap/josm/actions/CreateCircleAction.java
r6084 r6093 98 98 // special case if no single nodes are selected and exactly one way is: 99 99 // then use the way's nodes 100 if ( (nodes.size() == 0) && (sel.size() == 1)) {100 if (nodes.isEmpty() && (sel.size() == 1)) { 101 101 for (OsmPrimitive osm : sel) 102 102 if (osm instanceof Way) { -
trunk/src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java
r6084 r6093 266 266 } 267 267 268 if( affectedWays.size() > 0) {268 if(!affectedWays.isEmpty()) { 269 269 // reset key tag on affected ways 270 270 commands.add(new ChangePropertyCommand(affectedWays, key, null)); -
trunk/src/org/openstreetmap/josm/actions/DistributeAction.java
r6084 r6093 60 60 // special case if no single nodes are selected and exactly one way is: 61 61 // then use the way's nodes 62 if ( (nodes.size() == 0) && (sel.size() == 1)) {62 if (nodes.isEmpty() && (sel.size() == 1)) { 63 63 for (OsmPrimitive osm : sel) 64 64 if (osm instanceof Way) { … … 122 122 // Current number of node 123 123 int pos = 0; 124 while ( nodes.size() > 0) {124 while (!nodes.isEmpty()) { 125 125 pos++; 126 126 Node s = null; -
trunk/src/org/openstreetmap/josm/actions/FollowLineAction.java
r6069 r6093 96 96 } 97 97 Set<Node> points = toFollow.getNeighbours(last); 98 if (!points.remove(prev) || (points.size() == 0))98 if (!points.remove(prev) || points.isEmpty()) 99 99 continue; 100 100 if (points.size() > 1) // Ambiguous junction? -
trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java
r6049 r6093 198 198 199 199 public boolean hasWays() { 200 return availableWays.size() > 0;200 return !availableWays.isEmpty(); 201 201 } 202 202 … … 404 404 //find intersection points 405 405 Set<Node> nodes = Geometry.addIntersections(allStartingWays, true, cmds); 406 return nodes.size() > 0;406 return !nodes.isEmpty(); 407 407 } 408 408 … … 454 454 455 455 // Don't warn now, because it will really look corrupted 456 boolean warnAboutRelations = relations.size() > 0&& allStartingWays.size() > 1;456 boolean warnAboutRelations = !relations.isEmpty() && allStartingWays.size() > 1; 457 457 458 458 ArrayList<WayInPolygon> preparedWays = new ArrayList<WayInPolygon>(); … … 507 507 508 508 // Delete the discarded inner ways 509 if ( discardedWays.size() > 0) {509 if (!discardedWays.isEmpty()) { 510 510 Command deleteCmd = DeleteCommand.delete(Main.map.mapView.getEditLayer(), discardedWays, true); 511 511 if (deleteCmd != null) { … … 923 923 924 924 //process inner ways 925 if ( innerCandidates.size() > 0) {925 if (!innerCandidates.isEmpty()) { 926 926 List<PolygonLevel> innerList = findOuterWaysImpl(level + 1, innerCandidates); 927 927 result.addAll(innerList); -
trunk/src/org/openstreetmap/josm/actions/JoinNodeWayAction.java
r6084 r6093 47 47 // If the user has selected some ways, only join the node to these. 48 48 boolean restrictToSelectedWays = 49 getCurrentDataSet().getSelectedWays().size() > 0;49 !getCurrentDataSet().getSelectedWays().isEmpty(); 50 50 51 51 List<WaySegment> wss = Main.map.mapView.getNearestWaySegments( … … 74 74 for (Map.Entry<Way, List<Integer>> insertPoint : insertPoints.entrySet()) { 75 75 List<Integer> is = insertPoint.getValue(); 76 if (is. size() == 0) {76 if (is.isEmpty()) { 77 77 continue; 78 78 } … … 88 88 cmds.add(new ChangeCommand(w, wnew)); 89 89 } 90 if (cmds. size() == 0) return;90 if (cmds.isEmpty()) return; 91 91 Main.main.undoRedo.add(new SequenceCommand(tr("Join Node and Line"), cmds)); 92 92 Main.map.repaint(); -
trunk/src/org/openstreetmap/josm/actions/MirrorAction.java
r6084 r6093 51 51 } 52 52 53 if (nodes. size() == 0) {53 if (nodes.isEmpty()) { 54 54 JOptionPane.showMessageDialog( 55 55 Main.parent, -
trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java
r6084 r6093 108 108 } 109 109 } 110 if ( commands.size() > 0) {110 if (!commands.isEmpty()) { 111 111 Main.main.undoRedo.add(new SequenceCommand(tr("Orthogonalize / Undo"), commands)); 112 112 Main.map.repaint(); -
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r6085 r6093 517 517 518 518 // don't draw lines if shift is held 519 if ( selection.size() > 0&& !shift) {519 if (!selection.isEmpty() && !shift) { 520 520 Node selectedNode = null; 521 521 Way selectedWay = null; … … 1234 1234 * Handle special case: Self-Overlapping or closing way 1235 1235 */ 1236 if (getCurrentDataSet() != null && getCurrentDataSet().getSelectedWays().size() > 0&& !wayIsFinished && !alt) {1236 if (getCurrentDataSet() != null && !getCurrentDataSet().getSelectedWays().isEmpty() && !wayIsFinished && !alt) { 1237 1237 Way w = getCurrentDataSet().getSelectedWays().iterator().next(); 1238 1238 for (Node m : w.getNodes()) { -
trunk/src/org/openstreetmap/josm/actions/relation/DuplicateRelationAction.java
r5821 r6093 40 40 @Override 41 41 public void actionPerformed(ActionEvent e) { 42 if (!isEnabled() || relations. size()==0)42 if (!isEnabled() || relations.isEmpty()) 43 43 return; 44 44 Relation r = relations.iterator().next(); -
trunk/src/org/openstreetmap/josm/data/imagery/ImageryLayerInfo.java
r6087 r6093 42 42 43 43 public void load() { 44 boolean addedDefault = layers.size() != 0;44 boolean addedDefault = !layers.isEmpty(); 45 45 List<ImageryPreferenceEntry> entries = Main.pref.getListOfStructs("imagery.entries", null, ImageryPreferenceEntry.class); 46 46 if (entries != null) { … … 121 121 122 122 Collections.sort(defaultLayers); 123 Main.pref.putCollection("imagery.layers.default", defaultsSave.size() > 0 124 ? defaultsSave : defaults); 123 Main.pref.putCollection("imagery.layers.default", defaultsSave.isEmpty() ? defaults : defaultsSave); 125 124 } 126 125 -
trunk/src/org/openstreetmap/josm/data/imagery/WmsCache.java
r5874 r6093 269 269 index.setTotalFileSize(totalFileSize); 270 270 for (ProjectionEntries projectionEntries: entries.values()) { 271 if ( projectionEntries.entries.size() > 0) {271 if (!projectionEntries.entries.isEmpty()) { 272 272 ProjectionType projectionType = new ProjectionType(); 273 273 projectionType.setName(projectionEntries.projection); -
trunk/src/org/openstreetmap/josm/data/osm/MultipolygonCreate.java
r5909 r6093 256 256 257 257 //process inner ways 258 if ( innerCandidates.size() > 0) {258 if (!innerCandidates.isEmpty()) { 259 259 List<PolygonLevel> innerList = this.findOuterWaysRecursive(level + 1, innerCandidates); 260 260 if (innerList == null) { -
trunk/src/org/openstreetmap/josm/data/osm/QuadBuckets.java
r6084 r6093 175 175 return false; 176 176 boolean ret = this.content.remove(o); 177 if (this.content. size() == 0) {177 if (this.content.isEmpty()) { 178 178 this.content = null; 179 179 } … … 492 492 boolean canRemove() 493 493 { 494 if (content != null && content.size() > 0)494 if (content != null && !content.isEmpty()) 495 495 return false; 496 496 if (this.hasChildren()) -
trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2GridShiftFile.java
r5874 r6093 184 184 for (int i = 0; i < subGrid.length; i++) { 185 185 ArrayList<NTV2SubGrid> subSubGrids = subGridMap.get(subGrid[i].getSubGridName()); 186 if ( subSubGrids.size() > 0) {186 if (!subSubGrids.isEmpty()) { 187 187 NTV2SubGrid[] subGridArray = subSubGrids.toArray(nullArray); 188 188 subGrid[i].setSubGridArray(subGridArray); -
trunk/src/org/openstreetmap/josm/data/validation/tests/Coastlines.java
r4869 r6093 157 157 } 158 158 159 if ( highlight.size() > 0) {159 if (!highlight.isEmpty()) { 160 160 errors.add(new TestError(this, Severity.ERROR, tr("Unconnected coastline"), 161 161 UNCONNECTED_COASTLINE, primitives, highlight)); -
trunk/src/org/openstreetmap/josm/data/validation/tests/RelationChecker.java
r6068 r6093 109 109 } 110 110 } 111 if (allroles. size() == 0) {111 if (allroles.isEmpty()) { 112 112 errors.add( new TestError(this, Severity.WARNING, tr("Relation type is unknown"), 113 113 RELATION_UNKNOWN, n) ); -
trunk/src/org/openstreetmap/josm/gui/MultiSplitLayout.java
r6084 r6093 1193 1193 private static void addSplitChild(Split parent, Node child) { 1194 1194 List<Node> children = new ArrayList<Node>(parent.getChildren()); 1195 if (children. size() == 0) {1195 if (children.isEmpty()) { 1196 1196 children.add(child); 1197 1197 } -
trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
r6070 r6093 1539 1539 */ 1540 1540 public void setNewCursor(Cursor cursor, Object reference) { 1541 if( Cursors.size() > 0) {1541 if(!Cursors.isEmpty()) { 1542 1542 CursorInfo l = Cursors.getLast(); 1543 1543 if(l != null && l.cursor == cursor && l.object == reference) … … 1555 1555 */ 1556 1556 public void resetCursor(Object reference) { 1557 if(Cursors. size() == 0) {1557 if(Cursors.isEmpty()) { 1558 1558 setCursor(null); 1559 1559 return; … … 1562 1562 stripCursors(reference); 1563 1563 if(l != null && l.object == reference) { 1564 if(Cursors. size() == 0) {1564 if(Cursors.isEmpty()) { 1565 1565 setCursor(null); 1566 1566 } else { -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/CombinePrimitiveResolverDialog.java
r6084 r6093 259 259 260 260 TagCollection allResolutions = getTagConflictResolverModel().getAllResolutions(); 261 if ( allResolutions.size() > 0) {261 if (!allResolutions.isEmpty()) { 262 262 cmds.addAll(buildTagChangeCommand(targetPrimitive, allResolutions)); 263 263 } -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolutionUtil.java
r5700 r6093 39 39 int numNodesWithTags = 0; 40 40 for (OsmPrimitive p: merged) { 41 if ( p.getKeys().size() >0) {41 if (!p.getKeys().isEmpty()) { 42 42 numNodesWithTags++; 43 43 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/LatLonDialog.java
r6084 r6093 280 280 281 281 private void setOkEnabled(boolean b) { 282 if (buttons != null && buttons.size() > 0) {282 if (buttons != null && !buttons.isEmpty()) { 283 283 buttons.get(0).setEnabled(b); 284 284 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
r6085 r6093 841 841 } 842 842 add(data, BorderLayout.CENTER); 843 if ( buttons.size() > 0&& buttons.get(0) != null && !buttons.get(0).isEmpty()) {843 if (!buttons.isEmpty() && buttons.get(0) != null && !buttons.get(0).isEmpty()) { 844 844 buttonsPanel = new JPanel(new GridLayout(buttons.size(), 1)); 845 845 for (Collection<SideButton> buttonRow : buttons) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/DownloadRelationMemberTask.java
r6084 r6093 91 91 92 92 protected String buildDownloadFeedbackMessage() { 93 if (parents. size() == 0) {93 if (parents.isEmpty()) { 94 94 return trn("Downloading {0} incomplete object", 95 95 "Downloading {0} incomplete objects", -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java
r6084 r6093 551 551 // make the first selected member visible 552 552 // 553 if ( selectedIndices.size() > 0) {553 if (!selectedIndices.isEmpty()) { 554 554 fireMakeMemberVisible(Collections.min(selectedIndices)); 555 555 } … … 630 630 } 631 631 getSelectionModel().setValueIsAdjusting(false); 632 if ( getSelectedIndices().size() > 0) {632 if (!getSelectedIndices().isEmpty()) { 633 633 fireMakeMemberVisible(getSelectedIndices().get(0)); 634 634 } -
trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java
r6085 r6093 183 183 } 184 184 185 if ( data.tracks.size() > 0) {185 if (!data.tracks.isEmpty()) { 186 186 info.append("<table><thead align='center'><tr><td colspan='5'>" 187 187 + trn("{0} track", "{0} tracks", data.tracks.size(), data.tracks.size()) -
trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java
r6085 r6093 1387 1387 // Instantiating large TileSets is expensive. If there 1388 1388 // are no loaded tiles, don't bother even trying. 1389 if (ts2.allLoadedTiles(). size() == 0) {1389 if (ts2.allLoadedTiles().isEmpty()) { 1390 1390 newlyMissedTiles.add(missed); 1391 1391 continue; -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
r6090 r6093 470 470 } 471 471 472 if (gpxLst. size() == 0) {472 if (gpxLst.isEmpty()) { 473 473 gpxLst.add(new GpxDataWrapper(tr("<No GPX track loaded yet>"), null, null)); 474 474 } -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
r6084 r6093 239 239 Main.main.addLayer(layer); 240 240 241 if (! canceled && layer.data.size() > 0) {241 if (!canceled && !layer.data.isEmpty()) { 242 242 boolean noGeotagFound = true; 243 243 for (ImageEntry e : layer.data) { … … 633 633 634 634 public void showPreviousPhoto() { 635 if (data != null && data.size() > 0) {635 if (data != null && !data.isEmpty()) { 636 636 currentPhoto--; 637 637 if (currentPhoto < 0) { -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/MarkersFromNamedPointsAction.java
r6070 r6093 40 40 } 41 41 MarkerLayer ml = new MarkerLayer(namedTrackPoints, tr("Named Trackpoints from {0}", layer.getName()), layer.getAssociatedFile(), layer); 42 if ( ml.data.size() > 0) {42 if (!ml.data.isEmpty()) { 43 43 Main.main.addLayer(ml); 44 44 } -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
r6074 r6093 215 215 } 216 216 p.add(items, GBC.eol().fill()); 217 if (selected. size() == 0&& !supportsRelation()) {217 if (selected.isEmpty() && !supportsRelation()) { 218 218 GuiHelper.setEnabledRec(items, false); 219 219 } … … 331 331 } 332 332 333 answer = new PresetDialog(p, title, (ImageIcon) getValue(Action.SMALL_ICON), (sel.size() == 0)).getValue();333 answer = new PresetDialog(p, title, (ImageIcon) getValue(Action.SMALL_ICON), sel.isEmpty()).getValue(); 334 334 } 335 335 if (!showNewRelation && answer == 2) … … 350 350 */ 351 351 public Collection<OsmPrimitive> createSelection(Collection<OsmPrimitive> participants) { 352 originalSelectionEmpty = participants. size() == 0;352 originalSelectionEmpty = participants.isEmpty(); 353 353 Collection<OsmPrimitive> sel = new LinkedList<OsmPrimitive>(); 354 354 for (OsmPrimitive osm : participants) -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java
r6087 r6093 358 358 public boolean addToPanel(JPanel p, Collection<OsmPrimitive> sel) { 359 359 p.add(new JLabel(" "), GBC.eol()); // space 360 if ( roles.size() > 0) {360 if (!roles.isEmpty()) { 361 361 JPanel proles = new JPanel(new GridBagLayout()); 362 362 proles.add(new JLabel(tr("Available roles")), GBC.std().insets(0, 0, 10, 0)); -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetReader.java
r6074 r6093 101 101 lastrole = null; 102 102 } else { 103 if ( all.size() != 0) {103 if (!all.isEmpty()) { 104 104 if (o instanceof TaggingPresetItems.Roles) { 105 105 all.getLast().data.add((TaggingPresetItem) o); -
trunk/src/org/openstreetmap/josm/io/NMEAImporter.java
r6084 r6093 41 41 if (Main.pref.getBoolean("marker.makeautomarkers", true)) { 42 42 MarkerLayer ml = new MarkerLayer(r.data, tr("Markers from {0}", fn), fileFinal, gpxLayer); 43 if ( ml.data.size() > 0) {43 if (!ml.data.isEmpty()) { 44 44 Main.main.addLayer(ml); 45 45 } -
trunk/src/org/openstreetmap/josm/io/OsmReader.java
r6070 r6093 232 232 } 233 233 } 234 if (w.isDeleted() && nodeIds.size() > 0) {234 if (w.isDeleted() && !nodeIds.isEmpty()) { 235 235 System.out.println(tr("Deleted way {0} contains nodes", w.getUniqueId())); 236 236 nodeIds = new ArrayList<Long>(); … … 279 279 } 280 280 } 281 if (r.isDeleted() && members.size() > 0) {281 if (r.isDeleted() && !members.isEmpty()) { 282 282 System.out.println(tr("Deleted relation {0} contains members", r.getUniqueId())); 283 283 members = new ArrayList<RelationMemberData>(); -
trunk/src/org/openstreetmap/josm/io/session/GeoImageSessionImporter.java
r6070 r6093 80 80 GpxLayer gpxLayer = null; 81 81 List<SessionReader.LayerDependency> deps = support.getLayerDependencies(); 82 if ( deps.size() > 0) {82 if (!deps.isEmpty()) { 83 83 Layer layer = deps.iterator().next().getLayer(); 84 84 if (layer instanceof GpxLayer) { -
trunk/src/org/openstreetmap/josm/io/session/MarkerSessionImporter.java
r6087 r6093 48 48 GpxLayer gpxLayer = null; 49 49 List<SessionReader.LayerDependency> deps = support.getLayerDependencies(); 50 if ( deps.size() > 0) {50 if (!deps.isEmpty()) { 51 51 Layer layer = deps.iterator().next().getLayer(); 52 52 if (layer instanceof GpxLayer) { -
trunk/src/org/openstreetmap/josm/io/session/SessionWriter.java
r5874 r6093 197 197 } 198 198 Set<Layer> deps = dependencies.get(layer); 199 if ( deps.size() > 0) {199 if (!deps.isEmpty()) { 200 200 List<Integer> depsInt = new ArrayList<Integer>(); 201 201 for (Layer depLayer : deps) { -
trunk/src/org/openstreetmap/josm/tools/Geometry.java
r6070 r6093 173 173 } 174 174 } 175 else if (test && intersectionNodes.size() > 0)175 else if (test && !intersectionNodes.isEmpty()) 176 176 return intersectionNodes; 177 177 } -
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r6087 r6093 425 425 String cache_name = full_name; 426 426 /* cache separately */ 427 if (dirs != null && dirs.size() > 0) {427 if (dirs != null && !dirs.isEmpty()) { 428 428 cache_name = "id:" + id + ":" + full_name; 429 429 if(archive != null) { -
trunk/src/org/openstreetmap/josm/tools/Utils.java
r6070 r6093 443 443 T parentless = null; 444 444 for (T key : deps.keySet()) { 445 if (deps.get(key). size() == 0) {445 if (deps.get(key).isEmpty()) { 446 446 parentless = key; 447 447 break;
Note:
See TracChangeset
for help on using the changeset viewer.