Changeset 4327 in josm for trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
- Timestamp:
- 2011-08-21T13:12:53+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r4310 r4327 115 115 private CopyOnWriteArrayList<DataSetListener> listeners = new CopyOnWriteArrayList<DataSetListener>(); 116 116 117 // provide means to highlight map elements that are not osm primitives 118 private Collection<WaySegment> highlightedVirtualNodes = new LinkedList<WaySegment>(); 119 private Collection<WaySegment> highlightedWaySegments = new LinkedList<WaySegment>(); 120 117 121 // Number of open calls to beginUpdate 118 122 private int updateCount; … … 431 435 432 436 /** 437 * returns an unmodifiable collection of *WaySegments* whose virtual 438 * nodes should be highlighted. WaySegments are used to avoid having 439 * to create a VirtualNode class that wouldn't have much purpose otherwise. 440 * 441 * @return unmodifiable collection of WaySegments 442 */ 443 public Collection<WaySegment> getHighlightedVirtualNodes() { 444 return Collections.unmodifiableCollection(highlightedVirtualNodes); 445 } 446 447 /** 448 * returns an unmodifiable collection of WaySegments that should be 449 * highlighted. 450 * 451 * @return unmodifiable collection of WaySegments 452 */ 453 public Collection<WaySegment> getHighlightedWaySegments() { 454 return Collections.unmodifiableCollection(highlightedWaySegments); 455 } 456 457 /** 433 458 * Replies an unmodifiable collection of primitives currently selected 434 459 * in this dataset. May be empty, but not null. … … 505 530 selectionSnapshot = null; 506 531 return true; 532 } 533 534 /** 535 * set what virtual nodes should be highlighted. Requires a Collection of 536 * *WaySegments* to avoid a VirtualNode class that wouldn't have much use 537 * otherwise. 538 * @param Collection of waySegments 539 */ 540 public void setHighlightedVirtualNodes(Collection<WaySegment> waySegments) { 541 if(highlightedVirtualNodes.isEmpty() && waySegments.isEmpty()) 542 return; 543 544 highlightedVirtualNodes = waySegments; 545 // can't use fireHighlightingChanged because it requires an OsmPrimitive 546 highlightUpdateCount++; 547 } 548 549 /** 550 * set what virtual ways should be highlighted. 551 * @param Collection of waySegments 552 */ 553 public void setHighlightedWaySegments(Collection<WaySegment> waySegments) { 554 if(highlightedWaySegments.isEmpty() && waySegments.isEmpty()) 555 return; 556 557 highlightedWaySegments = waySegments; 558 // can't use fireHighlightingChanged because it requires an OsmPrimitive 559 highlightUpdateCount++; 507 560 } 508 561 … … 590 643 } 591 644 return changed; 645 } 646 647 /** 648 * clear all highlights of virtual nodes 649 */ 650 public void clearHighlightedVirtualNodes() { 651 setHighlightedVirtualNodes(new ArrayList<WaySegment>()); 652 } 653 654 /** 655 * clear all highlights of way segments 656 */ 657 public void clearHighlightedWaySegments() { 658 setHighlightedWaySegments(new ArrayList<WaySegment>()); 592 659 } 593 660
Note:
See TracChangeset
for help on using the changeset viewer.
