Changeset 3653 in josm for trunk/src/org
- Timestamp:
- 2010-11-14T17:54:23+01:00 (14 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/Node.java
r3430 r3653 234 234 235 235 public boolean isConnectionNode() { 236 return (OsmPrimitive.getFilteredList(getReferrers(), Way.class)).size() > 1;236 return isReferredByWays(2); 237 237 } 238 238 -
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r3471 r3653 1286 1286 } 1287 1287 1288 /** 1289 Return true, if this primitive is referred by at least n ways 1290 @param n Minimal number of ways to return true. Must be positive 1291 */ 1292 public final boolean isReferredByWays(int n) { 1293 // Count only referrers that are members of the same dataset (primitive can have some fake references, for example 1294 // when way is cloned 1295 Object referrers = this.referrers; 1296 if (referrers == null) return false; 1297 checkDataset(); 1298 if (referrers instanceof OsmPrimitive) { 1299 return n<=1 && referrers instanceof Way && ((OsmPrimitive)referrers).dataSet == dataSet; 1300 } else { 1301 int counter=0; 1302 for (OsmPrimitive o : (OsmPrimitive[])referrers) { 1303 if (dataSet == o.dataSet && o instanceof Way) { 1304 if (++counter >= n) 1305 return true; 1306 } 1307 } 1308 return false; 1309 } 1310 } 1311 1312 1288 1313 /*----------------- 1289 1314 * OTHER METHODS -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPaintVisitor.java
r3329 r3653 111 111 public void drawNode(Node n) { 112 112 /* check, if the node is visible at all */ 113 if((n.getEastNorth().east() > maxEN.east() ) || 114 (n.getEastNorth().north() > maxEN.north()) || 115 (n.getEastNorth().east() < minEN.east() ) || 116 (n.getEastNorth().north() < minEN.north())) 113 EastNorth en = n.getEastNorth(); 114 if((en.east() > maxEN.east() ) || 115 (en.north() > maxEN.north()) || 116 (en.east() < minEN.east() ) || 117 (en.north() < minEN.north())) 117 118 return; 118 119 -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPainter.java
r3565 r3653 216 216 public void drawNode(Node n, Color color, int size, boolean fill, String name) { 217 217 if (size > 1) { 218 Point p = nc.getPoint(n); 219 if ((p.x < 0) || (p.y < 0) || (p.x > nc.getWidth()) || (p.y > nc.getHeight())) return; 218 220 int radius = size / 2; 219 Point p = nc.getPoint(n);220 if ((p.x < 0) || (p.y < 0) || (p.x > nc.getWidth())221 || (p.y > nc.getHeight()))222 return;223 221 224 222 if (inactive || n.isDisabled()) { … … 228 226 } 229 227 if (fill) { 230 g.fillRect(p.x - radius, p.y - radius, size, size); 231 g.drawRect(p.x - radius, p.y - radius, size, size); 228 g.fillRect(p.x - radius, p.y - radius, size + 1, size + 1); 232 229 } else { 233 230 g.drawRect(p.x - radius, p.y - radius, size, size); -
trunk/src/org/openstreetmap/josm/gui/mappaint/SimpleNodeElemStyle.java
r3291 r3653 33 33 34 34 Color color; 35 boolean isConnection = n.isConnectionNode(); 35 36 36 37 if (painter.isInactive() || n.isDisabled()) { … … 38 39 } else if (selected) { 39 40 color = member ? settings.getRelationSelectedColor() : settings.getSelectedColor(); 40 } else if ( n.isConnectionNode()) {41 } else if (isConnection) { 41 42 if (n.isTagged()) { 42 43 color = settings.getTaggedConnectionColor(); … … 54 55 final int size = max((selected ? settings.getSelectedNodeSize() : 0), 55 56 (n.isTagged() ? settings.getTaggedNodeSize() : 0), 56 ( n.isConnectionNode()? settings.getConnectionNodeSize() : 0),57 (isConnection ? settings.getConnectionNodeSize() : 0), 57 58 settings.getUnselectedNodeSize()); 58 59 59 60 final boolean fill = (selected && settings.isFillSelectedNode()) || 60 61 (n.isTagged() && settings.isFillTaggedNode()) || 61 ( n.isConnectionNode()&& settings.isFillConnectionNode()) ||62 (isConnection && settings.isFillConnectionNode()) || 62 63 settings.isFillUnselectedNode(); 63 64
Note:
See TracChangeset
for help on using the changeset viewer.