Changeset 4724 in josm for trunk/src/org/openstreetmap/josm/data/osm
- Timestamp:
- 2011-12-27T16:31:36+01:00 (12 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/osm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r4580 r4724 208 208 209 209 /* 210 * Holding bin for changeset tag information, to be applied when or if this is ever uploaded.211 */210 * Holding bin for changeset tag information, to be applied when or if this is ever uploaded. 211 */ 212 212 private Map<String, String> changeSetTags = new HashMap<String, String>(); 213 213 … … 586 586 selectedPrimitives = new LinkedHashSet<OsmPrimitive>(); 587 587 changed = addSelected(selection, false) 588 || (!wasEmpty && selectedPrimitives.isEmpty());588 || (!wasEmpty && selectedPrimitives.isEmpty()); 589 589 if (changed) { 590 590 selectionSnapshot = null; … … 783 783 } 784 784 785 /**786 *787 * @param primitiveId788 * @param createNew789 * @return790 * @deprecated This method can created inconsistent dataset when called for node with id < 0 and createNew=true. That will add791 * complete node without coordinates to dataset which is not allowed.792 */793 @Deprecated794 public OsmPrimitive getPrimitiveById(PrimitiveId primitiveId, boolean createNew) {795 OsmPrimitive result = primitivesMap.get(primitiveId);796 797 if (result == null && createNew) {798 switch (primitiveId.getType()) {799 case NODE: result = new Node(primitiveId.getUniqueId(), true); break;800 case WAY: result = new Way(primitiveId.getUniqueId(), true); break;801 case RELATION: result = new Relation(primitiveId.getUniqueId(), true); break;802 }803 addPrimitive(result);804 }805 806 return result;807 }808 785 809 786 /** … … 1175 1152 return ret; 1176 1153 } 1177 1154 1178 1155 /** 1179 1156 * Moves all primitives and datasources from DataSet "from" to this DataSet -
trunk/src/org/openstreetmap/josm/data/osm/NodeData.java
r4431 r4724 23 23 24 24 private boolean isLatLonKnown() { 25 return lat != Double.NaN && lon != Double.NaN;25 return !Double.isNaN(lat) && !Double.isNaN(lon); 26 26 } 27 27 -
trunk/src/org/openstreetmap/josm/data/osm/PrimitiveData.java
r4099 r4724 3 3 4 4 import java.util.ArrayList; 5 import java.util.Arrays; 5 6 import java.util.Collection; 6 7 import java.util.List; … … 27 28 this.id = id; 28 29 } 29 30 30 31 public void setVersion(int version) { 31 32 this.version = version; 32 33 } 33 34 34 35 /** 35 36 * override to make it public … … 45 46 public String toString() { 46 47 StringBuilder builder = new StringBuilder(); 47 builder.append(id).append( keys).append(getFlagsAsString());48 builder.append(id).append(Arrays.toString(keys)).append(getFlagsAsString()); 48 49 return builder.toString(); 49 50 } -
trunk/src/org/openstreetmap/josm/data/osm/history/History.java
r4602 r4724 71 71 } 72 72 } 73 );73 ); 74 74 return new History(id, type, copy); 75 75 } … … 84 84 } 85 85 } 86 );86 ); 87 87 return new History(id, type,copy); 88 88 } … … 96 96 } 97 97 } 98 );98 ); 99 99 } 100 100 … … 107 107 } 108 108 } 109 );109 ); 110 110 } 111 111 … … 122 122 } 123 123 } 124 );124 ); 125 125 } 126 126 … … 133 133 } 134 134 } 135 );135 ); 136 136 } 137 137 … … 140 140 } 141 141 142 public History forUser(final String user) {143 return filter(144 this,145 new FilterPredicate() {146 public boolean matches(HistoryOsmPrimitive primitive) {147 return primitive.getUser().equals(user);148 }149 }150 );151 }152 153 142 public History forUserId(final long uid) { 154 143 return filter( … … 159 148 } 160 149 } 161 );150 ); 162 151 } 163 152 -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPainter.java
r4627 r4724 252 252 * represent a line that is shifted by a certain offset perpendicular 253 253 * to the way direction. 254 * 254 * 255 255 * There is no intention, to handle consecutive duplicate Nodes in a 256 256 * perfect way, but it is should not throw an exception. … … 328 328 int m = dx_next*(y_current0 - y_prev0) - dy_next*(x_current0 - x_prev0); 329 329 330 int cx_ = x_prev0 + Math.round( m * dx_prev / det);331 int cy_ = y_prev0 + Math.round( m * dy_prev / det);330 int cx_ = x_prev0 + Math.round((float)m * dx_prev / det); 331 int cy_ = y_prev0 + Math.round((float)m * dy_prev / det); 332 332 ++idx; 333 333 prev = current; … … 809 809 810 810 Shape area = path.createTransformedShape(nc.getAffineTransform()); 811 811 812 812 if (!isOutlineOnly) { 813 813 if (fillImage == null) { … … 816 816 } else { 817 817 TexturePaint texture = new TexturePaint(fillImage, 818 // new Rectangle(polygon.xpoints[0], polygon.ypoints[0], fillImage.getWidth(), fillImage.getHeight()));819 new Rectangle(0, 0, fillImage.getWidth(), fillImage.getHeight()));818 // new Rectangle(polygon.xpoints[0], polygon.ypoints[0], fillImage.getWidth(), fillImage.getHeight())); 819 new Rectangle(0, 0, fillImage.getWidth(), fillImage.getHeight())); 820 820 g.setPaint(texture); 821 821 if (fillImageAlpha != 1f) { … … 858 858 859 859 if ((pb.width >= nb.getWidth() && pb.height >= nb.getHeight()) && // quick check 860 area.contains(centeredNBounds) // slow but nice861 ) {860 area.contains(centeredNBounds) // slow but nice 861 ) { 862 862 g.setColor(text.color); 863 863 Font defaultFont = g.getFont();
Note:
See TracChangeset
for help on using the changeset viewer.