- Timestamp:
- 2009-08-03T21:37:45+02:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java
r1862 r1899 153 153 Node c = new Node(selectedNode); 154 154 c.keys = null; 155 c.se lected = false;155 c.setSelected(false); 156 156 cmds.add(new ChangeCommand(selectedNode, c)); 157 157 -
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r1898 r1899 403 403 // here so /only/ the new way will be selected after this method finishes. 404 404 if(alt) { 405 wnew.se lected = false;405 wnew.setSelected(false); 406 406 } 407 407 … … 530 530 title = tr("Add node into way"); 531 531 for (Way w : reuseWays) { 532 w.se lected = false;532 w.setSelected(false); 533 533 } 534 534 } -
trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
r1847 r1899 177 177 sel.remove(osm); 178 178 } 179 } else if (mode == SearchMode.add && !osm. selected&& matcher.match(osm)) {179 } else if (mode == SearchMode.add && !osm.isSelected() && matcher.match(osm)) { 180 180 sel.add(osm); 181 181 ++foundMatches; 182 } else if (mode == SearchMode.remove && osm. selected&& matcher.match(osm)) {182 } else if (mode == SearchMode.remove && osm.isSelected() && matcher.match(osm)) { 183 183 sel.remove(osm); 184 184 ++foundMatches; -
trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java
r1862 r1899 409 409 private static class Selected extends Match { 410 410 @Override public boolean match(OsmPrimitive osm) { 411 return osm. selected;411 return osm.isSelected(); 412 412 } 413 413 @Override public String toString() {return "selected";} -
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r1856 r1899 1 1 // License: GPL. Copyright 2007 by Immanuel Scholz and others 2 2 package org.openstreetmap.josm.data.osm; 3 4 import static org.openstreetmap.josm.tools.I18n.tr; 3 5 4 6 import java.awt.geom.Area; … … 7 9 import java.util.Collection; 8 10 import java.util.Comparator; 11 import java.util.HashMap; 9 12 import java.util.HashSet; 10 import java.util.HashMap;11 13 import java.util.Iterator; 12 14 import java.util.LinkedList; … … 15 17 16 18 import org.openstreetmap.josm.data.SelectionChangedListener; 17 import static org.openstreetmap.josm.tools.I18n.tr;18 19 19 20 /** … … 108 109 /** 109 110 * Adds a primitive to the dataset 110 * 111 * 111 112 * @param primitive the primitive. Ignored if null. 112 113 */ … … 129 130 * {@see #relations}. References from other primitives to this 130 131 * primitive are left unchanged. 131 * 132 * 132 133 * @param primitive the primitive. Ignored if null. 133 134 */ … … 188 189 clearSelection(relations); 189 190 for (OsmPrimitive osm : selection) { 190 osm.se lected = true;191 osm.setSelected(true); 191 192 } 192 193 fireSelectionChanged(selection); … … 203 204 for (OsmPrimitive o : osm) 204 205 if (o != null) { 205 o.se lected = true;206 o.setSelected(true); 206 207 } 207 208 fireSelectionChanged(Arrays.asList(osm)); … … 216 217 return; 217 218 for (OsmPrimitive osm : list) { 218 osm.se lected = false;219 osm.setSelected(false); 219 220 } 220 221 } … … 229 230 return sel; 230 231 for (OsmPrimitive osm : list) 231 if (osm. selected&& !osm.deleted) {232 if (osm.isSelected() && !osm.deleted) { 232 233 sel.add(osm); 233 234 } … … 347 348 * Replies the set of ids of all complete primitivies (i.e. those with 348 349 * ! primitive.incomplete) 349 * 350 * 350 351 * @return the set of ids of all complete primitivies 351 352 */ … … 377 378 /** 378 379 * removes all references from ways in this dataset to a particular node 379 * 380 * 380 381 * @param node the node 381 382 */ … … 393 394 /** 394 395 * removes all references from relations in this dataset to this primitive 395 * 396 * 396 397 * @param primitive the primitive 397 398 */ … … 411 412 * removes all references from from other primitives to the 412 413 * referenced primitive 413 * 414 * 414 415 * @param referencedPrimitive the referenced primitive 415 416 */ … … 426 427 * Replies a list of parent relations which refer to the relation 427 428 * <code>child</code>. Replies an empty list if child is null. 428 * 429 * 429 430 * @param child the child relation 430 431 * @return a list of parent relations which refer to the relation -
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r1843 r1899 100 100 * If set to true, this object is currently selected. 101 101 */ 102 @Deprecated 102 103 public volatile boolean selected = false; 104 105 /** 106 * 107 * @since 1899 108 */ 109 public void setSelected(boolean selected) { 110 this.selected = selected; 111 } 112 /** 113 * 114 * @since 1899 115 */ 116 public boolean isSelected() { 117 return selected; 118 } 103 119 104 120 /** … … 179 195 public final void delete(boolean deleted) { 180 196 this.deleted = deleted; 181 se lected = false;197 setSelected(false); 182 198 modified = true; 183 199 } … … 303 319 modified = osm.modified; 304 320 deleted = osm.deleted; 305 se lected = osm.selected;321 setSelected(osm.isSelected()); 306 322 timestamp = osm.timestamp; 307 323 version = osm.version; -
trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java
r1898 r1899 147 147 148 148 if (nodeStyle != null && isZoomOk(nodeStyle) && showIcons > dist) 149 drawNode(n, nodeStyle.icon, nodeStyle.annotate, n. selected);149 drawNode(n, nodeStyle.icon, nodeStyle.annotate, n.isSelected()); 150 150 else if (n.highlighted) 151 151 drawNode(n, highlightColor, selectedNodeSize, selectedNodeRadius, fillSelectedNode); 152 else if (n. selected)152 else if (n.isSelected()) 153 153 drawNode(n, selectedColor, selectedNodeSize, selectedNodeRadius, fillSelectedNode); 154 154 else if (n.isTagged()) … … 209 209 //profilerVisibleWays++; 210 210 //if(!profilerOmitDraw) 211 drawWay(w, null, untaggedColor, w. selected);211 drawWay(w, null, untaggedColor, w.isSelected()); 212 212 } 213 213 else if(wayStyle instanceof LineElemStyle) … … 216 216 //profilerVisibleWays++; 217 217 //if(!profilerOmitDraw) 218 drawWay(w, (LineElemStyle)wayStyle, untaggedColor, w. selected);218 drawWay(w, (LineElemStyle)wayStyle, untaggedColor, w.isSelected()); 219 219 } 220 220 else if (wayStyle instanceof AreaElemStyle) … … 227 227 { 228 228 // profilerVisibleAreas++; 229 drawArea(w, w. selected? selectedColor : areaStyle.color);229 drawArea(w, w.isSelected() ? selectedColor : areaStyle.color); 230 230 if(!w.isClosed()) 231 231 w.putError(tr("Area style way is not closed."), true); 232 232 } 233 drawWay(w, areaStyle.line, areaStyle.color, w. selected);233 drawWay(w, areaStyle.line, areaStyle.color, w.isSelected()); 234 234 //} 235 235 } … … 240 240 the way is tagged with a direction key 241 241 (even if the tag is negated as in oneway=false) or the way is selected */ 242 boolean showDirection = w. selected|| ((!useRealWidth) && (showDirectionArrow242 boolean showDirection = w.isSelected() || ((!useRealWidth) && (showDirectionArrow 243 243 && (!showRelevantDirectionsOnly || w.hasDirectionKeys()))); 244 244 /* head only takes over control if the option is true, 245 245 the direction should be shown at all and not only because it's selected */ 246 boolean showOnlyHeadArrowOnly = showDirection && !w. selected&& showHeadArrowOnly;246 boolean showOnlyHeadArrowOnly = showDirection && !w.isSelected() && showHeadArrowOnly; 247 247 int width = defaultSegmentWidth; 248 248 int realWidth = 0; /* the real width of the element in meters */ … … 283 283 if(w.highlighted) 284 284 color = highlightColor; 285 else if(w. selected)285 else if(w.isSelected()) 286 286 color = selectedColor; 287 287 … … 298 298 if(lastN != null) 299 299 { 300 drawSeg(lastN, n, s.color != null && !w. selected? s.color : color,300 drawSeg(lastN, n, s.color != null && !w.isSelected() ? s.color : color, 301 301 false, s.getWidth(width), s.dashed, s.dashedColor); 302 302 } … … 331 331 if(lastN != null) 332 332 { 333 drawSeg(lastN, n, s.color != null && !w. selected? s.color : color,333 drawSeg(lastN, n, s.color != null && !w.isSelected() ? s.color : color, 334 334 false, s.getWidth(width), s.dashed, s.dashedColor); 335 335 } … … 377 377 Way c = (Way)joinArray[i]; 378 378 if(w == null) 379 { w = c; selected = w. selected; joinArray[i] = null; --left; }379 { w = c; selected = w.isSelected(); joinArray[i] = null; --left; } 380 380 else 381 381 { … … 403 403 joinArray[i] = null; 404 404 joined = true; 405 if(c. selected) selected = true;405 if(c.isSelected()) selected = true; 406 406 --left; 407 407 if(n == null) n = w.getNodes(); … … 430 430 w = new Way(w); 431 431 w.setNodes(n); 432 w.se lected = selected;432 w.setSelected(selected); 433 433 } 434 434 if(!w.isClosed()) … … 505 505 } 506 506 507 if(r. selected) /* draw ways*/507 if(r.isSelected()) /* draw ways*/ 508 508 { 509 509 for (RelationMember m : r.members) … … 765 765 smallIcon.paintIcon ( Main.map.mapView, g, (int)(pVia.x+vx+vx2)-w/2, (int)(pVia.y+vy+vy2)-h/2 ); 766 766 767 if (r. selected)767 if (r.isSelected()) 768 768 { 769 769 g.setColor ( selectedColor ); … … 811 811 if(m.role == null || m.role.length() == 0) 812 812 outer.add(w); 813 else if(r. selected)813 else if(r.isSelected()) 814 814 drawSelectedMember(m.member, styles != null 815 815 ? getPrimitiveStyle(m.member) : null, true, true); … … 977 977 if(isPolygonVisible(p)) 978 978 { 979 drawAreaPolygon(p, (pd.way. selected || r.selected) ? selectedColor979 drawAreaPolygon(p, (pd.way.isSelected() || r.isSelected()) ? selectedColor 980 980 : areaStyle.color); 981 981 visible = true; … … 1001 1001 { 1002 1002 drawWay(wInner, ((AreaElemStyle)wayStyle).line, 1003 ((AreaElemStyle)wayStyle).color, wInner. selected1004 || r. selected);1003 ((AreaElemStyle)wayStyle).color, wInner.isSelected() 1004 || r.isSelected()); 1005 1005 } 1006 1006 wInner.mappaintDrawnCode = paintid; … … 1008 1008 else 1009 1009 { 1010 if(r. selected)1010 if(r.isSelected()) 1011 1011 { 1012 1012 drawSelectedMember(wInner, innerStyle, 1013 !wayStyle.equals(innerStyle), wInner. selected);1013 !wayStyle.equals(innerStyle), wInner.isSelected()); 1014 1014 } 1015 1015 if(wayStyle.equals(innerStyle)) … … 1017 1017 r.putError(tr("Style for inner way ''{0}'' equals multipolygon.", 1018 1018 wInner.getName()), false); 1019 if(!r. selected)1019 if(!r.isSelected()) 1020 1020 wInner.mappaintDrawnAreaCode = paintid; 1021 1021 } … … 1030 1030 { 1031 1031 drawWay(wOuter, ((AreaElemStyle)wayStyle).line, 1032 ((AreaElemStyle)wayStyle).color, wOuter. selected1033 || r. selected);1032 ((AreaElemStyle)wayStyle).color, wOuter.isSelected() 1033 || r.isSelected()); 1034 1034 } 1035 1035 wOuter.mappaintDrawnCode = paintid; … … 1043 1043 wOuter.getName()), true); 1044 1044 } 1045 if(r. selected)1045 if(r.isSelected()) 1046 1046 { 1047 1047 drawSelectedMember(wOuter, outerStyle, false, false); … … 1363 1363 // profilerN = 0; 1364 1364 for (final OsmPrimitive osm : data.ways) 1365 if (!osm.incomplete && !osm.deleted && !osm. selected1365 if (!osm.incomplete && !osm.deleted && !osm.isSelected() 1366 1366 && osm.mappaintVisibleCode != viewid ) 1367 1367 { -
trunk/src/org/openstreetmap/josm/data/osm/visitor/SimplePaintVisitor.java
r1898 r1899 149 149 //profilerN = 0; 150 150 for (final OsmPrimitive osm : data.relations) 151 if (!osm.deleted && !osm. selected)151 if (!osm.deleted && !osm.isSelected()) 152 152 { 153 153 osm.visit(this); … … 163 163 //profilerN = 0; 164 164 for (final OsmPrimitive osm : data.ways) 165 if (!osm.deleted && !osm. selected&& osm.isTagged())165 if (!osm.deleted && !osm.isSelected() && osm.isTagged()) 166 166 { 167 167 osm.visit(this); … … 171 171 172 172 for (final OsmPrimitive osm : data.ways) 173 if (!osm.deleted && !osm. selected&& !osm.isTagged())173 if (!osm.deleted && !osm.isSelected() && !osm.isTagged()) 174 174 { 175 175 osm.visit(this); … … 202 202 //profilerN = 0; 203 203 for (final OsmPrimitive osm : data.nodes) 204 if (!osm.deleted && !osm. selected)204 if (!osm.deleted && !osm.isSelected()) 205 205 { 206 206 osm.visit(this); … … 253 253 else if (n.highlighted) 254 254 drawNode(n, highlightColor, selectedNodeSize, selectedNodeRadius, fillSelectedNode); 255 else if (n. selected)255 else if (n.isSelected()) 256 256 drawNode(n, selectedColor, selectedNodeSize, selectedNodeRadius, fillSelectedNode); 257 257 else if(n.isTagged()) … … 300 300 (even if the tag is negated as in oneway=false) or the way is selected */ 301 301 302 boolean showThisDirectionArrow = w. selected302 boolean showThisDirectionArrow = w.isSelected() 303 303 || (showDirectionArrow && (!showRelevantDirectionsOnly || w.hasDirectionKeys())); 304 304 /* head only takes over control if the option is true, 305 305 the direction should be shown at all and not only because it's selected */ 306 boolean showOnlyHeadArrowOnly = showThisDirectionArrow && !w. selected&& showHeadArrowOnly;306 boolean showOnlyHeadArrowOnly = showThisDirectionArrow && !w.isSelected() && showHeadArrowOnly; 307 307 Color wayColor; 308 308 … … 311 311 } else if(w.highlighted) { 312 312 wayColor = highlightColor; 313 } else if(w. selected) {313 } else if(w.isSelected()) { 314 314 wayColor = selectedColor; 315 315 } else if (!w.isTagged()) { … … 341 341 if (inactive) { 342 342 col = inactiveColor; 343 } else if (r. selected) {343 } else if (r.isSelected()) { 344 344 col = selectedColor; 345 345 } else { -
trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
r1898 r1899 297 297 // when multiple nodes on one point, prefer new or selected nodes 298 298 else if(dist == minDistanceSq && minPrimitive != null 299 && ((n.id == 0 && n. selected)300 || (!minPrimitive. selected && (n.selected|| n.id == 0)))) {299 && ((n.id == 0 && n.isSelected()) 300 || (!minPrimitive.isSelected() && (n.isSelected() || n.id == 0)))) { 301 301 minPrimitive = n; 302 302 } … … 336 336 double perDist = a-(a-b+c)*(a-b+c)/4/c; // perpendicular distance squared 337 337 if (perDist < snapDistance && a < c+snapDistance && b < c+snapDistance) { 338 if(w. selected) {338 if(w.isSelected()) { 339 339 perDist -= 0.00001; 340 340 } -
trunk/src/org/openstreetmap/josm/io/OsmReader.java
r1881 r1899 86 86 osm.keys = keys; 87 87 osm.modified = modified; 88 osm.se lected = selected;88 osm.setSelected(selected); 89 89 osm.deleted = deleted; 90 90 osm.setTimestamp(timestamp);
Note:
See TracChangeset
for help on using the changeset viewer.